]> git.saurik.com Git - bison.git/blobdiff - src/main.c
* src/print_graph.c (print_actions): Remove `rule', unused.
[bison.git] / src / main.c
index ba94e7ab5a843a08703495b7530cb909389c06ad..62436a806914b14e38ec28d48d378e5cb1e0dfa9 100644 (file)
@@ -62,15 +62,16 @@ main (int argc, char *argv[])
   if (complain_message_count)
     exit (1);
 
   if (complain_message_count)
     exit (1);
 
-  /* find useless nonterminals and productions and reduce the grammar.  In
-     file reduce.c */
+  /* Find useless nonterminals and productions and reduce the grammar.
+     In file reduce.c.  */
   reduce_grammar ();
 
   reduce_grammar ();
 
-  /* record other info about the grammar.  In files derives and nullable.  */
+  /* Record other info about the grammar.  In files derives and
+     nullable.  */
   set_derives ();
   set_nullable ();
 
   set_derives ();
   set_nullable ();
 
-  /* convert to nondeterministic finite state machine.  In file LR0.
+  /* Convert to nondeterministic finite state machine.  In file LR0.
      See state.h for more info.  */
   generate_states ();
 
      See state.h for more info.  */
   generate_states ();
 
@@ -101,21 +102,22 @@ main (int argc, char *argv[])
   /* Output the tables and the parser to ftable.  In file output.  */
   output ();
 
   /* Output the tables and the parser to ftable.  In file output.  */
   output ();
 
+  /* Close the input files. */
+  close_files ();
+
   /* Free the symbol table data structure.  */
   free_symtab ();
 
   lex_free ();
 
   /* Free the symbol table data structure.  */
   free_symtab ();
 
   lex_free ();
 
-  /* Close the input files. */
-  close_files ();
-
+  reduce_free ();
   free_conflicts ();
   free_nullable ();
   free_derives ();
 
   output_files ();
 
   free_conflicts ();
   free_nullable ();
   free_derives ();
 
   output_files ();
 
-  exit (complain_message_count ? 1 : 0);
+  return complain_message_count ? EXIT_FAILURE : EXIT_SUCCESS;
 }
 \f
 /* Abort for an internal error denoted by string S.  */
 }
 \f
 /* Abort for an internal error denoted by string S.  */