statement ::= assignment | cond | loop
loop ::= while boolexpr do statement od
cond ::= if boolexpr then statement fi | if boolexpr then statement else statement fi
expr ::= numexpr | boolexpr
boolexpr ::= numexpr cop numexpr
numexpr ::= numexpr '+' term | term
term ::= term '*' factor | factor
factor ::= id | const | '(' numexpr ')'