]> git.saurik.com Git - bison.git/commitdiff
* src/output.c (output): Don't free the grammar.
authorAkim Demaille <akim@epita.fr>
Mon, 4 Mar 2002 12:06:42 +0000 (12:06 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 4 Mar 2002 12:06:42 +0000 (12:06 +0000)
* src/reader.c (grammar_free): New.
* src/main.c (main): Call it and don't free symtab here.

ChangeLog
src/main.c
src/output.c
src/reader.c
src/reader.h

index cb69ee0525af706f86f6e0e665897b7fb073a886..234698c0550f77bd0fa13895ee29732e43f93621 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-03-04  Akim Demaille  <akim@epita.fr>
+
+       * src/output.c (output): Don't free the grammar.
+       * src/reader.c (grammar_free): New.
+       * src/main.c (main): Call it and don't free symtab here.
+
 2002-03-04  Akim Demaille  <akim@epita.fr>
 
        * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
 2002-03-04  Akim Demaille  <akim@epita.fr>
 
        * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
index caa451d33ea4228364750aea2188187668d0d02c..16634de571dc76612da85757e139b6110006de3b 100644 (file)
@@ -103,13 +103,11 @@ 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 ();
 
-  /* Free the symbol table data structure.  */
-  free_symtab ();
-
   reduce_free ();
   free_conflicts ();
   free_nullable ();
   free_derives ();
   reduce_free ();
   free_conflicts ();
   free_nullable ();
   free_derives ();
+  grammar_free ();
 
   /* If using alloca.c, flush the alloca'ed memory for the benefit of
      people running Bison as a library in IDEs.  */
 
   /* If using alloca.c, flush the alloca'ed memory for the benefit of
      people running Bison as a library in IDEs.  */
index 2556b42a2e2ae5fa4298e04c542660d2544c7e97..706ee272f1357e083e45a10551be5331146b6cc0 100644 (file)
@@ -1084,7 +1084,6 @@ output (void)
   output_token_translations ();
   output_gram ();
 
   output_token_translations ();
   output_gram ();
 
-  XFREE (ritem);
   if (semantic_parser)
     output_stos ();
   output_rule_data ();
   if (semantic_parser)
     output_stos ();
   output_rule_data ();
@@ -1095,7 +1094,6 @@ output (void)
   /* Process the selected skeleton file.  */
   output_skeleton ();
 
   /* Process the selected skeleton file.  */
   output_skeleton ();
 
-  free (rules + 1);
   obstack_free (&muscle_obstack, NULL);
   obstack_free (&format_obstack, NULL);
   obstack_free (&action_obstack, NULL);
   obstack_free (&muscle_obstack, NULL);
   obstack_free (&format_obstack, NULL);
   obstack_free (&action_obstack, NULL);
index cf3e18f370bc289c7d6c0e47569a2fd988a5ce66..10411fa20d4fc4736d57f9b412d0420e9c1f4e5f 100644 (file)
@@ -1,5 +1,5 @@
 /* Input parser for bison
 /* Input parser for bison
-   Copyright 1984, 1986, 1989, 1992, 1998, 2000, 2001
+   Copyright (C) 1984, 1986, 1989, 1992, 1998, 2000, 2001, 2002
    Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
    Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
@@ -1821,3 +1821,12 @@ reader (void)
   /* The grammar as a symbol_list is no longer needed. */
   LIST_FREE (symbol_list, grammar);
 }
   /* 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.  */
+  free_symtab ();
+}
index 5c6c902739039985f76beb620b5c8558b405ecdf..32f02e96ffc35f4d4f97f4ddfc34954caf426d34 100644 (file)
@@ -1,5 +1,5 @@
 /* Input parser for bison
 /* Input parser for bison
-   Copyright 2000, 2001  Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001, 2002  Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
 
    This file is part of Bison, the GNU Compiler Compiler.
 
    function (YYGUARD or YYACTION) which contains a switch statement to
    decide which guard or action to execute.  */
 
    function (YYGUARD or YYACTION) which contains a switch statement to
    decide which guard or action to execute.  */
 
-extern void reader PARAMS ((void));
+void reader PARAMS ((void));
 
 
+/* Free the packed grammar. */
+void grammar_free PARAMS ((void));
 
 extern int lineno;
 
 
 extern int lineno;