summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorJoel E. Denny <jdenny@clemson.edu>2009-08-26 02:40:38 -0400
committerJoel E. Denny <jdenny@clemson.edu>2009-08-26 03:14:58 -0400
commite4bcae3c5a7701f28bcc3430c60db97b86d13618 (patch)
tree39e33fc251c5171e4fa3b1ff6552a96eafa968d8 /data
parentd5eb0826afb8ede89bfe314671f2b37db55bd817 (diff)
downloadbison-e4bcae3c5a7701f28bcc3430c60db97b86d13618.tar.gz
Actually handle the yytable zero value correctly this time.
* data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: 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. (cherry picked from commit aa0cb40d61cda5bfa9d325a45735439cbbd06327) Conflicts: data/bison.m4 data/lalr1.java
Diffstat (limited to 'data')
-rw-r--r--data/glr.c5
-rw-r--r--data/lalr1.cc5
-rw-r--r--data/lalr1.java8
-rw-r--r--data/yacc.c5
4 files changed, 10 insertions, 13 deletions
diff --git a/data/glr.c b/data/glr.c
index 8d013906..ab5f9d62 100644
--- a/data/glr.c
+++ b/data/glr.c
@@ -442,7 +442,7 @@ static const ]b4_int_type_for([b4_pgoto])[ yypgoto[] =
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
- number is the opposite. If zero or YYTABLE_NINF, syntax error. */
+ number is the opposite. If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF ]b4_table_ninf[
static const ]b4_int_type_for([b4_table])[ yytable[] =
{
@@ -1031,8 +1031,7 @@ yydefaultAction (yyStateNum yystate)
}
#define yytable_value_is_error(yytable_value) \
- (]b4_table_value_equals([[table]], [[yytable_value]], [b4_table_ninf])[ \
- || ]b4_table_value_equals([[table]], [[yytable_value]], [[0]])[)
+ ]b4_table_value_equals([[table]], [[yytable_value]], [b4_table_ninf])[
/** Set *YYACTION to the action to take in YYSTATE on seeing YYTOKEN.
* Result R means
diff --git a/data/lalr1.cc b/data/lalr1.cc
index f0e81002..e681ba6b 100644
--- a/data/lalr1.cc
+++ b/data/lalr1.cc
@@ -535,7 +535,7 @@ do { \
inline bool
]b4_parser_class_name[::yy_table_value_is_error_ (int yyvalue)
{
- return yyvalue == 0 || yyvalue == yytable_ninf_;
+ return yyvalue == yytable_ninf_;
}
int
@@ -937,8 +937,7 @@ b4_error_verbose_if([, int tok])[)
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
- number is the opposite. If zero or YYTABLE_NINF_, syntax
- error. */
+ number is the opposite. If YYTABLE_NINF_, syntax error. */
const ]b4_int_type(b4_table_ninf, b4_table_ninf) b4_parser_class_name::yytable_ninf_ = b4_table_ninf[;
const ]b4_int_type_for([b4_table])[
]b4_parser_class_name[::yytable_[] =
diff --git a/data/lalr1.java b/data/lalr1.java
index 5010ba6a..c19377be 100644
--- a/data/lalr1.java
+++ b/data/lalr1.java
@@ -701,7 +701,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
@@ -713,7 +713,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]));
@@ -741,7 +741,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_;
}
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
@@ -775,7 +775,7 @@ m4_popdef([b4_at_dollar])])dnl
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
- number is the opposite. If zero or YYTABLE_NINF_, syntax error. */
+ number is the opposite. If YYTABLE_NINF_, syntax error. */
private static final ]b4_int_type_for([b4_table])[ yytable_ninf_ = ]b4_table_ninf[;
private static final ]b4_int_type_for([b4_table])[
yytable_[] =
diff --git a/data/yacc.c b/data/yacc.c
index 9f997e84..2dc7112a 100644
--- a/data/yacc.c
+++ b/data/yacc.c
@@ -578,7 +578,7 @@ static const ]b4_int_type_for([b4_pgoto])[ yypgoto[] =
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
- number is the opposite. If zero or YYTABLE_NINF, syntax error. */
+ number is the opposite. If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF ]b4_table_ninf[
static const ]b4_int_type_for([b4_table])[ yytable[] =
{
@@ -589,8 +589,7 @@ static const ]b4_int_type_for([b4_table])[ yytable[] =
]b4_table_value_equals([[pact]], [[yystate]], [b4_pact_ninf])[
#define yytable_value_is_error(yytable_value) \
- (]b4_table_value_equals([[table]], [[yytable_value]], [b4_table_ninf])[ \
- || ]b4_table_value_equals([[table]], [[yytable_value]], [[0]])[)
+ ]b4_table_value_equals([[table]], [[yytable_value]], [b4_table_ninf])[
static const ]b4_int_type_for([b4_check])[ yycheck[] =
{