From fe3816515c3f3773e7a77fc8dfef76675f484f51 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 22 Aug 2005 01:05:52 +0000 Subject: [PATCH 1/1] (YY_SYMBOL_PRINT): Append a newline, for consistency with the other templates, and to fix bogus run-on messages such as the one reported at the end of . All callers changed to avoid the newline. (yyprocessOneStack): Output two lines rather than one, to accommodate the above change. This changes the debug output format slightly. --- data/glr.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/data/glr.c b/data/glr.c index db26d2be..b5b22fdc 100644 --- a/data/glr.c +++ b/data/glr.c @@ -532,6 +532,7 @@ do { \ YYFPRINTF (stderr, "%s ", Title); \ yysymprint (stderr, \ Type, Value]b4_location_if([, Location])[); \ + YYFPRINTF (stderr, "\n"); \ } \ } while (0) @@ -1748,7 +1749,6 @@ yyprocessOneStack (yyGLRStack* yystack, size_t yyk, yychar = YYLEX; *yytokenp = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", *yytokenp, yylvalp, yyllocp); - YYDPRINTF ((stderr, "\n")); } yygetLRActions (yystate, *yytokenp, &yyaction, &yyconflicts); @@ -1771,7 +1771,8 @@ yyprocessOneStack (yyGLRStack* yystack, size_t yyk, YY_SYMBOL_PRINT ("shifting", *yytokenp, yylvalp, yyllocp); yyglrShift (yystack, yyk, yyaction, yyposn+1, *yylvalp, yyllocp); - YYDPRINTF ((stderr, ", now in state #%d\n", + YYDPRINTF ((stderr, "Stack %lu now in state #%d\n", + (unsigned long int) yyk, yystack->yytops.yystates[yyk]->yylrState)); break; } @@ -1931,7 +1932,6 @@ yyrecoverSyntaxError (yyGLRStack* yystack, yychar = YYLEX; *yytokenp = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", *yytokenp, yylvalp, yyllocp); - YYDPRINTF ((stderr, "\n")); yyj = yypact[yystack->yytops.yystates[0]->yylrState]; if (yyis_pact_ninf (yyj)) return; @@ -1974,7 +1974,6 @@ yyrecoverSyntaxError (yyGLRStack* yystack, YYLLOC_DEFAULT (yyerrloc, yystack->yyerror_range, 2);]])[ YY_SYMBOL_PRINT ("Shifting", yystos[yytable[yyj]], yylvalp, &yyerrloc); - YYDPRINTF ((stderr, "\n")); yyglrShift (yystack, 0, yytable[yyj], yys->yyposn, *yylvalp, &yyerrloc); yys = yystack->yytops.yystates[0]; @@ -2095,7 +2094,6 @@ b4_syncline([@oline@], [@ofile@])])dnl yychar = YYLEX; yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, yylvalp, yyllocp); - YYDPRINTF ((stderr, "\n")); } yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts); if (*yyconflicts != 0) @@ -2103,7 +2101,6 @@ b4_syncline([@oline@], [@ofile@])])dnl if (yyisShiftAction (yyaction)) { YY_SYMBOL_PRINT ("Shifting", yytoken, yylvalp, yyllocp); - YYDPRINTF ((stderr, "\n")); if (yytoken != YYEOF) yytoken = YYEMPTY; yyposn += 1; -- 2.45.2