Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
yacc(1)
Edit
PageHistory
Diff
Info
LikePages
BISON !!!BISON NAME SYNOPSIS DESCRIPTION FILES ENVIRONMENT VARIABLES SEE ALSO DIAGNOSTICS ---- !!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 !!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 __.y__. 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 __parse.yxx__ would produce the generated parser in a file named __parse.tab.cxx__, instead of ''yacc'''s __y.tab.c__ or old ''Bison'' versions __parse.tab.c__. This description of the options that can be given to ''bison'' is adapted from the node __Invocation__ in the __bison.texinfo__ 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 __--file-prefix__, connect the option name and the argument with __=__. __OPTIONS__ __-b__ ''file-prefix'' __--file-prefix=__''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''__.c__. __-d__ 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. If the parser output file is named ''name''__.c__ then this file is named ''name''__.h__. This output file is essential if you wish to put the definition of __yylex__ in a separate source file, because __yylex__ needs to be able to refer to token type codes and the variable __yylval__. __--defines=__''defines-file'' The behaviour of __--defines__ is the same than __-d__ option. The only difference is that it has an optionnal argument which is the name of the output filename. __-g__ Output a VCG definition of the !LALR(1) grammar automaton computed by Bison. If the grammar file is __foo.y__ , the VCG output file will be __foo.vcg__. __--graph=__''graph-file'' The behaviour of __--graph__ is the same than __-g__ option. The only difference is that it has an optionnal argument which is the name of the output graph filename. __-k__ __--token-table__ This switch causes the ''name''__.tab.c__ 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''. __-l__ __--no-lines__ Don't put any __#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 an independent source file in its own right. __-n__ __--no-parser__ Do not generate the parser code into the output; generate only declarations. The generated ''name''__.tab.c__ file will have only constant declarations. In addition, a ''name''__.act__ file is generated containing a switch statement body containing all the translated actions. __-o__ ''outfile'' __--output-file=__''outfile'' Specify the name ''outfile'' for the parser file. The other output files' names are constructed from ''outfile'' as described under the __-v__ and __-d__ switches. __-p__ ''prefix'' __--name-prefix=__''prefix'' Rename the external symbols used in the parser so that they start with ''prefix'' instead of __yy__. The precise list of symbols renamed is __yyparse__, __yylex__, __yyerror__, __yylval__, __yychar__, and __yydebug__. For example, if you use __-p c__, the names become __cparse__, __clex__, and so on. __-t__ __--debug__ In the parser file, define the macro __YYDEBUG__ to 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 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 __.tab.c__ or __.c__ from the parser output file name, and adding __.output__ instead. Therefore, if the input file is __foo.y__, then the parser file is called __foo.tab.c__ by default. As a consequence, the verbose output file is called __foo.output__. __-V__ __--version__ Print the version number of ''bison'' and exit. __-h__ __--help__ Print a summary of the options to ''bison'' and exit. __-y__ __--yacc__ __--fixed-output-files__ Equivalent to __-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 switch is to imitate ''yacc'''s output file name conventions. Thus, the following shell script can substitute for ''yacc'': __bison -y $*__ !!FILES /usr/local/share/bison/bison.simple simple parser /usr/local/share/bison/bison.hairy complicated parser !!ENVIRONMENT VARIABLES BISON_SIMPLE If this is set, it specifies the location in which the __bison.simple__ parser can be found. BISON_HAIRY If this is set, it specifies the location in which the __bison.hairy__ parser can be found. !!SEE ALSO yacc(1) The ''Bison Reference Manual'', included as the file __bison.texinfo__ in the ''bison'' source distribution. !!DIAGNOSTICS Self explanatory. ----
7 pages link to
yacc(1)
:
lex(1)
flex(1)
flex++(1)
Man1y
CompilerCompiler
bison(1)
Flex
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.