mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 09:13:04 +00:00
c++: report the stack at the same places as in C
Let's have C be the reference, and match it elsewhere. Maybe C is too verbose and some adjustments are needed, but then that would be done in another batch of patches. * data/skeletons/lalr1.cc: Print the stack once we popped after YYERROR, and before emptying the stack at the end of parsing.
This commit is contained in:
@@ -1045,6 +1045,7 @@ b4_dollar_popdef])[]dnl
|
|||||||
this YYERROR. */
|
this YYERROR. */
|
||||||
yypop_ (yylen);
|
yypop_ (yylen);
|
||||||
yylen = 0;
|
yylen = 0;
|
||||||
|
YY_STACK_PRINT ();
|
||||||
goto yyerrlab1;
|
goto yyerrlab1;
|
||||||
|
|
||||||
|
|
||||||
@@ -1116,6 +1117,7 @@ b4_dollar_popdef])[]dnl
|
|||||||
/* Do not reclaim the symbols of the rule whose action triggered
|
/* Do not reclaim the symbols of the rule whose action triggered
|
||||||
this YYABORT or YYACCEPT. */
|
this YYABORT or YYACCEPT. */
|
||||||
yypop_ (yylen);
|
yypop_ (yylen);
|
||||||
|
YY_STACK_PRINT ();
|
||||||
while (1 < yystack_.size ())
|
while (1 < yystack_.size ())
|
||||||
{
|
{
|
||||||
yy_destroy_ ("Cleanup: popping", yystack_[0]);
|
yy_destroy_ ("Cleanup: popping", yystack_[0]);
|
||||||
|
|||||||
@@ -679,6 +679,7 @@ Entering state 2
|
|||||||
Reading a token: Next token is token EOI ()
|
Reading a token: Next token is token EOI ()
|
||||||
Shifting token EOI ()
|
Shifting token EOI ()
|
||||||
Entering state 3
|
Entering state 3
|
||||||
|
Stack now 0 2 3
|
||||||
Cleanup: popping token EOI ()
|
Cleanup: popping token EOI ()
|
||||||
Cleanup: popping nterm expr (40)
|
Cleanup: popping nterm expr (40)
|
||||||
destroy: 40
|
destroy: 40
|
||||||
|
|||||||
Reference in New Issue
Block a user