* 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'.
+2001-07-05 Pascal Bart <pascal.bart@epita.fr>
+
+ * 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'.
+
2001-07-14 Akim Demaille <akim@epita.fr>
* config/: New.
* Added `-S' and `--skeleton'.
+* `%raw', `-r', `--raw' is disabled.
+
* Special characters are escaped when output. This solves the problems
of the #line lines with path names including backslashes.
] [
.BI \-\-name-prefix= prefix
] [
-.B \-r
-] [
-.B \-\-raw
-] [
.B \-t
] [
.B \-\-debug
needs to be able to refer to token type codes and the variable
.BR yylval .
.TP
-.B \-r
-.br
-.ns
-.TP
-.B \-\-raw
-The token numbers in the \fIname\fB.h\fR file are usually the Yacc compatible
-translations. If this switch is specified, Bison token numbers
-are output instead. (Yacc numbers start at 257 except for single character
-tokens; Bison assigns token numbers sequentially for all tokens
-starting at 3.)
-.TP
.B \-k
.br
.ns
.TP
.B \-\-token-table
-This switch causes the \fIname\fB.tab.c\fR output to include a list of
-token names in order by their token numbers; this is defined in the array
+This switch causes the \fIname\fB.tab.c\fR output to include a list of
+token names in order by their token numbers; this is defined in the array
.IR yytname .
-Also generated
-are #defines for
+Also generated
+are #defines for
.IR YYNTOKENS ,
.IR YYNNTS ,
.IR YYNRULES ,
-and
+and
.IR YYNSTATES .
.TP
.B \-l
.TP
.B \-\-no-parser
Do not generate the parser code into the output; generate only
-declarations. The generated \fIname\fB.tab.c\fR file will have only
+declarations. The generated \fIname\fB.tab.c\fR file will have only
constant declarations. In addition, a \fIname\fB.act\fR file is
generated containing a switch statement body containing all the
-translated actions.
+translated actions.
.TP
.BI \-o " outfile"
.br
.BR yylex ,
.BR yyerror ,
.BR yylval ,
-.BR yychar ,
+.BR yychar ,
and
.BR yydebug .
.sp
.TP
.B \-\-debug
Output a definition of the macro
-.B YYDEBUG
+.B YYDEBUG
into the parser file,
so that the debugging facilities are compiled.
.TP
-This is bison.info, produced by makeinfo version 4.0 from bison.texinfo.
+Ceci est le fichier Info bison.info, produit par Makeinfo version 4.0 à
+partir bison.texinfo.
START-INFO-DIR-ENTRY
* bison: (bison). GNU Project parser generator (yacc replacement).
\1f
Indirect:
-bison.info-1: 1285
-bison.info-2: 50255
-bison.info-3: 98216
-bison.info-4: 147733
-bison.info-5: 192266
+bison.info-1: 1306
+bison.info-2: 50276
+bison.info-3: 98237
+bison.info-4: 147410
+bison.info-5: 191643
\1f
Tag Table:
(Indirect)
-Node: Top\7f1285
-Node: Introduction\7f8521
-Node: Conditions\7f9796
-Node: Copying\7f11260
-Node: Concepts\7f30452
-Node: Language and Grammar\7f31485
-Node: Grammar in Bison\7f36501
-Node: Semantic Values\7f38425
-Node: Semantic Actions\7f40526
-Node: Bison Parser\7f41709
-Node: Stages\7f44019
-Node: Grammar Layout\7f45302
-Node: Examples\7f46559
-Node: RPN Calc\7f47694
-Node: Rpcalc Decls\7f48668
-Node: Rpcalc Rules\7f50255
-Node: Rpcalc Input\7f52055
-Node: Rpcalc Line\7f53516
-Node: Rpcalc Expr\7f54631
-Node: Rpcalc Lexer\7f56576
-Node: Rpcalc Main\7f59148
-Node: Rpcalc Error\7f59546
-Node: Rpcalc Gen\7f60554
-Node: Rpcalc Compile\7f61703
-Node: Infix Calc\7f62578
-Node: Simple Error Recovery\7f65285
-Node: Multi-function Calc\7f67171
-Node: Mfcalc Decl\7f68737
-Node: Mfcalc Rules\7f70760
-Node: Mfcalc Symtab\7f72140
-Node: Exercises\7f78513
-Node: Grammar File\7f79019
-Node: Grammar Outline\7f79787
-Node: C Declarations\7f80521
-Node: Bison Declarations\7f81101
-Node: Grammar Rules\7f81513
-Node: C Code\7f81973
-Node: Symbols\7f82903
-Node: Rules\7f87984
-Node: Recursion\7f89623
-Node: Semantics\7f91342
-Node: Value Type\7f92439
-Node: Multiple Types\7f93111
-Node: Actions\7f94128
-Node: Action Types\7f96913
-Node: Mid-Rule Actions\7f98216
-Node: Declarations\7f103785
-Node: Token Decl\7f105104
-Node: Precedence Decl\7f107117
-Node: Union Decl\7f108668
-Node: Type Decl\7f109512
-Node: Expect Decl\7f110418
-Node: Start Decl\7f111964
-Node: Pure Decl\7f112342
-Node: Decl Summary\7f114019
-Node: Multiple Parsers\7f119746
-Node: Interface\7f121240
-Node: Parser Function\7f122112
-Node: Lexical\7f122947
-Node: Calling Convention\7f124353
-Node: Token Values\7f127124
-Node: Token Positions\7f128273
-Node: Pure Calling\7f129165
-Node: Error Reporting\7f132097
-Node: Action Features\7f134219
-Node: Algorithm\7f137880
-Node: Look-Ahead\7f140173
-Node: Shift/Reduce\7f142305
-Node: Precedence\7f145217
-Node: Why Precedence\7f145868
-Node: Using Precedence\7f147733
-Node: Precedence Examples\7f148701
-Node: How Precedence\7f149402
-Node: Contextual Precedence\7f150551
-Node: Parser States\7f152342
-Node: Reduce/Reduce\7f153585
-Node: Mystery Conflicts\7f157146
-Node: Stack Overflow\7f160532
-Node: Error Recovery\7f161905
-Node: Context Dependency\7f167041
-Node: Semantic Tokens\7f167889
-Node: Lexical Tie-ins\7f170906
-Node: Tie-in Recovery\7f172454
-Node: Debugging\7f174626
-Node: Invocation\7f177927
-Node: Bison Options\7f178657
-Node: Environment Variables\7f182168
-Node: Option Cross Key\7f183016
-Node: VMS Invocation\7f183906
-Node: Table of Symbols\7f184690
-Node: Glossary\7f192266
-Node: Index\7f198556
+Node: Top\7f1306
+Node: Introduction\7f8542
+Node: Conditions\7f9817
+Node: Copying\7f11281
+Node: Concepts\7f30473
+Node: Language and Grammar\7f31506
+Node: Grammar in Bison\7f36522
+Node: Semantic Values\7f38446
+Node: Semantic Actions\7f40547
+Node: Bison Parser\7f41730
+Node: Stages\7f44040
+Node: Grammar Layout\7f45323
+Node: Examples\7f46580
+Node: RPN Calc\7f47715
+Node: Rpcalc Decls\7f48689
+Node: Rpcalc Rules\7f50276
+Node: Rpcalc Input\7f52076
+Node: Rpcalc Line\7f53537
+Node: Rpcalc Expr\7f54652
+Node: Rpcalc Lexer\7f56597
+Node: Rpcalc Main\7f59169
+Node: Rpcalc Error\7f59567
+Node: Rpcalc Gen\7f60575
+Node: Rpcalc Compile\7f61724
+Node: Infix Calc\7f62599
+Node: Simple Error Recovery\7f65306
+Node: Multi-function Calc\7f67192
+Node: Mfcalc Decl\7f68758
+Node: Mfcalc Rules\7f70781
+Node: Mfcalc Symtab\7f72161
+Node: Exercises\7f78534
+Node: Grammar File\7f79040
+Node: Grammar Outline\7f79808
+Node: C Declarations\7f80542
+Node: Bison Declarations\7f81122
+Node: Grammar Rules\7f81534
+Node: C Code\7f81994
+Node: Symbols\7f82924
+Node: Rules\7f88005
+Node: Recursion\7f89644
+Node: Semantics\7f91363
+Node: Value Type\7f92460
+Node: Multiple Types\7f93132
+Node: Actions\7f94149
+Node: Action Types\7f96934
+Node: Mid-Rule Actions\7f98237
+Node: Declarations\7f103806
+Node: Token Decl\7f105125
+Node: Precedence Decl\7f107138
+Node: Union Decl\7f108689
+Node: Type Decl\7f109533
+Node: Expect Decl\7f110439
+Node: Start Decl\7f111985
+Node: Pure Decl\7f112363
+Node: Decl Summary\7f114040
+Node: Multiple Parsers\7f119423
+Node: Interface\7f120917
+Node: Parser Function\7f121789
+Node: Lexical\7f122624
+Node: Calling Convention\7f124030
+Node: Token Values\7f126801
+Node: Token Positions\7f127950
+Node: Pure Calling\7f128842
+Node: Error Reporting\7f131774
+Node: Action Features\7f133896
+Node: Algorithm\7f137557
+Node: Look-Ahead\7f139850
+Node: Shift/Reduce\7f141982
+Node: Precedence\7f144894
+Node: Why Precedence\7f145545
+Node: Using Precedence\7f147410
+Node: Precedence Examples\7f148378
+Node: How Precedence\7f149079
+Node: Contextual Precedence\7f150228
+Node: Parser States\7f152019
+Node: Reduce/Reduce\7f153262
+Node: Mystery Conflicts\7f156823
+Node: Stack Overflow\7f160209
+Node: Error Recovery\7f161582
+Node: Context Dependency\7f166718
+Node: Semantic Tokens\7f167566
+Node: Lexical Tie-ins\7f170583
+Node: Tie-in Recovery\7f172131
+Node: Debugging\7f174303
+Node: Invocation\7f177604
+Node: Bison Options\7f178334
+Node: Environment Variables\7f181768
+Node: Option Cross Key\7f182616
+Node: VMS Invocation\7f183460
+Node: Table of Symbols\7f184244
+Node: Glossary\7f191643
+Node: Index\7f197933
\1f
End Tag Table
-This is bison.info, produced by makeinfo version 4.0 from bison.texinfo.
+Ceci est le fichier Info bison.info, produit par Makeinfo version 4.0 à
+partir bison.texinfo.
START-INFO-DIR-ENTRY
* bison: (bison). GNU Project parser generator (yacc replacement).
-This is bison.info, produced by makeinfo version 4.0 from bison.texinfo.
+Ceci est le fichier Info bison.info, produit par Makeinfo version 4.0 à
+partir bison.texinfo.
START-INFO-DIR-ENTRY
* bison: (bison). GNU Project parser generator (yacc replacement).
-This is bison.info, produced by makeinfo version 4.0 from bison.texinfo.
+Ceci est le fichier Info bison.info, produit par Makeinfo version 4.0 à
+partir bison.texinfo.
START-INFO-DIR-ENTRY
* bison: (bison). GNU Project parser generator (yacc replacement).
called `foo.tab.c' by default. As a consequence, the verbose
output file is called `foo.output'.
-`%raw'
- The output file `NAME.h' normally defines the tokens with
- Yacc-compatible token numbers. If this option is specified, the
- internal Bison numbers are used instead. (Yacc-compatible numbers
- start at 257 except for single-character tokens; Bison assigns
- token numbers sequentially for all tokens starting at 3.)
-
`%token_table'
Generate an array of token names in the parser file. The name of
the array is `yytname'; `yytname[I]' is the name of the token
-This is bison.info, produced by makeinfo version 4.0 from bison.texinfo.
+Ceci est le fichier Info bison.info, produit par Makeinfo version 4.0 à
+partir bison.texinfo.
START-INFO-DIR-ENTRY
* bison: (bison). GNU Project parser generator (yacc replacement).
`--no-parser'
Pretend that `%no_parser' was specified. *Note Decl Summary::.
-`-r'
-`--raw'
- Pretend that `%raw' was specified. *Note Decl Summary::.
-
`-k'
`--token-table'
Pretend that `%token_table' was specified. *Note Decl Summary::.
--no-lines -l
--no-parser -n
--output-file=OUTFILE -o OUTFILE
- --raw -r
--token-table -k
--verbose -v
--version -V
Bison declaration to request a pure (reentrant) parser. *Note A
Pure (Reentrant) Parser: Pure Decl.
-`%raw'
- Bison declaration to use Bison internal token code numbers in token
- tables instead of the usual Yacc-compatible token code numbers.
- *Note Decl Summary::.
-
`%right'
Bison declaration to assign right associativity to token(s).
*Note Operator Precedence: Precedence Decl.
-This is bison.info, produced by makeinfo version 4.0 from bison.texinfo.
+Ceci est le fichier Info bison.info, produit par Makeinfo version 4.0 à
+partir bison.texinfo.
START-INFO-DIR-ENTRY
* bison: (bison). GNU Project parser generator (yacc replacement).
called @file{foo.tab.c} by default. As a consequence, the verbose
output file is called @file{foo.output}.@refill
-@item %raw
-The output file @file{@var{name}.h} normally defines the tokens with
-Yacc-compatible token numbers. If this option is specified, the
-internal Bison numbers are used instead. (Yacc-compatible numbers start
-at 257 except for single-character tokens; Bison assigns token numbers
-sequentially for all tokens starting at 3.)
-
@item %token_table
Generate an array of token names in the parser file. The name of the
array is @code{yytname}; @code{yytname[@var{i}]} is the name of the
@itemx --no-parser
Pretend that @code{%no_parser} was specified. @xref{Decl Summary}.
-@item -r
-@itemx --raw
-Pretend that @code{%raw} was specified. @xref{Decl Summary}.
-
@item -k
@itemx --token-table
Pretend that @code{%token_table} was specified. @xref{Decl Summary}.
\line{ --no-lines \leaderfill -l}
\line{ --no-parser \leaderfill -n}
\line{ --output-file \leaderfill -o}
-\line{ --raw \leaderfill -r}
\line{ --token-table \leaderfill -k}
\line{ --verbose \leaderfill -v}
\line{ --version \leaderfill -V}
--no-lines -l
--no-parser -n
--output-file=@var{outfile} -o @var{outfile}
---raw -r
--token-table -k
--verbose -v
--version -V
Bison declaration to request a pure (reentrant) parser.
@xref{Pure Decl, ,A Pure (Reentrant) Parser}.
-@item %raw
-Bison declaration to use Bison internal token code numbers in token
-tables instead of the usual Yacc-compatible token code numbers.
-@xref{Decl Summary}.
-
@item %right
Bison declaration to assign right associativity to token(s).
@xref{Precedence Decl, ,Operator Precedence}.
-@set UPDATED 16 March 2001
+@set UPDATED 18 July 2001
@set EDITION 1.28a
@set VERSION 1.28a
-@set UPDATED 16 March 2001
+@set UPDATED 18 July 2001
@set EDITION 1.28a
@set VERSION 1.28a
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;
-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);
break;
case 'r':
- raw_flag = 1;
+ fatal (_("`%s' is no longer supported"), "--raw");
break;
case 'n':
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 */
/* 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.
{ "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 */
if (strcmp (token_buffer + 1, tx->name) == 0)
break;
- if (tx->retval == tok_setopt)
+ if (tx->set_flag)
{
- *((char **) (tx->set_flag)) = optarg;
+ *((int *) (tx->set_flag)) = 1;
return tok_noop;
}
- if (tx->set_flag)
+
+ switch (tx->retval)
{
- *((int *) (tx->set_flag)) = 1;
+ 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;
}
/* 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.
tok_thong,
tok_noop,
tok_setopt,
- tok_illegal
+ tok_illegal,
+ tok_obsolete
} token_t;
extern char *token_buffer;
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);
}
# ------------------ #
AT_CHECK_CALC()
-# This one is very suspicious. The test fails, but it might be normal.
-AT_CHECK_CALC([--raw])
AT_CHECK_CALC([--defines])
AT_CHECK_CALC([--locations])