Node:Bison Options, Next:Environment Variables, Up:Invocation
Bison supports both traditional single-letter options and mnemonic long
option names. Long option names are indicated with --
instead of
-
. Abbreviations for option names are allowed as long as they
are unique. When a long option takes an argument, like
--file-prefix
, connect the option name and the argument with
=
.
Here is a list of options that can be used with Bison, alphabetized by short option. It is followed by a cross key alphabetized by long option.
Operations modes:
-h
--help
-V
--version
-y
--yacc
--fixed-output-files
-o y.tab.c
; the parser output file is called
y.tab.c
, and the other outputs are called y.output
and
y.tab.h
. The purpose of this option is to imitate Yacc's output
file name conventions. Thus, the following shell script can substitute
for Yacc:
bison -y $*
Tuning the parser:
-S file
--skeleton=file
-t
--debug
YYDEBUG
to 1 if it is not
already defined, so that the debugging facilities are compiled.
See Debugging Your Parser.
--locations
%locations
was specified. See Decl Summary.
-p prefix
--name-prefix=prefix
%name-prefix="prefix"
was specified.
See Decl Summary.
-l
--no-lines
#line
preprocessor commands in the parser file.
Ordinarily Bison puts them in the parser file so that the C compiler
and debuggers will associate errors with your source file, the
grammar file. This option causes them to associate errors with the
parser file, treating it as an independent source file in its own right.
-n
--no-parser
%no-parser
was specified. See Decl Summary.
-k
--token-table
%token-table
was specified. See Decl Summary.
Adjust the output:
-d
--defines
%defines
was specified, i.e., write an extra output
file containing macro definitions for the token type names defined in
the grammar and the semantic value type YYSTYPE
, as well as a few
extern
variable declarations. See Decl Summary.
--defines=defines-file
-b file-prefix
--file-prefix=prefix
%verbose
was specified, i.e, specify prefix to use
for all Bison output file names. See Decl Summary.
-v
--verbose
%verbose
was specified, i.e, write an extra output
file containing verbose descriptions of the grammar and
parser. See Decl Summary.
-o filename
--output=filename
The other output files' names are constructed from filename as
described under the -v
and -d
options.
-g
foo.y
, the VCG output file will
be foo.vcg
.
--graph=graph-file
-g
. The only
difference is that it has an optionnal argument which is the name of
the output graph filename.