mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-17 08:13:02 +00:00
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.
This commit is contained in:
@@ -677,11 +677,7 @@ b4_dollar_popdef[]dnl
|
|||||||
++yynerrs;
|
++yynerrs;
|
||||||
if (yychar == yyempty_)
|
if (yychar == yyempty_)
|
||||||
yytoken = yyempty_;
|
yytoken = yyempty_;
|
||||||
Context yyctx = new Context ();
|
yyreportSyntaxError (new Context (yystack, yytoken]b4_locations_if([[, yylloc]])[));
|
||||||
yyctx.yystack = yystack;
|
|
||||||
yyctx.yytoken = yytoken;]b4_locations_if([[
|
|
||||||
yyctx.yylocation = yylloc;]])[
|
|
||||||
yyreportSyntaxError (yyctx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
]b4_locations_if([[
|
]b4_locations_if([[
|
||||||
@@ -865,6 +861,12 @@ b4_dollar_popdef[]dnl
|
|||||||
*/
|
*/
|
||||||
public static final class Context
|
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 YYStack yystack;
|
||||||
private int yytoken;]b4_locations_if([[
|
private int yytoken;]b4_locations_if([[
|
||||||
public ]b4_location_type[ getLocation ()
|
public ]b4_location_type[ getLocation ()
|
||||||
|
|||||||
Reference in New Issue
Block a user