BNF: bnf grammar translated in lua with precedence