diff --git a/tool/src/org/antlr/v4/codegen/CodeGenerator.java b/tool/src/org/antlr/v4/codegen/CodeGenerator.java index 75d79f46d..64aff73b1 100644 --- a/tool/src/org/antlr/v4/codegen/CodeGenerator.java +++ b/tool/src/org/antlr/v4/codegen/CodeGenerator.java @@ -91,7 +91,7 @@ public class CodeGenerator { controller.addExtension( new ParserASTExtension(factory) ); } - OutputModelObject outputModel = controller.buildOutputModel(); + OutputModelObject outputModel = controller.buildOutputModel(controller); // CREATE TEMPLATES BY WALKING MODEL OutputModelWalker walker = new OutputModelWalker(g.tool, templates); diff --git a/tool/src/org/antlr/v4/codegen/OutputModelController.java b/tool/src/org/antlr/v4/codegen/OutputModelController.java index e8a3b2d5e..47c7d9ff9 100644 --- a/tool/src/org/antlr/v4/codegen/OutputModelController.java +++ b/tool/src/org/antlr/v4/codegen/OutputModelController.java @@ -22,12 +22,7 @@ public class OutputModelController implements OutputModelFactory { public void addExtension(CodeGeneratorExtension ext) { extensions.add(ext); } - /** Dummy to satisfy interface; controller never calls this. */ public OutputModelObject buildOutputModel(OutputModelController controller) { - return buildOutputModel(); - } - - public OutputModelObject buildOutputModel() { OutputModelObject root = delegate.buildOutputModel(this); for (CodeGeneratorExtension ext : extensions) root = ext.buildOutputModel(root); return root;