mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 07:13:02 +00:00
lalr1.cc: get rid of yyparse's yystate.
yystate and yystack_[0].state are equal, keep only the latter. The former was also used as a temporary variable to compute the post-reduction state. Move this computation into an auxiliary function. * data/glr.c (yyLRgotoState): Fuse variable definition and first assignment. * data/lalr1.cc (yy_lr_goto_state_): New. (yyparse): Use it. Replace remaining uses of yystate by yystate_[0].state. Remove the former.
This commit is contained in:
@@ -1011,8 +1011,7 @@ yygetLRActions (yyStateNum yystate, int yytoken,
|
||||
static inline yyStateNum
|
||||
yyLRgotoState (yyStateNum yystate, yySymbol yylhs)
|
||||
{
|
||||
int yyr;
|
||||
yyr = yypgoto[yylhs - YYNTOKENS] + yystate;
|
||||
int yyr = yypgoto[yylhs - YYNTOKENS] + yystate;
|
||||
if (0 <= yyr && yyr <= YYLAST && yycheck[yyr] == yystate)
|
||||
return yytable[yyr];
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user