Actually handle the yytable zero value correctly this time.

* data/bison.m4 (b4_integral_parser_tables_map): Don't mention
zero values in the YYTABLE comments.
* data/glr.c (yytable_value_is_error): Don't check for zero
value.
* data/lalr1.cc (yy_table_value_is_error_): Likewise.
* data/yacc.c (yytable_value_is_error): Likewise.
* data/lalr1.java (yy_table_value_is_error_): Likewise.
(yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
* src/tables.h: In header comments, explain why it's useless to
check for a zero value in yytable.
This commit is contained in:
Joel E. Denny
2009-08-26 02:40:38 -04:00
parent f2b30bdf37
commit aa0cb40d61
10 changed files with 353 additions and 332 deletions

View File

@@ -745,7 +745,7 @@ m4_popdef([b4_at_dollar])])dnl
int count = 0;
for (int x = yyxbegin; x < yyxend; ++x)
if (yycheck_[x + yyn] == x && x != yyterror_
&& !yy_table_value_is_error_ (yycheck_[x + yyn]))
&& !yy_table_value_is_error_ (yytable_[x + yyn]))
++count;
// FIXME: This method of building the message is not compatible
@@ -757,7 +757,7 @@ m4_popdef([b4_at_dollar])])dnl
count = 0;
for (int x = yyxbegin; x < yyxend; ++x)
if (yycheck_[x + yyn] == x && x != yyterror_
&& !yy_table_value_is_error_ (yycheck_[x + yyn]))
&& !yy_table_value_is_error_ (yytable_[x + yyn]))
{
res.append (count++ == 0 ? ", expecting " : " or ");
res.append (yytnamerr_ (yytname_[x]));
@@ -785,7 +785,7 @@ m4_popdef([b4_at_dollar])])dnl
*/
private static boolean yy_table_value_is_error_ (int yyvalue)
{
return yyvalue == 0 || yyvalue == yytable_ninf_;
return yyvalue == yytable_ninf_;
}
private static final ]b4_int_type_for([b4_pact])[ yypact_ninf_ = ]b4_pact_ninf[;