converting parser to correspond to ebnf