Package org . sablecc . pascal ;
Helpers
a | = | 'a' | 'A' |
b | = | 'b' | 'B' |
d | = | 'd' | 'D' |
e | = | 'e' | 'E' |
g | = | 'g' | 'g' |
i | = | 'i' | 'I' |
l | = | 'l' | 'L' |
m | = | 'm' | 'M' |
n | = | 'n' | 'N' |
o | = | 'o' | 'O' |
p | = | 'p' | 'P' |
r | = | 'r' | 'R' |
t | = | 't' | 'T' |
v | = | 'v' | 'V' |
w | = | 'w' | 'W' |
l_curly_bracket | = | '{' |
r_curly_bracket | = | '}' |
ascii_char | = | [ 32 .. 127 ] |
letter | = | [ [ 'a' .. 'z' ] + [ 'A' .. 'Z' ] ] |
digit | = | [ '0' .. '9' ] |
tab | = | 9 |
cr | = | 13 |
lf | = | 10 |
blank | = | ' ' |
Tokens
end | = | e n d | |
div | = | d i v | |
var | = | v a r | |
begin | = | b e g i n | |
program | = | p r o g r a m | |
writeln | = | w r i t e l n | |
integer | = | i n t e g e r | |
plus | = | '+' | |
minus | = | '-' | |
mult | = | '*' | |
assignop | = | ':=' | |
comma | = | ',' | |
colon | = | ':' | |
semicolon | = | ';' | |
dot | = | '.' | |
l_paren | = | '(' | |
r_paren | = | ')' | |
identifier | = | letter ( letter | digit ) * | |
number | = | digit + | |
comment | = | l_curly_bracket [ ascii_char - [ l_curly_bracket + r_curly_bracket ] ] * r_curly_bracket | |
blanks | = | blank | cr lf | cr | lf | tab |
Productions
program | = |
|
|||||||||
program_heading | = |
|
|||||||||
declarations | = |
|
|||||||||
variables_declaration | = |
|
|||||||||
variables_definition_list | = |
|
|||||||||
variables_definition | = |
|
|||||||||
identifier_list | = |
|
|||||||||
type | = |
|
|||||||||
body | = |
|
|||||||||
statement_sequence | = |
|
|||||||||
statement | = |
|
|||||||||
expression | = |
|
|||||||||
term | = |
|
|||||||||
factor | = |
|
This site has been last updated by the web master
on 2007/6/24.