* src/reader.c (reader): Remove call to free_symtab ().

* src/main.c (main): Call it here.
Include symtab.h.
* src/conflicts.c (initialize_conflicts): Rename as...
(solve_conflicts): this.
* src/print.c (print_core, print_actions, print_state)
(print_grammar): Dump to a file instead a `output_obstack'.
(print_results): Dump `output_obstack', and then proceed with the
FILE *.
* src/files.c (compute_output_file_names, close_files): New.
(output_files): Adjust.
* src/main.c (main): Adjust.
This commit is contained in:
Akim Demaille
2001-09-24 08:15:53 +00:00
parent 9a96ccfa20
commit bb84601097
23 changed files with 715 additions and 634 deletions

View File

@@ -34,6 +34,7 @@
#include "LR0.h"
#include "conflicts.h"
#include "print_graph.h"
#include "symtab.h"
/* The name this program was run with, for messages. */
char *program_name;
@@ -79,7 +80,15 @@ main (int argc, char *argv[])
lookahead is not enough to disambiguate the parsing. In file
conflicts. Also resolve s/r conflicts based on precedence
declarations. */
initialize_conflicts ();
solve_conflicts ();
/* Output file names. */
compute_output_file_names ();
/* Stop if there were errors, to avoid trashing previous output
files. */
if (complain_message_count)
exit (1);
/* Print information about results, if requested. */
print_results ();
@@ -90,12 +99,17 @@ main (int argc, char *argv[])
/* Output the tables and the parser to ftable. In file output. */
output ();
/* Free the symbol table data structure. */
free_symtab ();
/* Close the input files. */
close_files ();
free_conflicts ();
free_nullable ();
free_derives ();
if (!complain_message_count)
output_files ();
output_files ();
exit (complain_message_count ? 1 : 0);
}