P | : | program |
L | : | list |
S | : | statement |
E | : | expression |
N | : | number |
D | : | digit |
I | : | identifier |
L | : | letter |
P | -> | L |
L | -> | L1 ';' L2 | S |
S | -> | I ':=' E | 'if' E 'then' L1 'else' L2 'fi' | 'while' E 'do' L 'od' |
E | -> | E1 '+' E2 | E1 '-' E2 | E1 '*' E2 | E1 '/' E2 | E1 '%' E2 | N |
N | -> | N D | D |
D | -> | '0' | '1' | '2' | ... | '9' |
I | -> | I L | L |
L | -> | 'a' | 'b' | 'c' | ... | 'z' |