summaryrefslogtreecommitdiff
path: root/data/skeletons
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2020-02-12 08:48:36 +0100
committerAkim Demaille <akim.demaille@gmail.com>2020-02-13 19:22:10 +0100
commit1e25cb44d17053d135cf760fe6169a67892bf2d1 (patch)
tree3c863a61d91538e4c8b9f50a0baf281854415f80 /data/skeletons
parent3ed42d2487e3d9a50ffd165bc50e771e5b429c20 (diff)
downloadbison-1e25cb44d17053d135cf760fe6169a67892bf2d1.tar.gz
java: provide a Context ctor
This is really a private auxiliary inner class, so it should not matter. But it's better style. * data/skeletons/lalr1.java: here.
Diffstat (limited to 'data/skeletons')
-rw-r--r--data/skeletons/lalr1.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/data/skeletons/lalr1.java b/data/skeletons/lalr1.java
index 1d9bc765..71b9f385 100644
--- a/data/skeletons/lalr1.java
+++ b/data/skeletons/lalr1.java
@@ -677,11 +677,7 @@ b4_dollar_popdef[]dnl
++yynerrs;
if (yychar == yyempty_)
yytoken = yyempty_;
- Context yyctx = new Context ();
- yyctx.yystack = yystack;
- yyctx.yytoken = yytoken;]b4_locations_if([[
- yyctx.yylocation = yylloc;]])[
- yyreportSyntaxError (yyctx);
+ yyreportSyntaxError (new Context (yystack, yytoken]b4_locations_if([[, yylloc]])[));
}
]b4_locations_if([[
@@ -865,6 +861,12 @@ b4_dollar_popdef[]dnl
*/
public static final class Context
{
+ Context (YYStack stack, int token]b4_locations_if([[, ]b4_location_type[ loc]])[)
+ {
+ yystack = stack;
+ yytoken = token;]b4_locations_if([[
+ yylocation = loc;]])[
+ }
private YYStack yystack;
private int yytoken;]b4_locations_if([[
public ]b4_location_type[ getLocation ()