[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
21-fyi-grammar-free.patch
From: |
Akim Demaille |
Subject: |
21-fyi-grammar-free.patch |
Date: |
Mon, 04 Mar 2002 13:06:41 +0100 |
Index: ChangeLog
from Akim Demaille <address@hidden>
* 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.
Index: src/main.c
--- src/main.c Fri, 01 Mar 2002 15:24:29 +0100 akim
+++ src/main.c Sun, 03 Mar 2002 11:24:03 +0100 akim
@@ -103,13 +103,11 @@
/* 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 ();
+ grammar_free ();
/* If using alloca.c, flush the alloca'ed memory for the benefit of
people running Bison as a library in IDEs. */
Index: src/output.c
--- src/output.c Fri, 01 Mar 2002 15:24:29 +0100 akim
+++ src/output.c Sun, 03 Mar 2002 11:24:57 +0100 akim
@@ -1114,7 +1114,6 @@
output_token_translations ();
output_gram ();
- XFREE (ritem);
if (semantic_parser)
output_stos ();
output_rule_data ();
@@ -1133,7 +1132,6 @@
if (0)
header_output ();
- free (rules + 1);
obstack_free (&muscle_obstack, NULL);
obstack_free (&format_obstack, NULL);
obstack_free (&action_obstack, NULL);
Index: src/reader.c
--- src/reader.c Sun, 06 Jan 2002 21:34:57 +0100 akim
+++ src/reader.c Sun, 03 Mar 2002 11:26:33 +0100 akim
@@ -1,5 +1,5 @@
/* 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.
@@ -1820,4 +1820,13 @@
/* 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: src/reader.h
--- src/reader.h Fri, 28 Dec 2001 16:37:20 +0100 akim
+++ src/reader.h Sun, 03 Mar 2002 11:24:48 +0100 akim
@@ -1,5 +1,5 @@
/* 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.
@@ -27,8 +27,10 @@
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;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- 21-fyi-grammar-free.patch,
Akim Demaille <=