mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
style: comments changes about error handling
* data/skeletons/glr.c, data/skeletons/lalr1.cc, data/skeletons/lalr1.d, * data/skeletons/lalr1.java, data/skeletons/yacc.c: here. * data/skeletons/lalr1.cc: Reduce scope.
This commit is contained in:
@@ -1124,32 +1124,33 @@ b4_dollar_popdef])[]dnl
|
||||
`-------------------------------------------------------------*/
|
||||
yyerrlab1:
|
||||
yyerrstatus_ = 3; // Each real token shifted decrements this.
|
||||
// Pop stack until we find a state that shifts the error token.
|
||||
for (;;)
|
||||
{
|
||||
yyn = yypact_[+yystack_[0].state];
|
||||
if (!yy_pact_value_is_default_ (yyn))
|
||||
{
|
||||
yyn += symbol_kind::]b4_symbol_prefix[YYERROR;
|
||||
if (0 <= yyn && yyn <= yylast_
|
||||
&& yycheck_[yyn] == symbol_kind::]b4_symbol_prefix[YYERROR)
|
||||
{
|
||||
yyn = yytable_[yyn];
|
||||
if (0 < yyn)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Pop the current state because it cannot handle the error token.
|
||||
if (yystack_.size () == 1)
|
||||
YYABORT;
|
||||
]b4_locations_if([[
|
||||
yyerror_range[1].location = yystack_[0].location;]])[
|
||||
yy_destroy_ ("Error: popping", yystack_[0]);
|
||||
yypop_ ();
|
||||
YY_STACK_PRINT ();
|
||||
}
|
||||
{
|
||||
stack_symbol_type error_token;
|
||||
for (;;)
|
||||
{
|
||||
yyn = yypact_[+yystack_[0].state];
|
||||
if (!yy_pact_value_is_default_ (yyn))
|
||||
{
|
||||
yyn += symbol_kind::]b4_symbol_prefix[YYERROR;
|
||||
if (0 <= yyn && yyn <= yylast_
|
||||
&& yycheck_[yyn] == symbol_kind::]b4_symbol_prefix[YYERROR)
|
||||
{
|
||||
yyn = yytable_[yyn];
|
||||
if (0 < yyn)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Pop the current state because it cannot handle the error token.
|
||||
if (yystack_.size () == 1)
|
||||
YYABORT;
|
||||
]b4_locations_if([[
|
||||
yyerror_range[1].location = yystack_[0].location;]])[
|
||||
yy_destroy_ ("Error: popping", yystack_[0]);
|
||||
yypop_ ();
|
||||
YY_STACK_PRINT ();
|
||||
}
|
||||
]b4_locations_if([[
|
||||
yyerror_range[2].location = yyla.location;
|
||||
YYLLOC_DEFAULT (error_token.location, yyerror_range, 2);]])[
|
||||
|
||||
Reference in New Issue
Block a user