source: branches/Analyzátor gramatiky/grammer/Pl0.grm

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 
1program = block '.' .
2block = { declaration } statement .
3declaration = constant | variable | function .
4constant = CONST constant_definition { ',' constant_definition } ';' .
5constant_definition = NAME '=' NUMBER .
6variable = VAR NAME { ',' NAME } ';' .
7function = FUNCTION NAME '(' [ NAME { ',' NAME } ] ')' block ';' .
8expression = [ ( '-' | '+' ) ] term { ( '-' | '+' ) term } .
9term = factor { ( '*' | '/' ) factor } .
10factor = NAME '(' [ expression { ',' expression } ] ')'
11 | NUMBER | NAME | '(' expression ')' .
12statement = [ NAME ':=' expression
13 | BEGIN statement { ';' statement } END
14 | IF condition THEN statement
15 | WHILE condition DO statement
16 | RETURN expression
17 | WRITE expression ] .
18condition = ODD expression
19 | expression ( '=' | '<>' | '<' | '<=' | '>' | '>=' ) expression .
Note: See TracBrowser for help on using the repository browser.