* src/files.c (output_files): Free the output_obstack.

* src/main.c (main): Call print and print_graph conditionally.
* src/print.c (print): Work unconditionally.
* src/print_graph.c (print_graph): Work unconditionally.
* src/conflicts.c (log_resolution): Output only if verbose_flag.
This commit is contained in:
Akim Demaille
2001-12-17 17:31:10 +00:00
parent 367c7a47d4
commit 64d15509b6
6 changed files with 45 additions and 38 deletions

View File

@@ -307,35 +307,33 @@ print_grammar (FILE *out)
void
print_results (void)
{
if (verbose_flag)
{
int i;
int i;
/* We used to use just .out if SPEC_NAME_PREFIX (-p) was used, but
that conflicts with Posix. */
FILE *out = xfopen (spec_verbose_file, "w");
/* We used to use just .out if SPEC_NAME_PREFIX (-p) was used, but
that conflicts with Posix. */
FILE *out = xfopen (spec_verbose_file, "w");
size_t size = obstack_object_size (&output_obstack);
fwrite (obstack_finish (&output_obstack), 1, size, out);
if (size)
fputs ("\n\n", out);
reduce_output (out);
conflicts_output (out);
print_grammar (out);
/* New experimental feature: output all the items of a state,
not only its kernel. Requires to run closure, which need
memory allocation/deallocation. */
if (trace_flag)
new_closure (nitems);
for (i = 0; i < nstates; i++)
print_state (out, i);
if (trace_flag)
free_closure ();
xfclose (out);
}
size_t size = obstack_object_size (&output_obstack);
fwrite (obstack_finish (&output_obstack), 1, size, out);
obstack_free (&output_obstack, NULL);
if (size)
fputs ("\n\n", out);
reduce_output (out);
conflicts_output (out);
print_grammar (out);
/* New experimental feature: output all the items of a state,
not only its kernel. Requires to run closure, which need
memory allocation/deallocation. */
if (trace_flag)
new_closure (nitems);
for (i = 0; i < nstates; i++)
print_state (out, i);
if (trace_flag)
free_closure ();
xfclose (out);
}