From dfffbe7ef353c8920f10f197bf2ac8a00fea3cf7 Mon Sep 17 00:00:00 2001 From: parrt Date: Fri, 14 May 2010 15:07:50 -0800 Subject: [PATCH] improved funcs; args back in; push/pop to func def. [git-p4: depot-paths = "//depot/code/antlr4/main/": change = 6868] --- .../v4/tool/templates/codegen/Java/Java.stg | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) 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 34c289349..120dcdd23 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 @@ -37,25 +37,17 @@ public class { RuleFunction(f,code,decls,context) ::= << - - }>public final void () { + }>public final void (, }>BitSet _follow) { +.push(new ); !> _ctx.push(new (}; separator=",">)); - _(null); - return _ctx.pop(); - - _(null); -} - - - }>public final void _(BitSet _follow) { -.push(new ); !> try { } finally { + return _ctx.pop(); } } >> @@ -148,9 +140,7 @@ cases(ttypes) ::= << >> InvokeRule(r) ::= << -_ctx.push(new ()); - = (); -_ctx.pop(); + = (, }>); >> MatchToken(m) ::= <<