Package org . sablecc . minibasic ;
Helpers
letter | = | [ 'A' .. 'Z' ] |
digit | = | [ '0' .. '9' ] |
cr | = | 13 |
lf | = | 10 |
not_cr_lf | = | [ [ 32 .. 127 ] - [ cr + lf ] ] |
Tokens
if | = | 'IF' | |
then | = | 'THEN' | |
else | = | 'ELSE' | |
endif | = | 'ENDIF' | |
for | = | 'FOR' | |
to | = | 'TO' | |
next | = | 'NEXT' | |
read | = | 'READ' | |
= | 'PRINT' | ||
println | = | 'PRINTLN' | |
assign | = | ':=' | |
less_than | = | '<' | |
greater_than | = | '>' | |
equal | = | '=' | |
plus | = | '+' | |
minus | = | '-' | |
mult | = | '*' | |
div | = | '/' | |
mod | = | 'MOD' | |
l_par | = | '(' | |
r_par | = | ')' | |
identifier | = | letter ( letter | digit ) * | |
number | = | digit + | |
string | = | '"' [ not_cr_lf - '"' ] * '"' | |
new_line | = | cr | lf | cr lf | |
blank | = | ' ' * |
Ignored Tokens
Productions
This site has been last updated by the web master
on 2007/6/24.