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 6b0e9bc07..26ed3f883 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 @@ -320,12 +320,12 @@ case : return ;}; separator="\n"> } >> -RuleFunction(currentRule,code,locals,ruleCtx,altLabelCtxs,namedActions,finallyAction,postamble,exceptions) ::= << +RuleFunction(currentRule,args,code,locals,ruleCtx,altLabelCtxs,namedActions,finallyAction,postamble,exceptions) ::= << }; separator="\n"> - }>public final () throws RecognitionException { + }>public final () throws RecognitionException { _localctx = new (_ctx, getState()}>); enterRule(_localctx, , RULE_); @@ -355,18 +355,18 @@ RuleFunction(currentRule,code,locals,ruleCtx,altLabelCtxs,namedActions,finallyAc } >> -LeftRecursiveRuleFunction(currentRule,code,locals,ruleCtx,altLabelCtxs, +LeftRecursiveRuleFunction(currentRule,args,code,locals,ruleCtx,altLabelCtxs, namedActions,finallyAction,postamble) ::= << }; separator="\n"> - }>public final () throws RecognitionException { + }>public final () throws RecognitionException { return (0}>); } -private (int _p}>) throws RecognitionException { +private (int _p}>) throws RecognitionException { ParserRuleContext _parentctx = _ctx; int _parentState = getState(); _localctx = new (_ctx, _parentState}>); @@ -697,11 +697,11 @@ SetNonLocalAttr(s, rhsChunks) ::= AddToLabelList(a) ::= "..add();" -TokenDecl(t) ::= "public ;" +TokenDecl(t) ::= " " TokenTypeDecl(t) ::= "int ;" -TokenListDecl(t) ::= "public List\ = new ArrayList\();" -RuleContextDecl(r) ::= "public ;" -RuleContextListDecl(rdecl) ::= "public List\<> = new ArrayList\<>();" +TokenListDecl(t) ::= "List\ = new ArrayList\()" +RuleContextDecl(r) ::= " " +RuleContextListDecl(rdecl) ::= "List\<> = new ArrayList\<>()" ContextTokenGetterDecl(t) ::= "public TerminalNode () { return getToken(., 0); }" @@ -743,13 +743,13 @@ ListLabelName(label) ::= "