mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-21 02:03:03 +00:00
* doc/bison.texinfo (Bison Options): Say more accurately what
--yacc does. * src/parse-gram.y (rules_or_grammar_declaration): Don't complain about declarations in the grammar when in Yacc mode, as POSIX does not require a diagnostic when the grammar uses extensions.
This commit is contained in:
@@ -1,5 +1,13 @@
|
|||||||
2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
|
2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
|
||||||
|
|
||||||
|
* doc/bison.texinfo (Bison Options): Say more accurately what
|
||||||
|
--yacc does.
|
||||||
|
* src/parse-gram.y (rules_or_grammar_declaration): Don't complain
|
||||||
|
about declarations in the grammar when in Yacc mode, as POSIX does
|
||||||
|
not require a diagnostic when the grammar uses extensions.
|
||||||
|
|
||||||
|
* src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
|
||||||
|
|
||||||
Warn about dubious constructions like "%token T T".
|
Warn about dubious constructions like "%token T T".
|
||||||
Reported by twlevo.
|
Reported by twlevo.
|
||||||
* src/symtab.h (struct symbol.declared): New member.
|
* src/symtab.h (struct symbol.declared): New member.
|
||||||
|
|||||||
@@ -6677,13 +6677,14 @@ Print the version number of Bison and exit.
|
|||||||
@item --print-localedir
|
@item --print-localedir
|
||||||
Print the name of the directory containing locale-dependent data.
|
Print the name of the directory containing locale-dependent data.
|
||||||
|
|
||||||
@need 1750
|
|
||||||
@item -y
|
@item -y
|
||||||
@itemx --yacc
|
@itemx --yacc
|
||||||
Equivalent to @samp{-o y.tab.c}; the parser output file is called
|
Act more like the traditional Yacc command. This can cause
|
||||||
|
different diagnostics to be generated, and may change behavior in
|
||||||
|
other minor ways. Most importantly, imitate Yacc's output
|
||||||
|
file name conventions, so that the parser output file is called
|
||||||
@file{y.tab.c}, and the other outputs are called @file{y.output} and
|
@file{y.tab.c}, and the other outputs are called @file{y.output} and
|
||||||
@file{y.tab.h}. The purpose of this option is to imitate Yacc's output
|
@file{y.tab.h}. Thus, the following shell script can substitute
|
||||||
file name conventions. Thus, the following shell script can substitute
|
|
||||||
for Yacc, and the Bison distribution contains such a script for
|
for Yacc, and the Bison distribution contains such a script for
|
||||||
compatibility with @acronym{POSIX}:
|
compatibility with @acronym{POSIX}:
|
||||||
|
|
||||||
@@ -6691,6 +6692,12 @@ compatibility with @acronym{POSIX}:
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
bison -y "$@@"
|
bison -y "$@@"
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
|
The @option{-y}/@option{--yacc} option is intended for use with
|
||||||
|
traditional Yacc grammars. If your grammar uses a Bison extension
|
||||||
|
like @samp{%glr-parser}, Bison might not be Yacc-compatible even if
|
||||||
|
this option is specified.
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
|
|||||||
@@ -391,10 +391,6 @@ grammar:
|
|||||||
rules_or_grammar_declaration:
|
rules_or_grammar_declaration:
|
||||||
rules
|
rules
|
||||||
| grammar_declaration ";"
|
| grammar_declaration ";"
|
||||||
{
|
|
||||||
if (yacc_flag)
|
|
||||||
complain_at (@$, _("POSIX forbids declarations in the grammar"));
|
|
||||||
}
|
|
||||||
| error ";"
|
| error ";"
|
||||||
{
|
{
|
||||||
yyerrok;
|
yyerrok;
|
||||||
|
|||||||
Reference in New Issue
Block a user