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). */
(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);
}
{
/* 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);
}