GrammarProcessor class