30 |
|
|
31 |
struct obstack action_obstack; |
struct obstack action_obstack; |
32 |
struct obstack attrs_obstack; |
struct obstack attrs_obstack; |
|
struct obstack table_obstack; |
|
33 |
struct obstack defines_obstack; |
struct obstack defines_obstack; |
34 |
struct obstack guard_obstack; |
struct obstack guard_obstack; |
35 |
struct obstack output_obstack; |
struct obstack output_obstack; |
40 |
char *spec_verbose_file = NULL; /* for --verbose. */ |
char *spec_verbose_file = NULL; /* for --verbose. */ |
41 |
char *spec_graph_file = NULL; /* for -g. */ |
char *spec_graph_file = NULL; /* for -g. */ |
42 |
char *spec_defines_file = NULL; /* for --defines. */ |
char *spec_defines_file = NULL; /* for --defines. */ |
43 |
|
char *parser_file_name = NULL; |
44 |
|
|
45 |
char *infile = NULL; |
char *infile = NULL; |
46 |
char *attrsfile = NULL; |
char *attrsfile = NULL; |
433 |
{ |
{ |
434 |
compute_base_names (); |
compute_base_names (); |
435 |
|
|
436 |
|
parser_file_name = |
437 |
|
spec_outfile ? spec_outfile : stringappend (base_name, src_extension); |
438 |
|
|
439 |
/* If not yet done. */ |
/* If not yet done. */ |
440 |
if (!src_extension) |
if (!src_extension) |
441 |
src_extension = ".c"; |
src_extension = ".c"; |
456 |
#ifndef MSDOS |
#ifndef MSDOS |
457 |
attrsfile = stringappend (attrsfile, header_extension); |
attrsfile = stringappend (attrsfile, header_extension); |
458 |
#endif /* MSDOS */ |
#endif /* MSDOS */ |
|
|
|
459 |
} |
} |
460 |
|
|
461 |
/*-----------------------------------------------------------------. |
/*-----------------------------------------------------------------. |
471 |
/* Initialize the obstacks. */ |
/* Initialize the obstacks. */ |
472 |
obstack_init (&action_obstack); |
obstack_init (&action_obstack); |
473 |
obstack_init (&attrs_obstack); |
obstack_init (&attrs_obstack); |
|
obstack_init (&table_obstack); |
|
474 |
obstack_init (&defines_obstack); |
obstack_init (&defines_obstack); |
475 |
obstack_init (&guard_obstack); |
obstack_init (&guard_obstack); |
476 |
obstack_init (&output_obstack); |
obstack_init (&output_obstack); |
495 |
void |
void |
496 |
output_files (void) |
output_files (void) |
497 |
{ |
{ |
|
/* Output the main file. */ |
|
|
if (spec_outfile) |
|
|
obstack_save (&table_obstack, spec_outfile); |
|
|
else |
|
|
obstack_save (&table_obstack, stringappend (base_name, src_extension)); |
|
|
obstack_free (&table_obstack, NULL); |
|
|
|
|
498 |
/* Output the header file if wanted. */ |
/* Output the header file if wanted. */ |
499 |
if (defines_flag) |
if (defines_flag) |
500 |
defines_obstack_save (spec_defines_file); |
defines_obstack_save (spec_defines_file); |