@@ -780,6 +780,7 @@ namespace
780
780
using glr_state = parser_type::glr_state;
781
781
using symbol_kind = parser_type::symbol_kind;
782
782
using symbol_kind_type = parser_type::symbol_kind_type;
783
+ using symbol_type = parser_type::symbol_type;
783
784
using value_type = parser_type::value_type;]b4_locations_if([[
784
785
using location_type = parser_type::location_type;]])[
785
786
@@ -1171,34 +1172,26 @@ namespace
1171
1172
: yyrule (0 )
1172
1173
, yystate (0 )
1173
1174
, yynext (0 )
1174
- , yytoken (]b4_symbol(empty, kind)[)
1175
- , yyval ()]b4_locations_if([[
1176
- , yyloc ()]])[]b4_parse_assert_if([[
1175
+ , yyla ()]b4_parse_assert_if([[
1177
1176
, magic_ (MAGIC)]])[
1178
1177
{}
1179
1178
1180
1179
semantic_option (rule_num rule)
1181
1180
: yyrule (rule)
1182
1181
, yystate (0 )
1183
1182
, yynext (0 )
1184
- , yytoken (]b4_symbol(empty, kind)[)
1185
- , yyval ()]b4_locations_if([[
1186
- , yyloc ()]])[]b4_parse_assert_if([[
1183
+ , yyla ()]b4_parse_assert_if([[
1187
1184
, magic_ (MAGIC)]])[
1188
1185
{}
1189
1186
1190
1187
semantic_option (const semantic_option& that)
1191
1188
: yyrule (that.yyrule)
1192
1189
, yystate (that.yystate)
1193
1190
, yynext (that.yynext)
1194
- , yytoken (that.yytoken)
1195
- , yyval (]b4_variant_if([], [[that.yyval]])[)]b4_locations_if([[
1196
- , yyloc (that.yyloc)]])[]b4_parse_assert_if([[
1191
+ , yyla (that.yyla)]b4_parse_assert_if([[
1197
1192
, magic_ (MAGIC)]])[
1198
1193
{]b4_parse_assert_if ([[
1199
- that.check_ ();]])[]b4_variant_if ([[
1200
- ]b4_symbol_variant ([yytoken],
1201
- [yyval], [copy], [that.yyval ])])[
1194
+ that.check_ ();]])[
1202
1195
}
1203
1196
1204
1197
// Needed for the assignment in yynewSemanticOption.
@@ -1209,11 +1202,7 @@ namespace
1209
1202
yyrule = that.yyrule ;
1210
1203
yystate = that.yystate ;
1211
1204
yynext = that.yynext ;
1212
- yytoken = that.yytoken ;]b4_variant_if ([[
1213
- ]b4_symbol_variant ([yytoken],
1214
- [yyval], [copy], [that.yyval ])], [[
1215
- yyval = that.yyval ;]])[]b4_locations_if ([[
1216
- yyloc = that.yyloc ;]])[
1205
+ yyla = that.yyla ;
1217
1206
return *this ;
1218
1207
}
1219
1208
@@ -1395,9 +1384,7 @@ namespace
1395
1384
1396
1385
public:
1397
1386
/* * The lookahead for this reduction. */
1398
- symbol_kind_type yytoken;
1399
- value_type yyval;]b4_locations_if([[
1400
- location_type yyloc;]])[
1387
+ symbol_type yyla;
1401
1388
1402
1389
]b4_parse_assert_if([[
1403
1390
public:
@@ -2339,19 +2326,12 @@ b4_dollar_popdef])[]dnl
2339
2326
yyaddDeferredAction (state_set_index yyk, glr_state* yystate,
2340
2327
glr_state* yyrhs, rule_num yyrule)
2341
2328
{
2342
- semantic_option& yynewOption =
2343
- yystateStack.yynewSemanticOption (semantic_option (yyrule));
2344
- yynewOption.setState (yyrhs);
2345
- yynewOption.setNext (yystate->firstVal ());
2346
- if (yystateStack.yytops .lookaheadNeeds (yyk))
2347
- {
2348
- yynewOption.yytoken = this ->yyla .kind ();]b4_variant_if ([[
2349
- ]b4_symbol_variant ([this ->yyla .kind ()],
2350
- [yynewOption.yyval ], [copy], [this ->yyla .value ])], [[
2351
- yynewOption.yyval = this ->yyla .value ;]])[]b4_locations_if ([
2352
- yynewOption.yyloc = this ->yyla .location ;])[
2353
- }
2354
- yystate->setFirstVal (&yynewOption);
2329
+ semantic_option& yyopt = yystateStack.yynewSemanticOption (semantic_option (yyrule));
2330
+ yyopt.setState (yyrhs);
2331
+ yyopt.setNext (yystate->firstVal ());
2332
+ if (yystateStack.yytops .lookaheadNeeds (yyk))
2333
+ yyopt.yyla = this ->yyla ;
2334
+ yystate->setFirstVal (&yyopt);
2355
2335
2356
2336
yyreserveGlrStack ();
2357
2337
}
@@ -3003,16 +2983,11 @@ b4_dollar_popdef])[]dnl
3003
2983
yyrhsVals[YYMAXRHS + YYMAXLEFT - 1 ].getState ().yyloc = yyoptState->yyloc ;]])[
3004
2984
{
3005
2985
symbol_type yyla_current = std::move (this ->yyla );
3006
- this ->yyla .kind_ = yyopt.yytoken ;]b4_variant_if ([[
3007
- ]b4_symbol_variant ([this ->yyla .kind ()],
3008
- [this ->yyla .value ], [move], [yyopt.yyval ])], [[
3009
- this ->yyla .value = yyopt.yyval ;]])[]b4_locations_if ([
3010
- this ->yyla .location = yyopt.yyloc ;])[
2986
+ this ->yyla = std::move (yyopt.yyla );
3011
2987
yyflag = yyuserAction (yyopt.yyrule , yynrhs,
3012
2988
yyrhsVals + YYMAXRHS + YYMAXLEFT - 1 ,
3013
2989
create_state_set_index (-1 ),
3014
2990
yyvalp]b4_locations_if ([, yylocp])[);
3015
-
3016
2991
this ->yyla = std::move (yyla_current);
3017
2992
}
3018
2993
return yyflag;
0 commit comments