avoid infinite recursion in ebnf parser