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

Last change on this file was 28, checked in by george, 15 years ago
  • Delphi projekt převeden na Lazarus projekt.
File size: 829 bytes
Line 
1program = block '.' .
2block = { declaration } statement .
3declaration = constant | variable | function .
4constant = CONST constant_definition { ',' constant_definition } ';' .
5constant_definition = NAME '=' NUMBER .
6variable =
7VAR NAME { ',' NAME } ';' .
8function = FUNCTION NAME '(' [ NAME { ',' NAME } ] ')' block ';' .
9expression = [ ( '-' | '+' ) ] term { ( '-' | '+' ) term } .
10term = factor { ( '*' | '/' ) factor } .
11factor = NAME '(' [ expression { ',' expression } ] ')'
12 | NUMBER | NAME | '(' expression ')' .
13statement = [ NAME ':=' expression
14 | BEGIN statement { ';' statement } END
15 | IF condition THEN statement
16 | WHILE condition DO statement
17 | RETURN expression
18 | WRITE expression ] .
19condition = ODD expression
20 | expression ( '=' | '<>' | '<' | '<=' | '>' | '>=' ) expression .
Note: See TracBrowser for help on using the repository browser.