use of org.antlr.v4.codegen.model.ListenerDispatchMethod in project antlr4 by antlr.
the class AltLabelStructDecl method addDispatchMethods.
@Override
public void addDispatchMethods(Rule r) {
dispatchMethods = new ArrayList<DispatchMethod>();
if (factory.getGrammar().tool.gen_listener) {
dispatchMethods.add(new ListenerDispatchMethod(factory, true));
dispatchMethods.add(new ListenerDispatchMethod(factory, false));
}
if (factory.getGrammar().tool.gen_visitor) {
dispatchMethods.add(new VisitorDispatchMethod(factory));
}
}
use of org.antlr.v4.codegen.model.ListenerDispatchMethod in project antlr4 by antlr.
the class StructDecl method addDispatchMethods.
public void addDispatchMethods(Rule r) {
dispatchMethods = new ArrayList<DispatchMethod>();
if (!r.hasAltSpecificContexts()) {
// no enter/exit for this ruleContext if rule has labels
if (factory.getGrammar().tool.gen_listener) {
dispatchMethods.add(new ListenerDispatchMethod(factory, true));
dispatchMethods.add(new ListenerDispatchMethod(factory, false));
}
if (factory.getGrammar().tool.gen_visitor) {
dispatchMethods.add(new VisitorDispatchMethod(factory));
}
}
}
Aggregations