Antlr4.Runtime.Tree.ParseTreeWalker.EnterRule C# (CSharp) Method

EnterRule() protected method

The discovery of a rule node, involves sending two events: the generic IParseTreeListener.EnterEveryRule(Antlr4.Runtime.ParserRuleContext) and a Antlr4.Runtime.RuleContext -specific event. First we trigger the generic and then the rule specific. We to them in reverse order upon finishing the node.
protected EnterRule ( IParseTreeListener listener, IRuleNode r ) : void
listener IParseTreeListener
r IRuleNode
return void
        protected internal virtual void EnterRule(IParseTreeListener listener, IRuleNode r)
        {
            ParserRuleContext ctx = (ParserRuleContext)r.RuleContext;
            listener.EnterEveryRule(ctx);
            ctx.EnterRule(listener);
        }