Make sure -odir/foo.cc creates dir/location.hh etc.
* src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
(spec_file_prefix, spec_verbose_file, spec_graph_file)
(spec_defines_file): Now const.
(dir_prefix): New.
(short_base_name): Remove.
* src/files.c: Adjust.
(dirname.h): Include.
(base_name): Don't prototype it.
(finput): Remove, duplicates gram_in.
(full_base_name, short_base_name): Replace by...
(all_but_ext, all_but_tab_ext): these.
(compute_base_names): Rename as...
(compute_file_name_parts): this.
Update to compute the new variables, including dir_prefix.
Adjust dependencies.
* src/output.c (prepare): Output them.
* src/reader.c: Adjust to use gram_in, not finput.
* src/scan-skel.l (@dir_prefix@): New.
This commit is contained in:
Akim Demaille
2005-10-02 17:44:49 +00:00
parent ad6a9b97e2
commit 2b81e969ea
7 changed files with 98 additions and 63 deletions

View File

@@ -24,28 +24,28 @@
# include "uniqstr.h"
/* File name specified with -o for the output file, or 0 if no -o. */
extern char *spec_outfile;
extern char const *spec_outfile;
/* File name for the parser (i.e., the one above, or its default.) */
extern char *parser_file_name;
extern char const *parser_file_name;
/* Symbol prefix specified with -p, or 0 if no -p. */
extern const char *spec_name_prefix;
/* File name prefix specified with -b, or 0 if no -b. */
extern char *spec_file_prefix;
extern char const *spec_file_prefix;
/* --verbose. */
extern char *spec_verbose_file;
extern char const *spec_verbose_file;
/* File name specified for the output VCG graph. */
extern char *spec_graph_file;
extern char const *spec_graph_file;
/* File name specified with --defines. */
extern char *spec_defines_file;
extern char const *spec_defines_file;
/* Read grammar specifications. */
extern FILE *finput;
/* Directory prefix of output file names. */
extern char const *dir_prefix;
/* If semantic parser, output a .h file that defines YYSTYPE... */
@@ -65,7 +65,4 @@ void compute_output_file_names (void);
FILE *xfopen (const char *name, const char *mode);
void xfclose (FILE *ptr);
/* Prefix used to generate output file names. */
extern char *short_base_name;
#endif /* !FILES_H_ */