forked from jasder/antlr
dont gen visitor unless -visitor option
This commit is contained in:
parent
2b9511f333
commit
44c0c8ca5e
|
@ -50,7 +50,9 @@ public class AltLabelStructDecl extends StructDecl {
|
|||
@Override
|
||||
public void addDispatchMethods(Rule r) {
|
||||
super.addDispatchMethods(r);
|
||||
dispatchMethods.add(new VisitorDispatchMethod(factory));
|
||||
if ( factory.getGrammar().tool.gen_visitor ) {
|
||||
dispatchMethods.add(new VisitorDispatchMethod(factory));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -58,7 +58,7 @@ public class StructDecl extends Decl {
|
|||
dispatchMethods = new ArrayList<DispatchMethod>();
|
||||
dispatchMethods.add(new ListenerDispatchMethod(factory, true));
|
||||
dispatchMethods.add(new ListenerDispatchMethod(factory, false));
|
||||
if ( !r.hasAltSpecificContexts() ) {
|
||||
if ( factory.getGrammar().tool.gen_visitor && !r.hasAltSpecificContexts() ) {
|
||||
dispatchMethods.add(new VisitorDispatchMethod(factory));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue