X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/e63ee1f16c6b8633ed7385d1e7f2531b5dfda8f5..b0400cc6ef2e204e20964f38fd745e6f65e5c1ed:/src/files.c diff --git a/src/files.c b/src/files.c index da4c36b1..02cf0ddc 100644 --- a/src/files.c +++ b/src/files.c @@ -50,17 +50,14 @@ char *spec_graph_file = NULL; /* for -g. */ char *spec_defines_file = NULL; /* for --defines. */ char *parser_file_name = NULL; -char *infile = NULL; +struniq_t grammar_file = NULL; +struniq_t current_file = NULL; static char *full_base_name = NULL; /* Prefix used to generate output file names. */ char *short_base_name = NULL; -/* Infix used to generate output file names (i.e., `.tab', or `_tab', - or `'). */ -char *output_infix = NULL; - /* C source file extension (the parser source). */ const char *src_extension = NULL; /* Header file extension (if option ``-d'' is specified). */ @@ -258,10 +255,6 @@ compute_base_names (void) (strlen (spec_outfile) - (tab ? strlen (tab) : (ext ? strlen (ext) : 0)))); - if (tab) - output_infix = xstrndup (tab, - (strlen (tab) - (ext ? strlen (ext) : 0))); - if (ext) compute_exts_from_src (ext); } @@ -287,22 +280,19 @@ compute_base_names (void) { /* Otherwise, the short base name is computed from the input grammar: `foo/bar.yy' => `bar'. */ - filename_split (infile, &base, &tab, &ext); + filename_split (grammar_file, &base, &tab, &ext); short_base_name = xstrndup (base, (strlen (base) - (ext ? strlen (ext) : 0))); } - /* In these cases, always append `.tab'. */ - output_infix = xstrdup (EXT_TAB); - full_base_name = XMALLOC (char, strlen (short_base_name) + strlen (EXT_TAB) + 1); stpcpy (stpcpy (full_base_name, short_base_name), EXT_TAB); /* Computes the extensions from the grammar file name. */ - filename_split (infile, &base, &tab, &ext); + filename_split (grammar_file, &base, &tab, &ext); if (ext && !yacc_flag) compute_exts_from_gf (ext); }