]> git.saurik.com Git - bison.git/blobdiff - src/reader.c
* doc/bison.texinfo (Debugging): Split into...
[bison.git] / src / reader.c
index 75957010632f83d9c95c4132521535c48eaec0a3..93df69a6c4f8bc0911791a0f8a4a61447c60b41b 100644 (file)
@@ -1286,12 +1286,12 @@ parse_action (symbol_list *rule, int rule_length)
        switch (c)
          {
          case '\n':
-           obstack_1grow (&action_obstack, c);
+           copy_character (&action_obstack, c);
            ++lineno;
            break;
 
          case '{':
-           obstack_1grow (&action_obstack, c);
+           copy_character (&action_obstack, c);
            ++count;
            break;
 
@@ -1316,12 +1316,12 @@ parse_action (symbol_list *rule, int rule_length)
            fatal (_("unmatched %s"), "`{'");
 
          default:
-           obstack_1grow (&action_obstack, c);
+           copy_character (&action_obstack, c);
          }
 
       /* Above loop exits when C is '}'.  */
       if (--count)
-       obstack_1grow (&action_obstack, c);
+       copy_character (&action_obstack, c);
     }
 
   obstack_1grow (&action_obstack, '\0');
@@ -1736,11 +1736,11 @@ packsymbols (void)
 static void
 packgram (void)
 {
-  int itemno;
+  unsigned int itemno;
   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)
@@ -1871,12 +1870,3 @@ reader (void)
   /* The grammar as a symbol_list is no longer needed. */
   LIST_FREE (symbol_list, grammar);
 }
-
-void
-grammar_free (void)
-{
-  XFREE (ritem);
-  free (rules + 1);
-  /* Free the symbol table data structure.  */
-  symbols_free ();
-}