From a900a6248cb96beb60a5ef480e2dc0836c2bda66 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 6 May 2002 08:23:28 +0000 Subject: [PATCH] * src/reader.c (packgram): No longer end `ritem' with a 0 sentinel: it is not used. --- ChangeLog | 8 ++++++-- src/gram.h | 8 +++----- src/reader.c | 3 +-- src/reduce.c | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index d49ff431..c6588105 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-05-06 Akim Demaille + + * src/reader.c (packgram): No longer end `ritem' with a 0 + sentinel: it is not used. + + 2002-05-05 Akim Demaille New experimental feature: display the lookaheads in the report and @@ -30,7 +36,6 @@ * data/bison.simple, data/bison.c++: b4_token_number_max is now b4_translate_max. - 2002-05-05 Akim Demaille * src/output.c (output_unsigned_int_table): New. @@ -43,7 +48,6 @@ to compute types instead of constant types. * tests/regression.at (Web2c Actions): Adjust. - 2002-05-04 Akim Demaille * src/symtab.h (SALIAS, SUNDEF): Rename as... diff --git a/src/gram.h b/src/gram.h index af4e636c..88946cff 100644 --- a/src/gram.h +++ b/src/gram.h @@ -81,11 +81,9 @@ contains minus R, which identifies it as the end of a portion and says which rule it is for. - The portions of RITEM come in order of increasing rule number and - are followed by an element which is zero to mark the end. nritems - is the total length of ritem, not counting the final zero. Each - element of RITEM is called an "item" and its index in RITEM is an - item number. + The portions of RITEM come in order of increasing rule number. + NRITEMS is the total length of RITEM. Each element of RITEM is + called an "item" and its index in RITEM is an item number. Item numbers are used in the finite state machine to represent places that parsing can get to. diff --git a/src/reader.c b/src/reader.c index 6106037c..f0753460 100644 --- a/src/reader.c +++ b/src/reader.c @@ -1740,7 +1740,7 @@ packgram (void) int ruleno; symbol_list *p; - ritem = XCALLOC (item_number_t, nritems + 1); + ritem = XCALLOC (item_number_t, nritems); rules = XCALLOC (rule_t, nrules) - 1; itemno = 0; @@ -1787,7 +1787,6 @@ packgram (void) p = p->next; } - ritem[itemno] = 0; assert (itemno == nritems); if (trace_flag) diff --git a/src/reduce.c b/src/reduce.c index 61ad2b2e..2d51a24c 100644 --- a/src/reduce.c +++ b/src/reduce.c @@ -258,7 +258,7 @@ reduce_grammar_tables (void) nrules -= nuseless_productions; } - /* Adjust NRITEMS and NITEMS. */ + /* Adjust NRITEMS. */ { int r; int length; -- 2.47.2