Changeset 8 for grammer/test.grm
- Timestamp:
- Oct 15, 2007, 8:28:00 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
grammer/test.grm
r5 r8 1 ab1=bc | (s 'g') [{a}] . 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 TracChangeset
for help on using the changeset viewer.