bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

06-ritem-sentinelless.patch


From: Akim Demaille
Subject: 06-ritem-sentinelless.patch
Date: Mon, 06 May 2002 10:22:26 +0200

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        * src/reader.c (packgram): No longer end `ritem' with a 0
        sentinel: it is not used.
        
        
Index: src/gram.h
--- src/gram.h Sat, 04 May 2002 21:05:50 +0200 akim
+++ src/gram.h Sun, 05 May 2002 14:27:39 +0200 akim
@@ -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.
Index: src/reader.c
--- src/reader.c Sat, 04 May 2002 21:05:50 +0200 akim
+++ src/reader.c Sun, 05 May 2002 14:25:16 +0200 akim
@@ -1740,7 +1740,7 @@
   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 @@
        p = p->next;
     }
 
-  ritem[itemno] = 0;
   assert (itemno == nritems);
 
   if (trace_flag)
Index: src/reduce.c
--- src/reduce.c Wed, 01 May 2002 11:47:24 +0200 akim
+++ src/reduce.c Sun, 05 May 2002 14:26:12 +0200 akim
@@ -258,7 +258,7 @@
     nrules -= nuseless_productions;
   }
 
-  /* Adjust NRITEMS and NITEMS.  */
+  /* Adjust NRITEMS.  */
   {
     int r;
     int length;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]