char *spec_outfile = NULL; /* for -o. */
char *spec_file_prefix = NULL; /* for -b. */
char *spec_name_prefix = NULL; /* for -p. */
+char *spec_graph_file = NULL; /* for -g. */
+char *spec_defines_file = NULL; /* for --defines. */
char *infile = NULL;
char *attrsfile = NULL;
static void
compute_exts_from_gf (const char *ext)
{
- /* Checks if SRC_EXTENSION is NULL. In the other case, %source_extension
- was specified in the grammar file. */
- if (src_extension == NULL)
- {
- src_extension = tr (ext, 'y', 'c');
- src_extension = tr (src_extension, 'Y', 'C');
- }
- /* Checks if HEADER_EXTENSION is NULL. In the other case,
- %header_extension was specified in the grammar file. */
- if (header_extension == NULL)
- {
- header_extension = tr (ext, 'y', 'h');
- header_extension = tr (header_extension, 'Y', 'H');
- }
+ src_extension = tr (ext, 'y', 'c');
+ src_extension = tr (src_extension, 'Y', 'C');
+ header_extension = tr (ext, 'y', 'h');
+ header_extension = tr (header_extension, 'Y', 'H');
}
/* Computes extensions from the given c source file extension. */
compute_base_names ();
- /* Set default extensions */
- if (!src_extension)
- src_extension = ".c";
- if (!header_extension)
- header_extension = ".h";
-
+ /* It the defines filename if not given, we create it. */
+ if (!spec_defines_file)
+ spec_defines_file = stringappend (base_name, header_extension);
+
+ /* It the graph filename if not given, we create it. */
+ if (!spec_graph_file)
+ spec_graph_file = stringappend (short_base_name, ".vcg");
+
attrsfile = stringappend (short_base_name, EXT_STYPE_H);
#ifndef MSDOS
stringappend (attrsfile, header_extension);
/* Output the header file if wanted. */
if (defines_flag)
- defines_obstack_save (stringappend (base_name, header_extension));
+ defines_obstack_save (spec_defines_file);
/* If we output only the table, dump the actions in ACTFILE. */
if (no_parser_flag)
stringappend (short_base_name, EXT_OUTPUT));
if (graph_flag)
- obstack_save (&graph_obstack, stringappend (short_base_name, ".vcg"));
+ obstack_save (&graph_obstack, spec_graph_file);
}