Manual Pages for UNIX Darwin command on man bison
MyWebUniversity

Manual Pages for UNIX Darwin command on man bison

BISON(1) BISON(1)

NAME

bison - GNU Project parser generator (yacc replacement)

SYNOPSIS

bbiissoonn [ -bb file-prefix ] [ --ffiillee-pprreeffiixx==file-prefix ] [ -dd ] [

--ddeeffiinneess==defines-file ] [ -gg ] [ --ggrraapphh==graph-file ] [ -kk ] [

--ttookkeenn-ttaabbllee ] [ -ll ] [ --nnoo-lliinneess ] [ -nn ] [ --nnoo-ppaarrsseerr ] [ -oo out-

file ] [ --oouuttppuutt-ffiillee==outfile ] [ -pp prefix ] [ --nnaammee-pprreeffiixx==prefix ]

[ -tt ] [ --ddeebbuugg ] [ -vv ] [ --vveerrbboossee ] [ -VV ] [ --vveerrssiioonn ] [ -yy ] [

--yyaacccc ] [ -hh ] [ --hheellpp ] [ --ffiixxeedd-oouuttppuutt-ffiilleess ] file

yyaacccc [ similar options and operands ]

DESCRIPTION

Bison is a parser generator in the style of yacc(1). It should be upwardly compatible with input files designed for yacc. Input files should follow the yacc convention of ending in ..yy. Unlike yacc, the generated files do not have fixed names, but instead use the prefix of the input file. Moreover, if you need to put C++ code in the

input file, you can end his name by a C++-like extension (.ypp or

.y++), then bison will follow your extension to name the output file

(.cpp or .c++). For instance, a grammar description file named ppaarrssee..yyxxxx would produce the generated parser in a file named ppaarrssee..ttaabb..ccxxxx, instead of yacc's yy..ttaabb..cc or old Bison version's ppaarrssee..ttaabb..cc.

This description of the options that can be given to bison is adapted

from the node IInnvvooccaattiioonn in the bbiissoonn..tteexxiinnffoo manual, which should be taken as authoritative.

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 --ffiillee-pprreeffiixx, connect the

option name and the argument with ==. OOPPTTIIOONNSS

-bb file-prefix

--ffiillee-pprreeffiixx==file-prefix

Specify a prefix to use for all bison output file names. The

names are chosen as if the input file were named file-prefix..cc.

-dd

Write an extra output file containing macro definitions for the token type names defined in the grammar and the semantic value type YYYYSSTTYYPPEE, as well as a few eexxtteerrnn variable declarations. If the parser output file is named name..cc then this file is named name..hh. This output file is essential if you wish to put the definition of yyyylleexx in a separate source file, because yyyylleexx needs to be able to refer to token type codes and the variable yyyyllvvaall.

--ddeeffiinneess==defines-file

The behavior of --ddeeffiinneess is the same than -dd option. The only

difference is that it has an optional argument which is the name of the output filename.

-gg

Output a VCG definition of the LALR(1) grammar automaton com-

puted by Bison. If the grammar file is ffoooo..yy , the VCG output file will be ffoooo..vvccgg.

--ggrraapphh==graph-file

The behavior of --ggrraapphh is the same than -gg option. The only

difference is that it has an optional argument which is the name of the output graph filename.

-kk

--ttookkeenn-ttaabbllee

This switch causes the name..ttaabb..cc output to include a list of token names in order by their token numbers; this is defined in

the array yytname. Also generated are #defines for YYNTOKENS,

YYNNTS, YYNRULES, and YYNSTATES.

-ll

--nnoo-lliinneess

Don't put any ##lliinnee preprocessor commands in the parser file.

Ordinarily bison puts them in the parser file so that the C com-

piler 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 an independent source file in its own right.

-nn

--nnoo-ppaarrsseerr

Do not generate the parser code into the output; generate only

declarations. The generated name..ttaabb..cc file will have only con-

stant declarations. In addition, a name..aacctt file is generated containing a switch statement body containing all the translated actions.

-oo outfile

--oouuttppuutt-ffiillee==outfile

Specify the name outfile for the parser file. The other output files' names are constructed from outfile as

described under the -vv and -dd switches.

-pp prefix

--nnaammee-pprreeffiixx==prefix

Rename the external symbols used in the parser so that they start with prefix instead of yyyy. The precise list of symbols renamed is yyyyppaarrssee, yyyylleexx, yyyyeerrrroorr, yyyyllvvaall, yyyycchhaarr, and yyyyddeebbuugg.

For example, if you use -pp cc, the names become ccppaarrssee, cclleexx, and

so on.

-tt

--ddeebbuugg

In the parser file, define the macro YYYYDDEEBBUUGG to 1 if it is not already defined, so that the debugging facilities are compiled.

-vv

--vveerrbboossee

Write an extra output file containing verbose descriptions of

the parser states and what is done for each type of look-ahead

token in that state. This file also describes all the conflicts, both those resolved by operator precedence and the unresolved ones. The file's name is made by removing ..ttaabb..cc or ..cc from the parser output file name, and adding ..oouuttppuutt instead. Therefore, if the input file is ffoooo..yy, then the parser file is

called ffoooo..ttaabb..cc by default. As a consequence, the verbose out-

put file is called ffoooo..oouuttppuutt.

-VV

--vveerrssiioonn

Print the version number of bison and exit.

-hh

--hheellpp Print a summary of the options to bison and exit.

-yy

--yyaacccc

--ffiixxeedd-oouuttppuutt-ffiilleess

Equivalent to -oo yy..ttaabb..cc; the parser output file is called

yy..ttaabb..cc, and the other outputs are called yy..oouuttppuutt and yy..ttaabb..hh. The purpose of this switch is to imitate yacc's output file name conventions. Thus, the following shell script can substitute for yacc and is often installed as yacc:

bbiissoonn -yy ""$$@@""

SEE ALSO

yacc(1) The Bison Reference Manual, included as the file bbiissoonn..tteexxiinnffoo in the

bison source distribution.

DIAGNOSTICS Self explanatory. local BISON(1)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™