307 |
void |
void |
308 |
print_results (void) |
print_results (void) |
309 |
{ |
{ |
310 |
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"); |
|
|
|
|
|
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 (); |
|
311 |
|
|
312 |
xfclose (out); |
/* We used to use just .out if SPEC_NAME_PREFIX (-p) was used, but |
313 |
} |
that conflicts with Posix. */ |
314 |
|
FILE *out = xfopen (spec_verbose_file, "w"); |
315 |
|
|
316 |
|
size_t size = obstack_object_size (&output_obstack); |
317 |
|
fwrite (obstack_finish (&output_obstack), 1, size, out); |
318 |
obstack_free (&output_obstack, NULL); |
obstack_free (&output_obstack, NULL); |
319 |
|
|
320 |
|
if (size) |
321 |
|
fputs ("\n\n", out); |
322 |
|
|
323 |
|
reduce_output (out); |
324 |
|
conflicts_output (out); |
325 |
|
|
326 |
|
print_grammar (out); |
327 |
|
|
328 |
|
/* New experimental feature: output all the items of a state, |
329 |
|
not only its kernel. Requires to run closure, which need |
330 |
|
memory allocation/deallocation. */ |
331 |
|
if (trace_flag) |
332 |
|
new_closure (nitems); |
333 |
|
for (i = 0; i < nstates; i++) |
334 |
|
print_state (out, i); |
335 |
|
if (trace_flag) |
336 |
|
free_closure (); |
337 |
|
|
338 |
|
xfclose (out); |
339 |
} |
} |