diff --git a/tool/resources/org/antlr/v4/tool/templates/codegen/Java/Java.stg b/tool/resources/org/antlr/v4/tool/templates/codegen/Java/Java.stg index 24a734843..ead27fedd 100644 --- a/tool/resources/org/antlr/v4/tool/templates/codegen/Java/Java.stg +++ b/tool/resources/org/antlr/v4/tool/templates/codegen/Java/Java.stg @@ -65,33 +65,33 @@ public class extends Parser { dumpActions(recog, argFuncs, actionFuncs, sempredFuncs) ::= << - public ParserRuleContext newContext(RuleContext _localctx, int s, int ruleIndex, int actionIndex) { - switch ( ruleIndex ) { - : return _argEval(()_localctx, s, actionIndex);}; separator="\n"> - } - return new ParserRuleContext(_localctx, s); } - + return new ParserRuleContext(_localctx, s); +} + - public void action(RuleContext _localctx, int ruleIndex, int actionIndex) { - switch ( ruleIndex ) { - : _action(()_localctx, actionIndex);}; separator="\n"> - } } - +} + - public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { - switch ( ruleIndex ) { - : return _sempred(()_localctx, predIndex);}; separator="\n"> - } - return true; } - + return true; +} + >> diff --git a/tool/src/org/antlr/v4/Tool.java b/tool/src/org/antlr/v4/Tool.java index 5556d25fd..68cce678d 100644 --- a/tool/src/org/antlr/v4/Tool.java +++ b/tool/src/org/antlr/v4/Tool.java @@ -625,7 +625,7 @@ public class Tool { for (Grammar ig : grammars) { for (Rule r : ig.rules.values()) { try { - String dot = dotGenerator.getDOT(g.atn.ruleToStartState[r.index]); + String dot = dotGenerator.getDOT(g.atn.ruleToStartState[r.index], g.isLexer()); if (dot != null) { writeDOTFile(g, r, dot); }