add doc about grammer
refactor bnf