public virtual void VisitTerminal(ITerminalNode node) { ParserRuleContext parent = (ParserRuleContext)((IRuleNode)node.Parent).RuleContext; IToken token = node.Symbol; System.Console.Out.WriteLine("consume " + token + " rule " + this._enclosing.RuleNames [parent.GetRuleIndex()]); }
public virtual ParserRuleContext GetInvokingContext(int ruleIndex) { ParserRuleContext p = _ctx; while (p != null) { if (p.GetRuleIndex() == ruleIndex) { return p; } p = (ParserRuleContext)p.parent; } return null; }
public virtual void ExitEveryRule(ParserRuleContext ctx) { System.Console.Out.WriteLine("exit " + this._enclosing.RuleNames[ctx.GetRuleIndex()] + ", LT(1)=" + this._enclosing._input.Lt(1).Text); }