mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-17 16:23:04 +00:00
* 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.
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2001-12-17 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
|
|
||||||
2001-12-17 Akim Demaille <akim@epita.fr>
|
2001-12-17 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
* src/conflicts.c (print_reductions): Formatting changes.
|
* src/conflicts.c (print_reductions): Formatting changes.
|
||||||
|
|||||||
28
src/files.c
28
src/files.c
@@ -437,34 +437,6 @@ compute_output_file_names (void)
|
|||||||
#endif /* MSDOS */
|
#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. |
|
| Produce the output files. |
|
||||||
|
|||||||
@@ -61,9 +61,6 @@ extern struct obstack output_obstack;
|
|||||||
extern char *infile;
|
extern char *infile;
|
||||||
extern char *attrsfile;
|
extern char *attrsfile;
|
||||||
|
|
||||||
void open_files PARAMS((void));
|
|
||||||
void close_files PARAMS((void));
|
|
||||||
|
|
||||||
void compute_output_file_names PARAMS((void));
|
void compute_output_file_names PARAMS((void));
|
||||||
void output_files PARAMS((void));
|
void output_files PARAMS((void));
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ main (int argc, char *argv[])
|
|||||||
getargs (argc, argv);
|
getargs (argc, argv);
|
||||||
|
|
||||||
muscle_init ();
|
muscle_init ();
|
||||||
open_files ();
|
|
||||||
|
|
||||||
/* Read the input. Copy some parts of it to FGUARD, FACTION, FTABLE
|
/* Read the input. Copy some parts of it to FGUARD, FACTION, FTABLE
|
||||||
and FATTRS. In file reader.c. The other parts are recorded in
|
and FATTRS. In file reader.c. The other parts are recorded in
|
||||||
@@ -103,14 +102,9 @@ main (int argc, char *argv[])
|
|||||||
/* Output the tables and the parser to ftable. In file output. */
|
/* Output the tables and the parser to ftable. In file output. */
|
||||||
output ();
|
output ();
|
||||||
|
|
||||||
/* Close the input files. */
|
|
||||||
close_files ();
|
|
||||||
|
|
||||||
/* Free the symbol table data structure. */
|
/* Free the symbol table data structure. */
|
||||||
free_symtab ();
|
free_symtab ();
|
||||||
|
|
||||||
lex_free ();
|
|
||||||
|
|
||||||
reduce_free ();
|
reduce_free ();
|
||||||
free_conflicts ();
|
free_conflicts ();
|
||||||
free_nullable ();
|
free_nullable ();
|
||||||
|
|||||||
11
src/reader.c
11
src/reader.c
@@ -1865,6 +1865,14 @@ reader (void)
|
|||||||
undeftoken->class = token_sym;
|
undeftoken->class = token_sym;
|
||||||
undeftoken->user_token_number = 2;
|
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
|
/* Read the declaration section. Copy %{ ... %} groups to
|
||||||
TABLE_OBSTACK and FDEFINES file. Also notice any %token, %left,
|
TABLE_OBSTACK and FDEFINES file. Also notice any %token, %left,
|
||||||
etc. found there. */
|
etc. found there. */
|
||||||
@@ -1875,6 +1883,9 @@ reader (void)
|
|||||||
/* Some C code is given at the end of the grammar file. */
|
/* Some C code is given at the end of the grammar file. */
|
||||||
read_additionnal_code ();
|
read_additionnal_code ();
|
||||||
|
|
||||||
|
lex_free ();
|
||||||
|
xfclose (finput);
|
||||||
|
|
||||||
/* Assign the symbols their symbol numbers. Write #defines for the
|
/* Assign the symbols their symbol numbers. Write #defines for the
|
||||||
token symbols into FDEFINES if requested. */
|
token symbols into FDEFINES if requested. */
|
||||||
packsymbols ();
|
packsymbols ();
|
||||||
|
|||||||
Reference in New Issue
Block a user