yychar cannot be empty in yyerrlab.

* TODO (yychar == yyempty_): New.
	* data/lalr1.cc: Remove the handling of this case.
	This eases forthcoming changes related to yychar and yytranslate.
This commit is contained in:
Akim Demaille
2008-08-18 21:31:06 +02:00
parent fce629c0ef
commit 27cb5b5901
3 changed files with 35 additions and 11 deletions

View File

@@ -1281,18 +1281,19 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
if (yyerrstatus_ == 3)
{
/* If just tried and failed to reuse lookahead token after an
error, discard it. */
error, discard it. */
if (yychar <= yyeof_)
{
/* Return failure if at end of input. */
if (yychar == yyeof_)
YYABORT;
}
else
{
yy_destroy_ ("Error: discarding", yyla);
yychar = yyempty_;
/* Return failure if at end of input. */
if (yychar == yyeof_)
YYABORT;
else
{]b4_assert_if([
// Previous version of this code was ready to handle
// yychar == yyempty_ (actually yychar <= yyeof_). Can it
// really be triggered?
assert (yychar != yyempty_);])[
yy_destroy_ ("Error: discarding", yyla);
yychar = yyempty_;
}
}