X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/cf2a5f7c47bb07bb377525759e70f70ced40e3f6..bcf07cb7070fab57727b274486dc7a331ff8ac2d:/doc/bison.1 diff --git a/doc/bison.1 b/doc/bison.1 index 9397ec28..2d13b4c5 100644 --- a/doc/bison.1 +++ b/doc/bison.1 @@ -1,69 +1,10 @@ -.TH BISON 1 local +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. +.TH BISON "1" "July 2008" "bison 2.3b+" "User Commands" .SH NAME bison \- GNU Project parser generator (yacc replacement) .SH SYNOPSIS .B bison -[ -.BI \-b " file-prefix" -] [ -.BI \-\-file-prefix= file-prefix -] [ -.B \-d -] [ -.BI \-\-defines= defines-file -] [ -.B \-g -] [ -.BI \-\-graph= graph-file -] [ -.B \-k -] [ -.B \-\-token-table -] [ -.B \-l -] [ -.B \-\-no-lines -] [ -.B \-n -] [ -.B \-\-no-parser -] [ -.BI \-o " outfile" -] [ -.BI \-\-output-file= outfile -] [ -.BI \-p " prefix" -] [ -.BI \-\-name-prefix= prefix -] [ -.B \-t -] [ -.B \-\-debug -] [ -.B \-v -] [ -.B \-\-verbose -] [ -.B \-V -] [ -.B \-\-version -] [ -.B \-y -] [ -.B \-\-yacc -] [ -.B \-h -] [ -.B \-\-help -] [ -.B \-\-fixed-output-files -] -file -.br -.B yacc -[ -.I "similar options and operands" -] +[\fIOPTION\fR]... \fIFILE\fR .SH DESCRIPTION .I Bison is a parser generator in the style of @@ -116,260 +57,143 @@ are unique. When a long option takes an argument, like .BR \-\-file-prefix , connect the option name and the argument with .BR = . -.SS OPTIONS +.PP +Generate LALR(1) and GLR parsers. +.PP +Mandatory arguments to long options are mandatory for short options too. +The same is true for optional arguments. +.SS "Operation modes:" .TP -.BI \-b " file-prefix" -.br -.ns +\fB\-h\fR, \fB\-\-help\fR +display this help and exit .TP -.BI \-\-file-prefix= file-prefix -Specify a prefix to use for all -.I bison -output file names. The names are -chosen as if the input file were named -\fIfile-prefix\fP\fB.c\fP. +\fB\-V\fR, \fB\-\-version\fR +output version information and exit .TP -.B \-d -.br -.ns -Write an extra output file containing macro definitions for the token -type names defined in the grammar and the semantic value type -.BR YYSTYPE , -as well as a few -.B extern -variable declarations. -.sp -If the parser output file is named -.IB name .c -then this file -is named -\fIname\fP\fB.h\fP. -.sp -This output file is essential if you wish to put the definition of -.B yylex -in a separate source file, because -.B yylex -needs to be able to refer to token type codes and the variable -.BR yylval . -.TP -.BI \-\-defines= defines-file -The behavior of -.B \-\-defines -is the same than -.B \-d -option. -The only difference is that it has an optional argument which is -the name of the output filename. -.TP -.BI \-g -.br -.ns -Output a graph of the grammar automaton computed by -Bison. If the grammar file is -.BR foo.y -, the output file will be -.BR foo.dot . -.TP -.BI \-\-graph= graph-file -The behavior of -.BI \-\-graph -is the same than -.BI \-g -option. The only difference is that it has an optional argument which -is the name of the output graph filename. -.TP -.B \-k -.br -.ns -.TP -.B \-\-token-table -This switch causes the -.IB name .tab.c -output to include a list of -token names in order by their token numbers; this is defined in the array -.IR yytname . -Also generated -are #defines for -.IR YYNTOKENS , -.IR YYNNTS , -.IR YYNRULES , -and -.IR YYNSTATES . +\fB\-\-print\-localedir\fR +output directory containing locale\-dependent data .TP -.B \-l -.br -.ns +\fB\-\-print\-datadir\fR +output directory containing skeletons and XSLT .TP -.B \-\-no-lines -Don't put any -.B #line -preprocessor commands in the parser file. -Ordinarily -.I 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. +\fB\-y\fR, \fB\-\-yacc\fR +emulate POSIX Yacc .TP -.B \-n -.br -.ns -.TP -.B \-\-no-parser -Do not generate the parser code into the output; generate only -declarations. The generated -.IB name .tab.c -file will have only -constant declarations. In addition, a -.IB name .act -file is -generated containing a switch statement body containing all the -translated actions. -.TP -.BI \-o " outfile" -.br -.ns -.TP -.BI \-\-output-file= outfile -Specify the name -.I outfile -for the parser file. -.sp -The other output files' names are constructed from -.I outfile -as described under the -.B \-v -and -.B \-d -switches. +\fB\-W\fR, \fB\-\-warnings\fR=\fI[CATEGORY]\fR +report the warnings falling in CATEGORY +.SS "Parser:" .TP -.BI \-p " prefix" -.br -.ns +\fB\-L\fR, \fB\-\-language\fR=\fILANGUAGE\fR +specify the output programming language .TP -.BI \-\-name-prefix= prefix -Rename the external symbols used in the parser so that they start with -.I prefix -instead of -.BR yy . -The precise list of symbols renamed is -.BR yyparse , -.BR yylex , -.BR yyerror , -.BR yylval , -.BR yychar , -and -.BR yydebug . -.sp -For example, if you use -.BR "\-p c" , -the names become -.BR cparse , -.BR clex , -and so on. -.TP -.B \-t -.br -.ns +\fB\-S\fR, \fB\-\-skeleton\fR=\fIFILE\fR +specify the skeleton to use .TP -.B \-\-debug -In the parser file, define the macro -.B YYDEBUG -to 1 if it is not already defined, -so that the debugging facilities are compiled. +\fB\-t\fR, \fB\-\-debug\fR +instrument the parser for debugging .TP -.B \-v -.br -.ns -.TP -.B \-\-verbose -Write an extra output file containing verbose descriptions of the -parser states and what is done for each type of lookahead token in -that state. -.sp -This file also describes all the conflicts, both those resolved by -operator precedence and the unresolved ones. -.sp -The file's name is made by removing -.B .tab.c -or -.B .c -from the parser output file name, and adding -.B .output -instead. -.sp -Therefore, if the input file is -.BR foo.y , -then the parser file is called -.B foo.tab.c -by default. As a consequence, the verbose -output file is called -.BR foo.output . -.TP -.B \-V -.br -.ns +\fB\-\-locations\fR +enable locations computation .TP -.B \-\-version -Print the version number of -.I bison -and exit. +\fB\-p\fR, \fB\-\-name\-prefix\fR=\fIPREFIX\fR +prepend PREFIX to the external symbols .TP -.B \-h -.br -.ns +\fB\-l\fR, \fB\-\-no\-lines\fR +don't generate `#line' directives .TP -.B \-\-help -Print a summary of the options to -.I bison -and exit. +\fB\-k\fR, \fB\-\-token\-table\fR +include a table of token names +.SS "Output:" .TP -.B \-y -.br -.ns +\fB\-\-defines\fR[=\fIFILE\fR] +also produce a header file .TP -.B \-\-yacc -.br -.ns -.TP -.B \-\-fixed-output-files -Equivalent to -.BR "\-o y.tab.c" ; -the parser output file is called -.BR y.tab.c , -and the other outputs are called -.B y.output -and -.BR y.tab.h . -The purpose of this switch is to imitate -.IR yacc 's -output file name conventions. -Thus, the following shell script can substitute for -.I yacc -and is often installed as -.IR yacc : -.sp -.RS -.ft B -bison \-y "$@" -.ft R -.sp -.RE -.SH SEE ALSO -.IR yacc (1) -.br -The -.IR "Bison Reference Manual" , -included as the file -.B bison.texinfo -in the -.I bison -source distribution. -.SH DIAGNOSTICS -Self explanatory. +\fB\-d\fR +likewise but cannot specify FILE (for POSIX Yacc) +.TP +\fB\-r\fR, \fB\-\-report\fR=\fITHINGS\fR +also produce details on the automaton +.TP +\fB\-\-report\-file\fR=\fIFILE\fR +write report to FILE +.TP +\fB\-v\fR, \fB\-\-verbose\fR +same as `\-\-report=state' +.TP +\fB\-b\fR, \fB\-\-file\-prefix\fR=\fIPREFIX\fR +specify a PREFIX for output files +.TP +\fB\-o\fR, \fB\-\-output\fR=\fIFILE\fR +leave output to FILE +.TP +\fB\-g\fR, \fB\-\-graph\fR[=\fIFILE\fR] +also output a graph of the automaton +.TP +\fB\-x\fR, \fB\-\-xml\fR[=\fIFILE\fR] +also output an XML report of the automaton +(the XML schema is experimental) +.SS "Warning categories include:" +.TP +`midrule\-values' +unset or unused midrule values +.TP +`yacc' +incompatibilities with POSIX YACC +.TP +`all' +all the warnings +.TP +`no\-CATEGORY' +turn off warnings in CATEGORY +.TP +`none' +turn off all the warnings +.TP +`error' +treat warnings as errors +.SS "THINGS is a list of comma separated words that can include:" +.TP +`state' +describe the states +.TP +`itemset' +complete the core item sets with their closure +.TP +`lookahead' +explicitly associate lookahead tokens to items +.TP +`solved' +describe shift/reduce conflicts solving +.TP +`all' +include all the above information +.TP +`none' +disable the report +.SH AUTHOR +Written by Robert Corbett and Richard Stallman. +.SH "REPORTING BUGS" +Report bugs to . +.PP +Id .SH COPYRIGHT -Copyright \(co 2006 Free Software Foundation, Inc. -.br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . -There is NO WARRANTY, to the extent permitted by law. +Copyright \(co 2008 Free Software Foundation, Inc. +.br +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +.SH "SEE ALSO" +.BR lex (1), +.BR flex (1), +.BR yacc (1). +.PP +The full documentation for +.B bison +is maintained as a Texinfo manual. If the +.B info +and +.B bison +programs are properly installed at your site, the command +.IP +.B info bison +.PP +should give you access to the complete manual.