Remove unused parts of grammar.