skeletons: use better names when computing a "goto"

* data/glr.c (yyLRgotoState): Name the symbol argument yysym, instead
of yylhs.
* data/lalr1.cc (yy_lr_goto_state_): Likewise.
* data/lalr1.java (yy_lr_goto_state_): New, modeled after the previous
two routines.
Use it.
This commit is contained in:
Akim Demaille
2013-11-14 16:14:39 +01:00
parent 6d94eebba7
commit edb2e90531
3 changed files with 26 additions and 16 deletions

View File

@@ -910,14 +910,18 @@ yygetLRActions (yyStateNum yystate, int yytoken,
}
}
/** Compute post-reduction state.
* \param yystate the current state
* \param yysym the nonterminal to push on the stack
*/
static inline yyStateNum
yyLRgotoState (yyStateNum yystate, yySymbol yylhs)
yyLRgotoState (yyStateNum yystate, yySymbol yysym)
{
int yyr = yypgoto[yylhs - YYNTOKENS] + yystate;
int yyr = yypgoto[yysym - YYNTOKENS] + yystate;
if (0 <= yyr && yyr <= YYLAST && yycheck[yyr] == yystate)
return yytable[yyr];
else
return yydefgoto[yylhs - YYNTOKENS];
return yydefgoto[yysym - YYNTOKENS];
}
static inline yybool