From: Akim Demaille Date: Mon, 10 Dec 2001 09:07:41 +0000 (+0000) Subject: * src/getargs.h: Don't declare `spec_name_prefix' and X-Git-Tag: before-m4-back-end~168 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/78af9bbcd3cc7904cf304a3da91b45fe9528dd3c * src/getargs.h: Don't declare `spec_name_prefix' and `spec_file_prefix', declared by src/files.h. * src/files.c, src/files.h: Default for spec_name_prefix is "yy". * src/muscle_tab.c (muscle_init): Default prefix to NULL. * src/output.c (prepare): Adjust. * src/reader.c (symbols_output): Likewise. * src/vmsgetargs.c: Vaguely adjust, but who cares? --- diff --git a/ChangeLog b/ChangeLog index d4ddec2c..dbf340ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2001-12-10 Akim Demaille + + * src/getargs.h: Don't declare `spec_name_prefix' and + `spec_file_prefix', declared by src/files.h. + * src/files.c, src/files.h: Default for spec_name_prefix is "yy". + * src/muscle_tab.c (muscle_init): Default prefix to NULL. + * src/output.c (prepare): Adjust. + * src/reader.c (symbols_output): Likewise. + * src/vmsgetargs.c: Vaguely adjust, but who cares? + + 2001-12-10 Akim Demaille * src/muscle_tab.c (muscle_init): NULL is a better default than diff --git a/src/files.c b/src/files.c index d8641521..fa31b032 100644 --- a/src/files.c +++ b/src/files.c @@ -37,7 +37,7 @@ struct obstack output_obstack; char *spec_outfile = NULL; /* for -o. */ char *spec_file_prefix = NULL; /* for -b. */ -char *spec_name_prefix = NULL; /* for -p. */ +const char *spec_name_prefix = "yy"; /* for -p. */ char *spec_verbose_file = NULL; /* for --verbose. */ char *spec_graph_file = NULL; /* for -g. */ char *spec_defines_file = NULL; /* for --defines. */ diff --git a/src/files.h b/src/files.h index fa99d6aa..2ef0a4ad 100644 --- a/src/files.h +++ b/src/files.h @@ -28,7 +28,7 @@ extern char *spec_outfile; /* For -a. */ -extern char *spec_name_prefix; +extern const char *spec_name_prefix; /* File name pfx specified with -b, or 0 if no -b. */ extern char *spec_file_prefix; diff --git a/src/getargs.h b/src/getargs.h index 5eef6404..55595172 100644 --- a/src/getargs.h +++ b/src/getargs.h @@ -22,8 +22,6 @@ # define GETARGS_H_ /* flags set by % directives */ -extern char *spec_file_prefix; /* for -b */ -extern char *spec_name_prefix; /* for -p */ extern const char *skeleton; /* for -S */ extern const char *include; /* for -I */ diff --git a/src/muscle_tab.c b/src/muscle_tab.c index c2ac3876..53f83e46 100644 --- a/src/muscle_tab.c +++ b/src/muscle_tab.c @@ -85,7 +85,7 @@ muscle_init (void) muscle_insert ("maxtok", NULL); muscle_insert ("ntbase", NULL); muscle_insert ("error-verbose", NULL); - muscle_insert ("prefix", "yy"); + muscle_insert ("prefix", NULL); /* Default #line formatting. */ muscle_insert ("linef", "#line %d %s\n"); diff --git a/src/output.c b/src/output.c index cf5c0593..17b4d914 100644 --- a/src/output.c +++ b/src/output.c @@ -1034,6 +1034,7 @@ prepare (void) MUSCLE_INSERT_INT ("maxtok", max_user_token_number); MUSCLE_INSERT_INT ("ntbase", ntokens); MUSCLE_INSERT_INT ("error-verbose", error_verbose); + MUSCLE_INSERT_STRING ("prefix", spec_name_prefix); MUSCLE_INSERT_INT ("nnts", nvars); MUSCLE_INSERT_INT ("nrules", nrules); @@ -1046,8 +1047,6 @@ prepare (void) obstack_1grow (&action_obstack, 0); muscle_insert ("action", obstack_finish (&action_obstack)); - if (spec_name_prefix) - MUSCLE_INSERT_STRING ("prefix", spec_name_prefix); } /*----------------------------------------------------------. diff --git a/src/print.c b/src/print.c index e80b5239..013b5780 100644 --- a/src/print.c +++ b/src/print.c @@ -318,7 +318,7 @@ print_results (void) { int i; - /* We used to use just .out if spec_name_prefix (-p) was used, but + /* We used to use just .out if SPEC_NAME_PREFIX (-p) was used, but that conflicts with Posix. */ FILE *out = xfopen (spec_verbose_file, "w"); diff --git a/src/reader.c b/src/reader.c index cb013b20..3e901c4b 100644 --- a/src/reader.c +++ b/src/reader.c @@ -1914,15 +1914,8 @@ symbols_output (void) output_token_defines (&defines_obstack); if (!pure_parser) - { - if (spec_name_prefix) - obstack_fgrow1 (&defines_obstack, "\nextern YYSTYPE %slval;\n", - spec_name_prefix); - else - obstack_sgrow (&defines_obstack, - "\nextern YYSTYPE yylval;\n"); - } - + obstack_fgrow1 (&defines_obstack, "\nextern YYSTYPE %slval;\n", + spec_name_prefix); if (semantic_parser) { int i; diff --git a/src/vmsgetargs.c b/src/vmsgetargs.c index d3427304..e5faa5ad 100644 --- a/src/vmsgetargs.c +++ b/src/vmsgetargs.c @@ -37,10 +37,6 @@ extern int raw_flag; extern int yacc_flag; extern char * version_string; -/* Allocate storgate and initialize, since bison uses them elsewhere. */ -char *spec_name_prefix; -char *spec_file_prefix; - getargs(argc,argv) int argc; char *argv[];