]> git.saurik.com Git - bison.git/blobdiff - src/output.c
Some hosts don't like `/' in includes.
[bison.git] / src / output.c
index 4a4f8bd3161198bcce9b137f1f62c58380b1c8ea..b1dd19c03646a2520211795ac297fca3655dd533 100644 (file)
@@ -198,11 +198,6 @@ output_gram (void)
 
     XFREE (yyrhs);
   }
-
-#if 0
-  if (!semantic_parser && !no_parser_flag)
-    obstack_sgrow (&table_obstack, "\n#endif\n");
-#endif
 }
 
 
@@ -885,6 +880,7 @@ output_check (void)
 static void
 output_actions (void)
 {
+  int i;
   nvectors = nstates + nvars;
 
   froms = XCALLOC (short *, nvectors);
@@ -893,8 +889,6 @@ output_actions (void)
   width = XCALLOC (short, nvectors);
 
   token_actions ();
-  LIST_FREE (shifts, first_shift);
-  LIST_FREE (reductions, first_reduction);
   XFREE (LA);
   XFREE (LAruleno);
 
@@ -910,7 +904,14 @@ output_actions (void)
   output_table ();
 
   output_check ();
-  LIST_FREE (state_t, first_state);
+
+  for (i = 0; i < nstates; ++i)
+    {
+      XFREE (state_table[i]->shifts);
+      XFREE (state_table[i]->reductions);
+      XFREE (state_table[i]->errs);
+      free (state_table[i]);
+    }
   XFREE (state_table);
 }
 
@@ -958,8 +959,6 @@ output_parser (const char *skel_filename, struct obstack *oout)
            obstack_sgrow (oout, muscle_value);
          else if (!strcmp (muscle_key, "line"))
            obstack_fgrow1 (oout, "%d", line + 1);
-         else if (!strcmp (muscle_key, "input-line"))
-           obstack_fgrow1 (oout, "%d", lineno);
          else
            {
              obstack_sgrow (oout, "%%");
@@ -1028,6 +1027,7 @@ prepare (void)
   MUSCLE_INSERT_INT ("maxtok", max_user_token_number);
   MUSCLE_INSERT_INT ("ntbase", ntokens);
   MUSCLE_INSERT_INT ("error-verbose", error_verbose);
+  MUSCLE_INSERT_STRING ("prefix", spec_name_prefix);
 
   MUSCLE_INSERT_INT ("nnts", nvars);
   MUSCLE_INSERT_INT ("nrules", nrules);
@@ -1037,10 +1037,9 @@ prepare (void)
   MUSCLE_INSERT_INT ("locations-flag", locations_flag);
 
   /* We need to save the actions in the muscle %%action.  */
+  obstack_1grow (&action_obstack, 0);
   muscle_insert ("action", obstack_finish (&action_obstack));
 
-  if (spec_name_prefix)
-    MUSCLE_INSERT_STRING ("prefix", spec_name_prefix);
 }
 
 /*----------------------------------------------------------.
@@ -1062,11 +1061,9 @@ output (void)
   XFREE (user_toknums);
   output_actions ();
 
-#if 0
-  if (!no_parser_flag) */
-#endif
   prepare ();
   /* Copy definitions in directive.  */
+  obstack_1grow (&attrs_obstack, 0);
   muscle_insert ("prologue", obstack_finish (&attrs_obstack));
 
   output_master_parser ();