Last change
on this file was 10, checked in by george, 16 years ago |
Přesunuto: analýza gramatiky do branches.
Přidáno: Hlavní větev překladač pascalu pro AVR.
|
File size:
827 bytes
|
Line | |
---|
1 | program = block '.' .
|
---|
2 | block = { declaration } statement .
|
---|
3 | declaration = constant | variable | function .
|
---|
4 | constant = CONST constant_definition { ',' constant_definition } ';' .
|
---|
5 | constant_definition = NAME '=' NUMBER .
|
---|
6 | variable = VAR NAME { ',' NAME } ';' .
|
---|
7 | function = FUNCTION NAME '(' [ NAME { ',' NAME } ] ')' block ';' .
|
---|
8 | expression = [ ( '-' | '+' ) ] term { ( '-' | '+' ) term } .
|
---|
9 | term = factor { ( '*' | '/' ) factor } .
|
---|
10 | factor = NAME '(' [ expression { ',' expression } ] ')'
|
---|
11 | | NUMBER | NAME | '(' expression ')' .
|
---|
12 | statement = [ NAME ':=' expression
|
---|
13 | | BEGIN statement { ';' statement } END
|
---|
14 | | IF condition THEN statement
|
---|
15 | | WHILE condition DO statement
|
---|
16 | | RETURN expression
|
---|
17 | | WRITE expression ] .
|
---|
18 | condition = ODD expression
|
---|
19 | | expression ( '=' | '<>' | '<' | '<=' | '>' | '>=' ) expression .
|
---|
Note:
See
TracBrowser
for help on using the repository browser.