mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 05:13:04 +00:00
* src/getargs.h (raw_flag): Remove.
* src/getargs.c: Die on `-r'/`--raw'. * src/lex.c (parse_percent_token): Die on `%raw'. * src/reader.c (output_token_defines): Suppress call to `raw_flag'. * tests/calc.at: Suppress test with option `--raw'.
This commit is contained in:
@@ -29,7 +29,6 @@ int defines_flag = 0;
|
||||
int locations_flag = 0;
|
||||
int no_lines_flag = 0;
|
||||
int no_parser_flag = 0;
|
||||
int raw_flag = 0;
|
||||
char *skeleton = 0;
|
||||
int token_table_flag = 0;
|
||||
int verbose_flag = 0;
|
||||
@@ -106,7 +105,6 @@ Parser:\n\
|
||||
-p, --name-prefix=PREFIX prepend PREFIX to the external symbols\n\
|
||||
-l, --no-lines don't generate `#line' directives\n\
|
||||
-n, --no-parser generate the tables only\n\
|
||||
-r, --raw number the tokens from 3\n\
|
||||
-k, --token-table include a table of token names\n\
|
||||
"), stream);
|
||||
putc ('\n', stream);
|
||||
@@ -199,7 +197,7 @@ getargs (int argc, char *argv[])
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
raw_flag = 1;
|
||||
fatal (_("`%s' is no longer supported"), "--raw");
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
|
||||
@@ -31,7 +31,6 @@ extern int defines_flag; /* for -d */
|
||||
extern int locations_flag;
|
||||
extern int no_lines_flag; /* for -l */
|
||||
extern int no_parser_flag; /* for -n */
|
||||
extern int raw_flag; /* for -r */
|
||||
extern int statistics_flag;
|
||||
extern int token_table_flag; /* for -k */
|
||||
extern int verbose_flag; /* for -v */
|
||||
|
||||
22
src/lex.c
22
src/lex.c
@@ -1,5 +1,5 @@
|
||||
/* Token-reader for Bison's input parser,
|
||||
Copyright 1984, 1986, 1989, 1992, 2000 Free Software Foundation, Inc.
|
||||
Copyright 1984, 1986, 1989, 1992, 2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -537,7 +537,7 @@ struct percent_table_struct percent_table[] =
|
||||
{ "prec", NULL, tok_prec },
|
||||
{ "locations", &locations_flag, tok_noop }, /* -l */
|
||||
{ "no_lines", &no_lines_flag, tok_noop }, /* -l */
|
||||
{ "raw", &raw_flag, tok_noop }, /* -r */
|
||||
{ "raw", NULL, tok_obsolete }, /* -r */
|
||||
{ "token_table", &token_table_flag, tok_noop }, /* -k */
|
||||
{ "yacc", &yacc_flag, tok_noop }, /* -y */
|
||||
{ "fixed_output_files",&yacc_flag, tok_noop }, /* -y */
|
||||
@@ -616,15 +616,23 @@ parse_percent_token (void)
|
||||
if (strcmp (token_buffer + 1, tx->name) == 0)
|
||||
break;
|
||||
|
||||
if (tx->retval == tok_setopt)
|
||||
{
|
||||
*((char **) (tx->set_flag)) = optarg;
|
||||
return tok_noop;
|
||||
}
|
||||
if (tx->set_flag)
|
||||
{
|
||||
*((int *) (tx->set_flag)) = 1;
|
||||
return tok_noop;
|
||||
}
|
||||
|
||||
switch (tx->retval)
|
||||
{
|
||||
case tok_setopt:
|
||||
*((char **) (tx->set_flag)) = optarg;
|
||||
return tok_noop;
|
||||
break;
|
||||
|
||||
case tok_obsolete:
|
||||
fatal (_("`%s' is no longer supported"), token_buffer);
|
||||
break;
|
||||
}
|
||||
|
||||
return tx->retval;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Token type definitions for bison's input reader,
|
||||
Copyright 1984, 1989, 1992, 2000 Free Software Foundation, Inc.
|
||||
Copyright 1984, 1989, 1992, 2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -49,7 +49,8 @@ typedef enum token_e
|
||||
tok_thong,
|
||||
tok_noop,
|
||||
tok_setopt,
|
||||
tok_illegal
|
||||
tok_illegal,
|
||||
tok_obsolete
|
||||
} token_t;
|
||||
|
||||
extern char *token_buffer;
|
||||
|
||||
@@ -1600,8 +1600,7 @@ output_token_defines (struct obstack *oout)
|
||||
|
||||
obstack_fgrow2 (oout, "#define\t%s\t%d\n",
|
||||
symbol,
|
||||
((translations && !raw_flag)
|
||||
? bp->user_token_number : bp->value));
|
||||
(translations ? bp->user_token_number : bp->value));
|
||||
if (semantic_parser)
|
||||
obstack_fgrow2 (oout, "#define\tT%s\t%d\n", symbol, bp->value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user