|
|
|
@ -142,10 +142,21 @@ keyword Reserved = 'program' | 'const' | 'var' | 'array' | 'of' | 'integer'
|
|
|
|
|
| 'skip' | 'if' | 'then' | 'else' | 'while' | 'do' | 'not'
|
|
|
|
|
| 'or' | 'and' | 'readln' | 'writeln'
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
lexical Id = ([a-z A-Z 0-9 _] !<< [a-z A-Z][a-z A-Z 0-9 _]* !>> [a-z A-Z 0-9 _]) \ Reserved
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Note that equality is represented as = and inequality is represented as <>
|
|
|
|
|
*/
|
|
|
|
|
lexical Relop = "\<"|"\<="|"\>"|"\>="|"="|"\<\>";
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Either:
|
|
|
|
|
1. A series of digits (integer)
|
|
|
|
|
2. An optional characteristic (right of the ".") and a mandatory mantissa (left of the ".")
|
|
|
|
|
This allows both .1 and 0.1
|
|
|
|
|
*/
|
|
|
|
|
lexical Number = Digit+
|
|
|
|
|
| Digit* "." Digit+
|
|
|
|
|
;
|
|
|
|
|