Implementing EBNF grammar.