Split AST and grammar definition, base grammar and simplify things a bit