mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-14 14:53:03 +00:00
Have more complete shift traces.
* data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT to report Shifts instead of ad hoc YYDPRINTF invocations, including for the error token. * data/lalr1.cc (symprint_): Output the location. * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't output the location within the %printer. Activate GLR tests, at least to make sure they compile properly. They still don't pass though. * tests/calc.at: Adjust expect verbose output, since now "Entering state..." is on a different line than the "Shifting" message.
This commit is contained in:
12
data/glr.c
12
data/glr.c
@@ -1578,11 +1578,11 @@ yyprocessOneStack (yyGLRStack* yystack, int yyk,
|
||||
|
||||
if (yyisShiftAction (yyaction))
|
||||
{
|
||||
YYDPRINTF ((stderr, "Shifting token %s on stack %d, ",
|
||||
yytokenName (*yytokenp), yyk));
|
||||
YYDPRINTF ((stderr, "On stack %d, ", yyk));
|
||||
YY_SYMBOL_PRINT ("shifting", yytokenp, yylvalp, yyllocp);
|
||||
yyglrShift (yystack, yyk, yyaction, yyposn+1,
|
||||
*yylvalp, yyllocp]b4_user_args[);
|
||||
YYDPRINTF ((stderr, "which is now in state #%d\n",
|
||||
YYDPRINTF ((stderr, ", now in state #%d\n",
|
||||
yystack->yytops.yystates[yyk]->yylrState));
|
||||
break;
|
||||
}
|
||||
@@ -1750,7 +1750,8 @@ yyrecoverSyntaxError (yyGLRStack* yystack,
|
||||
if (0 <= yyj && yyj <= YYLAST && yycheck[yyj] == YYTERROR
|
||||
&& yyisShiftAction (yytable[yyj]))
|
||||
{
|
||||
YYDPRINTF ((stderr, "Shifting error token, "));
|
||||
YY_SYMBOL_PRINT ("Shifting", yystos[yytable[yyj]],
|
||||
yylvalp, yyllocp);
|
||||
yyglrShift (yystack, 0, yytable[yyj],
|
||||
yys->yyposn, *yylvalp, yyllocp]b4_user_args[);
|
||||
break;
|
||||
@@ -1856,8 +1857,7 @@ yyrecoverSyntaxError (yyGLRStack* yystack,
|
||||
break;
|
||||
if (yyisShiftAction (yyaction))
|
||||
{
|
||||
YYDPRINTF ((stderr, "Shifting token %s, ",
|
||||
yytokenName (yytoken)));
|
||||
YY_SYMBOL_PRINT ("Shifting", yytoken, yylvalp, yyllocp);
|
||||
if (yytoken != YYEOF)
|
||||
yytoken = YYEMPTY;
|
||||
yyposn += 1;
|
||||
|
||||
Reference in New Issue
Block a user