mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-16 07:43:03 +00:00
* data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
argument, an informative message. Call YY_SYMBOL_PRINT. Adjust all callers: integrate the associated YY_SYMBOL_PRINT. * data/lalr1.cc (destruct_): Likewise. In addition, no longer depend on b4_yysymprint_generate and b4_yydestruct_generate to generate these functions, do it "by hand".
This commit is contained in:
15
data/yacc.c
15
data/yacc.c
@@ -1114,15 +1114,13 @@ yyerrlab:
|
||||
YYPOPSTACK;
|
||||
if (yyssp == yyss)
|
||||
YYABORT;
|
||||
YY_SYMBOL_PRINT ("Error: popping",
|
||||
yystos[*yyssp], yyvsp, yylsp);
|
||||
yydestruct (yystos[*yyssp], yyvsp]b4_location_if([, yylsp])[);
|
||||
yydestruct ("Error: popping",
|
||||
yystos[*yyssp], yyvsp]b4_location_if([, yylsp])[);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
YY_SYMBOL_PRINT ("Error: discarding", yytoken, &yylval, &yylloc);
|
||||
yydestruct (yytoken, &yylval]b4_location_if([, &yylloc])[);
|
||||
yydestruct ("Error: discarding", yytoken, &yylval]b4_location_if([, &yylloc])[);
|
||||
yychar = YYEMPTY;
|
||||
]b4_location_if([ *++yylerrsp = yylloc;])[
|
||||
}
|
||||
@@ -1178,8 +1176,7 @@ yyerrlab1:
|
||||
if (yyssp == yyss)
|
||||
YYABORT;
|
||||
|
||||
YY_SYMBOL_PRINT ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
|
||||
yydestruct (yystos[yystate], yyvsp]b4_location_if([, yylsp])[);
|
||||
yydestruct ("Error: popping", yystos[yystate], yyvsp]b4_location_if([, yylsp])[);
|
||||
YYPOPSTACK;
|
||||
yystate = *yyssp;
|
||||
YY_STACK_PRINT (yyss, yyssp);
|
||||
@@ -1209,8 +1206,8 @@ yyacceptlab:
|
||||
| yyabortlab -- YYABORT comes here. |
|
||||
`-----------------------------------*/
|
||||
yyabortlab:
|
||||
YY_SYMBOL_PRINT ("Error: discarding lookahead", yytoken, &yylval, &yylloc);
|
||||
yydestruct (yytoken, &yylval]b4_location_if([, &yylloc])[);
|
||||
yydestruct ("Error: discarding lookahead",
|
||||
yytoken, &yylval]b4_location_if([, &yylloc])[);
|
||||
yychar = YYEMPTY;
|
||||
yyresult = 1;
|
||||
goto yyreturn;
|
||||
|
||||
Reference in New Issue
Block a user