PROG ::= (INSTR (EOI INSTR)*)? INSTR ::= EXPR EXPR ::= IMP IMP ::= OR (imp OR)? OR ::= AND (or AND)* AND ::= EQ (and EQ)* EQ ::= CMP ((eq | ne) CMP)? CMP ::= TERM ((lt | le | gt | ge) TERM)? TERM ::= FACTOR ((add | sub) FACTOR)* FACTOR ::= UNOP ((mul | div | mod) UNOP)* UNOP ::= (add | sub | not)? POW POW ::= GROUP (pow GROUP)? GROUP ::= BASE | opar EXPR cpar BASE ::= int | bool