Add GrammarNode and TokenGraph for modeling grammar