示例#1
0
            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()]);
            }
示例#2
0
 public virtual ParserRuleContext GetInvokingContext(int ruleIndex)
 {
     ParserRuleContext p = _ctx;
     while (p != null)
     {
         if (p.GetRuleIndex() == ruleIndex)
         {
             return p;
         }
         p = (ParserRuleContext)p.parent;
     }
     return null;
 }
示例#3
0
 public virtual void ExitEveryRule(ParserRuleContext ctx)
 {
     System.Console.Out.WriteLine("exit    " + this._enclosing.RuleNames[ctx.GetRuleIndex()] + ", LT(1)=" + this._enclosing._input.Lt(1).Text);
 }