SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG
DONATE


YUM REPOSITORY

 
 

MAN page from Trustix bison-1.875-7tr.i586.rpm

BISON

Section: User Commands (1)
Updated: local
Index 

NAME

bison - GNU Project parser generator (yacc replacement) 

SYNOPSIS

bison[-b file-prefix] [--file-prefix=file-prefix] [-d] [--defines=defines-file] [-g] [--graph=graph-file] [-k] [--token-table] [-l] [--no-lines] [-n] [--no-parser] [-o outfile] [--output-file=outfile] [-p prefix] [--name-prefix=prefix] [-t] [--debug] [-v] [--verbose] [-V] [--version] [-y] [--yacc] [-h] [--help] [--fixed-output-files]file
yacc[similar options and operands] 

DESCRIPTION

Bisonis a parser generator in the style ofyacc(1).It should be upwardly compatible with input files designedforyacc.

Input files should follow theyaccconvention of ending in.y.Unlikeyacc,the generated files do not have fixed names, but instead use the prefixof the input file.Moreover, if you need to putC++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 theoutput file (.cpp or .c++).For instance, a grammar description file namedparse.yxxwould produce the generated parser in a file namedparse.tab.cxx,instead ofyacc'sy.tab.cor oldBisonversion'sparse.tab.c.

This description of the options that can be given tobisonis adapted from the nodeInvocationin thebison.texinfomanual, which should be taken as authoritative.

Bisonsupports both traditional single-letter options and mnemonic longoption names. Long option names are indicated with--instead of-.Abbreviations for option names are allowed as long as theyare unique. When a long option takes an argument, like--file-prefix,connect the option name and the argument with=. 

OPTIONS

-b file-prefix

--file-prefix=file-prefix
Specify a prefix to use for allbisonoutput file names. The names arechosen as if the input file were namedfile-prefix.c.
-d

Write an extra output file containing macro definitions for the tokentype names defined in the grammar and the semantic value typeYYSTYPE,as well as a fewexternvariable declarations.

If the parser output file is namedname.cthen this fileis namedname.h.

This output file is essential if you wish to put the definition ofyylexin a separate source file, becauseyylexneeds to be able to refer to token type codes and the variableyylval.

--defines=defines-file
The behavior of--definesis the same than-doption.The only difference is that it has an optional argument which isthe name of the output filename.
-g

Output a VCG definition of the LALR(1) grammar automaton computed byBison. If the grammar file isfoo.y, the VCG output file will befoo.vcg.
--graph=graph-file
The behavior of--graphis the same than-goption. The only difference is that it has an optional argument whichis the name of the output graph filename.
-k

--token-table
This switch causes thename.tab.coutput to include a list oftoken names in order by their token numbers; this is defined in the arrayyytname.Also generatedare #defines forYYNTOKENS,YYNNTS,YYNRULES,andYYNSTATES.
-l

--no-lines
Don't put any#linepreprocessor commands in the parser file.Ordinarilybisonputs them in the parser file so that the C compilerand debuggers will associate errors with your source file, thegrammar file. This option causes them to associate errors with theparser file, treating it an independent source file in its own right.
-n

--no-parser
Do not generate the parser code into the output; generate onlydeclarations. The generatedname.tab.cfile will have onlyconstant declarations. In addition, aname.actfile isgenerated containing a switch statement body containing all thetranslated actions.
-o outfile

--output-file=outfile
Specify the nameoutfilefor the parser file.

The other output files' names are constructed fromoutfileas described under the-vand-dswitches.

-p prefix

--name-prefix=prefix
Rename the external symbols used in the parser so that they start withprefixinstead ofyy.The precise list of symbols renamed isyyparse,yylex,yyerror,yylval,yychar,andyydebug.

For example, if you use-p c,the names becomecparse,clex,and so on.

-t

--debug
In the parser file, define the macroYYDEBUGto 1 if it is not already defined,so that the debugging facilities are compiled.
-v

--verbose
Write an extra output file containing verbose descriptions of theparser states and what is done for each type of look-ahead token inthat state.

This file also describes all the conflicts, both those resolved byoperator precedence and the unresolved ones.

The file's name is made by removing.tab.cor.cfrom the parser output file name, and adding.outputinstead.

Therefore, if the input file isfoo.y,then the parser file is calledfoo.tab.cby default. As a consequence, the verboseoutput file is calledfoo.output.

-V

--version
Print the version number ofbisonand exit.
-h

--help
Print a summary of the options tobisonand exit.
-y

--yacc

--fixed-output-files
Equivalent to-o y.tab.c;the parser output file is calledy.tab.c,and the other outputs are calledy.outputandy.tab.h.The purpose of this switch is to imitateyacc'soutput file name conventions.Thus, the following shell script can substitute foryaccand is often installed asyacc:

bison -y "$@"

 

SEE ALSO

yacc(1)
TheBison Reference Manual,included as the filebison.texinfoin thebisonsource distribution. 

DIAGNOSTICS

Self explanatory.


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
SEE ALSO
DIAGNOSTICS

This document was created byman2html,using the manual pages.