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:
Akim Demaille
2004-09-16 14:14:27 +00:00
parent 9c66f418c4
commit 1576d44dce
6 changed files with 44 additions and 32 deletions

View File

@@ -400,7 +400,8 @@ yy::]b4_parser_class_name[::symprint_ (int yytype,
(void) yylocationp;
cdebug_ << (yytype < ntokens_ ? "token" : "nterm")
<< ' ' << name_[yytype] << " (";
<< ' ' << name_[yytype] << " ("
<< *yylocationp << ": ";
switch (yytype)
{
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
@@ -419,8 +420,6 @@ yy::]b4_parser_class_name[::destruct_ (const char *yymsg,
(void) yyvaluep;
(void) yylocationp;
if (!yymsg)
yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
switch (yytype)
@@ -520,10 +519,7 @@ yybackup:
goto yyacceptlab;
/* Shift the look-ahead token. */
#if YYDEBUG
YYCDEBUG << "Shifting token " << looka_
<< " (" << name_[ilooka_] << "), ";
#endif
YY_SYMBOL_PRINT ("Shifting", ilooka_, &value, &location);
/* Discard the token being shifted unless it is eof. */
if (looka_ != eof_)
@@ -697,8 +693,6 @@ yyerrlab1:
if (n_ == final_)
goto yyacceptlab;
YYCDEBUG << "Shifting error token, ";
{
Location errloc;
errloc.begin = error_start_;
@@ -707,6 +701,10 @@ yyerrlab1:
location_stack_.push (errloc);
}
/* Shift the error token. */
YY_SYMBOL_PRINT ("Shifting", stos_[n_],
&semantic_stack_[0], &location_stack_[0]);
state_ = n_;
goto yynewstate;