Save reference to root in all AST nodes.
Save ID->RuleAstNode map in root AST node.