/**
  * The discovery of a rule node, involves sending two events: the generic {@link
  * ParseTreeListener#enterEveryRule} and a {@link RuleContext}-specific event. First we trigger
  * the generic and then the rule specific. We to them in reverse order upon finishing the node.
  */
 protected void enterRule(ParseTreeListener listener, RuleNode r) {
   GlobalInfo info = GlobalInfo.getInstance();
   info.enterRuleSetup();
   ParserRuleContext ctx = (ParserRuleContext) r.getRuleContext();
   listener.enterEveryRule(ctx);
   ctx.enterRule(listener);
 }
Exemple #2
0
 /**
  * Notify any parse listeners of an enter rule event.
  *
  * @see #addParseListener
  */
 protected void triggerEnterRuleEvent() {
   for (ParseTreeListener listener : _parseListeners) {
     listener.enterEveryRule(_ctx);
     _ctx.enterRule(listener);
   }
 }
 /**
  * The discovery of a rule node, involves sending two events: the generic discoverRule and a
  * RuleContext-specific event. First we trigger the generic and then the rule specific. We to them
  * in reverse order upon finishing the node.
  */
 protected <Symbol> void enterRule(ParseTreeListener<Symbol> listener, ParseTree.RuleNode r) {
   @SuppressWarnings("unchecked")
   ParserRuleContext<Symbol> ctx = (ParserRuleContext<Symbol>) r.getRuleContext();
   listener.enterEveryRule(ctx);
   ctx.enterRule(listener);
 }