Ejemplo n.º 1
0
        /// <summary>
        /// The discovery of a rule node, involves sending two events: the generic
        /// <see cref="IParseTreeListener.EnterEveryRule(Antlr4.Runtime.ParserRuleContext)"/>
        /// and a
        /// <see cref="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.
        /// </summary>
        protected internal virtual void EnterRule(IParseTreeListener listener, IRuleNode r)
        {
            ParserRuleContext ctx = (ParserRuleContext)r.RuleContext;

            listener.EnterEveryRule(ctx);
            ctx.EnterRule(listener);
        }
Ejemplo n.º 2
0
 public void EnterEveryRule(ParserRuleContext ctx)
 {
     foreach (var listener in _listeners)
     {
         listener.EnterEveryRule(ctx);
         ctx.EnterRule(listener);
     }
 }
 public void EnterEveryRule(ParserRuleContext ctx)
 {
     foreach (var listener in _listeners)
     {
         listener.EnterEveryRule(ctx);
         ctx.EnterRule(listener);
     }
 }