From 1916f98ef86a1b73986f3f0ab709cccc4afb8f9e Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 2 Oct 2000 08:50:07 +0000 Subject: [PATCH] * src/getargs.c (fixed_outfiles): Rename as... (yaccflag): for consistency and accuracy. Adjust dependencies. --- ChangeLog | 7 +++++++ src/conflicts.c | 2 +- src/files.c | 2 +- src/getargs.c | 18 +++++------------- src/getargs.h | 5 ++--- src/lex.c | 4 ++-- src/reduce.c | 2 +- src/vmsgetargs.c | 8 ++++---- 8 files changed, 23 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9448a2e..43098df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2000-10-02 Akim Demaille + * src/getargs.c (fixed_outfiles): Rename as... + (yaccflag): for consistency and accuracy. + Adjust dependencies. + + +2000-10-02 Akim Demaille + Use the more standard files `xalloc.h' and `xmalloc.c' instead of Bison's `allocate.c' and `alloc.h'. This patch was surprisingly difficult and introduced a lot of core dump. It turns out that diff --git a/src/conflicts.c b/src/conflicts.c index 0b94848..2840dcf 100644 --- a/src/conflicts.c +++ b/src/conflicts.c @@ -465,7 +465,7 @@ print_conflicts (void) } /* Report the total number of conflicts on STDERR. */ - if (fixed_outfiles) + if (yaccflag) { /* If invoked with `--yacc', use the output format specified by POSIX. */ diff --git a/src/files.c b/src/files.c index 6baa13b..1d23b88 100644 --- a/src/files.c +++ b/src/files.c @@ -232,7 +232,7 @@ open_files (void) static char FIXED_NAME_BASE[] = "y.y"; - name_base = fixed_outfiles ? FIXED_NAME_BASE : infile; + name_base = yaccflag ? FIXED_NAME_BASE : infile; /* BASE_LENGTH gets length of NAME_BASE, sans ".y" suffix if any. */ diff --git a/src/getargs.c b/src/getargs.c index fd26b78..ad0f13f 100644 --- a/src/getargs.c +++ b/src/getargs.c @@ -35,7 +35,7 @@ int rawtoknumflag = 0; int toknumflag = 0; int verboseflag = 0; int statisticsflag = 0; -int fixed_outfiles = 0;/* for -y */ +int yaccflag = 0; /* for -y */ extern char *program_name; @@ -44,7 +44,7 @@ static struct option longopts[] = {"debug", 0, &debugflag, 1}, {"defines", 0, &definesflag, 1}, {"file-prefix", 1, 0, 'b'}, - {"fixed-output-files", 0, &fixed_outfiles, 1}, + {"fixed-output-files", 0, &yaccflag, 1}, {"help", 0, 0, 'h'}, {"name-prefix", 1, 0, 'p'}, /* was 'a'; apparently unused -wjh */ {"no-lines", 0, &nolinesflag, 1}, @@ -55,7 +55,7 @@ static struct option longopts[] = {"token-table", 0, &toknumflag, 1}, {"verbose", 0, &verboseflag, 1}, {"version", 0, 0, 'V'}, - {"yacc", 0, &fixed_outfiles, 1}, + {"yacc", 0, &yaccflag, 1}, {"statistics", 0, &statisticsflag, 1}, {0, 0, 0, 0} }; @@ -147,15 +147,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ void getargs (int argc, char *argv[]) { - register int c; - - verboseflag = 0; - definesflag = 0; - debugflag = 0; - noparserflag = 0; - rawtoknumflag = 0; - toknumflag = 0; - fixed_outfiles = 0; + int c; while ((c = getopt_long (argc, argv, "yvdhrltknVo:b:p:", longopts, (int *)0)) != EOF) @@ -167,7 +159,7 @@ getargs (int argc, char *argv[]) break; case 'y': - fixed_outfiles = 1; + yaccflag = 1; break; case 'h': diff --git a/src/getargs.h b/src/getargs.h index ae2b04e..7a7bdef 100644 --- a/src/getargs.h +++ b/src/getargs.h @@ -27,14 +27,13 @@ extern char *spec_name_prefix; /* for -p */ extern int debugflag; /* for -t */ extern int definesflag; /* for -d */ -extern int fixed_outfiles; /* for -y */ extern int nolinesflag; /* for -l */ extern int noparserflag; /* for -n */ extern int rawtoknumflag; /* for -r */ +extern int statisticsflag; extern int toknumflag; /* for -k */ extern int verboseflag; /* for -v */ -extern int statisticsflag; -extern int fixed_outfiles; /* for -y */ +extern int yaccflag; /* for -y */ void getargs PARAMS ((int argc, char *argv[])); diff --git a/src/lex.c b/src/lex.c index abcf199..cc27ccb 100644 --- a/src/lex.c +++ b/src/lex.c @@ -548,8 +548,8 @@ percent_table[] = But %{ and %union both put information into files that have to be opened before read_declarations(). */ - { "yacc", &fixed_outfiles, NOOP}, /* -y */ - { "fixed_output_files", &fixed_outfiles, NOOP}, /* -y */ + { "yacc", &yaccflag, NOOP}, /* -y */ + { "fixed_output_files", &yaccflag, NOOP}, /* -y */ { "defines", &definesflag, NOOP}, /* -d */ { "no_parser", &noparserflag, NOOP}, /* -n */ { "output_file", &spec_outfile, SETOPT}, /* -o */ diff --git a/src/reduce.c b/src/reduce.c index 001b910..b326d3a 100644 --- a/src/reduce.c +++ b/src/reduce.c @@ -483,7 +483,7 @@ dump_grammar (void) static void print_notices (void) { - if (fixed_outfiles && nuseless_productions) + if (yaccflag && nuseless_productions) fprintf (stderr, _("%d rules never reduced\n"), nuseless_productions); fprintf (stderr, _("%s contains "), infile); diff --git a/src/vmsgetargs.c b/src/vmsgetargs.c index 5290d11..cc4670e 100644 --- a/src/vmsgetargs.c +++ b/src/vmsgetargs.c @@ -34,7 +34,7 @@ int nolinesflag; extern int noparserflag; extern int toknumflag; extern int rawtoknumflag; -extern int fixed_outfiles; +extern int yaccflag; extern char * version_string; /* Allocate storgate and initialize, since bison uses them elsewhere. */ @@ -53,7 +53,7 @@ getargs(argc,argv) verboseflag = 0; definesflag = 0; debugflag = 0; - fixed_outfiles = 0; + yaccflag = 0; nolinesflag = 0; noparserflag = 0; toknumflag = 0; @@ -69,8 +69,8 @@ getargs(argc,argv) /* * Check for /FIXED_OUTFILES qualifier */ - if (cli_present("BISON$FIXED_OUTFILES")) fixed_outfiles = 1; - if (cli_present("BISON$YACC")) fixed_outfiles = 1; + if (cli_present("BISON$FIXED_OUTFILES")) yaccflag = 1; + if (cli_present("BISON$YACC")) yaccflag = 1; /* * Check for /VERSION qualifier */ -- 2.7.4