Simplify the grammar.