[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
07-fyi-open-close.patch
From: |
Akim Demaille |
Subject: |
07-fyi-open-close.patch |
Date: |
Mon, 17 Dec 2001 18:21:06 +0100 |
Index: ChangeLog
from Akim Demaille <address@hidden>
* src/files.h, src/files.c (open_files, close_files): Remove.
* src/main.c (main): Don't open/close files, nor invoke lex_free,
let...
* src/reader.c (reader): Do it.
Index: src/files.c
--- src/files.c Sun, 16 Dec 2001 11:51:05 +0100 akim
+++ src/files.c Sun, 16 Dec 2001 17:36:12 +0100 akim
@@ -437,34 +437,6 @@
#endif /* MSDOS */
}
-/*-----------------------------------------------------------------.
-| Open the input file. Look for the skeletons. Find the names of |
-| the output files. Prepare the obstacks. |
-`-----------------------------------------------------------------*/
-
-void
-open_files (void)
-{
- finput = xfopen (infile, "r");
-
- /* Initialize the obstacks. */
- obstack_init (&action_obstack);
- obstack_init (&attrs_obstack);
- obstack_init (&guard_obstack);
- obstack_init (&output_obstack);
-}
-
-
-
-/*-----------------------.
-| Close the open file.. |
-`-----------------------*/
-
-void
-close_files (void)
-{
- xfclose (finput);
-}
/*---------------------------.
| Produce the output files. |
Index: src/files.h
--- src/files.h Sun, 16 Dec 2001 11:40:41 +0100 akim
+++ src/files.h Sun, 16 Dec 2001 17:37:41 +0100 akim
@@ -61,9 +61,6 @@
extern char *infile;
extern char *attrsfile;
-void open_files PARAMS((void));
-void close_files PARAMS((void));
-
void compute_output_file_names PARAMS((void));
void output_files PARAMS((void));
Index: src/main.c
--- src/main.c Sun, 16 Dec 2001 11:51:05 +0100 akim
+++ src/main.c Sun, 16 Dec 2001 17:37:28 +0100 akim
@@ -53,7 +53,6 @@
getargs (argc, argv);
muscle_init ();
- open_files ();
/* Read the input. Copy some parts of it to FGUARD, FACTION, FTABLE
and FATTRS. In file reader.c. The other parts are recorded in
@@ -103,13 +102,8 @@
/* 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 ();
reduce_free ();
free_conflicts ();
Index: src/reader.c
--- src/reader.c Sun, 16 Dec 2001 11:40:41 +0100 akim
+++ src/reader.c Sun, 16 Dec 2001 17:36:55 +0100 akim
@@ -1865,6 +1865,14 @@
undeftoken->class = token_sym;
undeftoken->user_token_number = 2;
+ /* Initialize the obstacks. */
+ obstack_init (&action_obstack);
+ obstack_init (&attrs_obstack);
+ obstack_init (&guard_obstack);
+ obstack_init (&output_obstack);
+
+ finput = xfopen (infile, "r");
+
/* Read the declaration section. Copy %{ ... %} groups to
TABLE_OBSTACK and FDEFINES file. Also notice any %token, %left,
etc. found there. */
@@ -1874,6 +1882,9 @@
readgram ();
/* Some C code is given at the end of the grammar file. */
read_additionnal_code ();
+
+ lex_free ();
+ xfclose (finput);
/* Assign the symbols their symbol numbers. Write #defines for the
token symbols into FDEFINES if requested. */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- 07-fyi-open-close.patch,
Akim Demaille <=