[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
misleading diagnostics in Bison-generated parser trace
From: |
Paul Eggert |
Subject: |
misleading diagnostics in Bison-generated parser trace |
Date: |
Sun, 21 Aug 2005 22:30:42 -0700 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) |
In <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>
Joel E. Denny writes:
> I also noticed this at the end of the parser trace:
> Error: popping token $end ()Error: popping nterm tree ()Error: popping
> token $end ()
> This did not happen with prior versions of bison for this test case.
> This is a wild guess, but does this have something to do with the new
> destructor call on the start symbol? If so, `Error' is a bit misleading.
Thanks for mentioning this. Yes, it has something to do with that.
I installed this patch:
2005-08-21 Paul Eggert <address@hidden>
* data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
in yydestruct diagnostic, since it might not be an error.
Problem reported by Joel Denny near end of
<http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
* data/lalr1.cc (yyerturn): Likewise.
* data/yacc.c (yyreturn): Likewise.
* tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
Index: data/glr.c
===================================================================
RCS file: /cvsroot/bison/bison/data/glr.c,v
retrieving revision 1.113
retrieving revision 1.114
diff -p -u -r1.113 -r1.114
--- data/glr.c 22 Aug 2005 01:05:52 -0000 1.113
+++ data/glr.c 22 Aug 2005 02:31:10 -0000 1.114
@@ -2169,7 +2169,7 @@ b4_syncline(address@hidden@], address@hidden@])])dnl
yyreturn:
if (yytoken != YYEOF && yytoken != YYEMPTY)
- yydestruct ("Error: discarding lookahead",
+ yydestruct ("Cleanup: discarding lookahead",
yytoken, yylvalp]b4_location_if([, yyllocp])[);
/* If the stack is well-formed, pop the stack until it is empty,
@@ -2183,7 +2183,7 @@ b4_syncline(address@hidden@], address@hidden@])])dnl
{
yyGLRState *yys = yystates[0];
]b4_location_if([[ yystack.yyerror_range[1].yystate.yyloc = yys->yyloc;]]
-)[ yydestruct ("Error: popping",
+)[ yydestruct ("Cleanup: popping",
yystos[yys->yylrState],
&yys->yysemantics.yysval]b4_location_if([,
&yys->yyloc])[);
yystates[0] = yys->yypred;
Index: data/lalr1.cc
===================================================================
RCS file: /cvsroot/bison/bison/data/lalr1.cc,v
retrieving revision 1.92
retrieving revision 1.93
diff -p -u -r1.92 -r1.93
--- data/lalr1.cc 24 Jul 2005 07:24:22 -0000 1.92
+++ data/lalr1.cc 22 Aug 2005 02:31:10 -0000 1.93
@@ -879,11 +879,11 @@ yyabortlab:
yyreturn:
if (yylooka_ != yyeof_ && yylooka_ != yyempty_)
- yydestruct_ ("Error: discarding lookahead", yyilooka_, &yylval, &yylloc);
+ yydestruct_ ("Cleanup: discarding lookahead", yyilooka_, &yylval, &yylloc);
while (yystate_stack_.height () != 1)
{
- yydestruct_ ("Error: popping",
+ yydestruct_ ("Cleanup: popping",
yystos_[yystate_stack_[0]],
&yysemantic_stack_[0],
&yylocation_stack_[0]);
Index: data/yacc.c
===================================================================
RCS file: /cvsroot/bison/bison/data/yacc.c,v
retrieving revision 1.101
retrieving revision 1.102
diff -p -u -r1.101 -r1.102
--- data/yacc.c 24 Jul 2005 07:24:22 -0000 1.101
+++ data/yacc.c 22 Aug 2005 02:31:10 -0000 1.102
@@ -1383,11 +1383,11 @@ yyexhaustedlab:
yyreturn:
if (yychar != YYEOF && yychar != YYEMPTY)
- yydestruct ("Error: discarding lookahead",
+ yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval]b4_location_if([, &yylloc])[);
while (yyssp != yyss)
{
- yydestruct ("Error: popping",
+ yydestruct ("Cleanup: popping",
yystos[*yyssp], yyvsp]b4_location_if([, yylsp])[);
YYPOPSTACK;
}
Index: tests/calc.at
===================================================================
RCS file: /cvsroot/bison/bison/tests/calc.at,v
retrieving revision 1.76
retrieving revision 1.77
diff -p -u -r1.76 -r1.77
--- tests/calc.at 19 Jul 2005 06:56:44 -0000 1.76
+++ tests/calc.at 22 Aug 2005 02:31:10 -0000 1.77
@@ -405,6 +405,7 @@ sed '/^Starting/d
/^Reducing/d
/^Shifting/d
/^state/d
+/^Cleanup:/d
/^Error:/d
/^Next/d
/^Discarding/d
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- misleading diagnostics in Bison-generated parser trace,
Paul Eggert <=