[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
porting yesterday's yacc.c patches to lalr1.cc
From: |
Paul Eggert |
Subject: |
porting yesterday's yacc.c patches to lalr1.cc |
Date: |
Sun, 22 May 2005 07:44:14 -0000 |
I installed this:
2005-05-22 Paul Eggert <address@hidden>
* data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
yesterday's yacc.c fix.
--- lalr1.cc 22 May 2005 06:26:13 -0000 1.84
+++ lalr1.cc 22 May 2005 07:31:24 -0000 1.85
@@ -544,6 +544,8 @@ yy::]b4_parser_class_name[::set_debug_le
int
yy::]b4_parser_class_name[::parse ()
{
+ int yyresult_;
+
YYCDEBUG << "Starting parse" << std::endl;
yynerrs_ = 0;
@@ -813,14 +815,18 @@ yyerrlab1:
/* Accept. */
yyacceptlab:
- return 0;
+ yyresult_ = 0;
+ goto yyreturn;
/* Abort. */
yyabortlab:
- /* Free the lookahead. */
- yydestruct_ ("Error: discarding lookahead", yyilooka_, &yylval, &yylloc);
- yylooka_ = yyempty_;
- return 1;
+ yyresult_ = 1;
+ goto yyreturn;
+
+yyreturn:
+ if (yylooka_ != yyeof_ && yylooka_ != yyempty_)
+ yydestruct_ ("Error: discarding lookahead", yyilooka_, &yylval, &yylloc);
+ return yyresult_;
}
void
- porting yesterday's yacc.c patches to lalr1.cc,
Paul Eggert <=