An exploration of bnf grammars