X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/a641b0dac18e4b29020b5373ea90384a50465953..2e047461253970124582c3b9dca7322fd675e921:/doc/bison.1?ds=inline diff --git a/doc/bison.1 b/doc/bison.1 index ec8d979a..93eaf201 100644 --- a/doc/bison.1 +++ b/doc/bison.1 @@ -10,12 +10,24 @@ bison \- GNU Project parser generator (yacc replacement) ] [ .B \-d ] [ -.B \-\-defines +.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 @@ -63,13 +75,22 @@ Unlike .IR yacc , the generated files do not have fixed names, but instead use the prefix of the input file. +Moreover, if you need to put +.IR 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 -.B parse.y +.B parse.yxx would produce the generated parser in a file named -.BR parse.tab.c , +.BR parse.tab.cxx , instead of .IR yacc 's -.BR y.tab.c . +.BR y.tab.c +or old +.IR Bison +versions +.BR parse.tab.c . .PP This description of the options that can be given to .I bison @@ -106,8 +127,6 @@ chosen as if the input file were named .B \-d .br .ns -.TP -.B \-\-defines Write an extra output file containing macro definitions for the token type names defined in the grammar and the semantic value type .BR YYSTYPE , @@ -128,6 +147,48 @@ in a separate source file, because needs to be able to refer to token type codes and the variable .BR yylval . .TP +.BI \-\-defines= defines-file +The behaviour of +.BI \-\-defines +is the same than +.BI \-d +option. +The only difference is that it has an optionnal argument which is +the name of the output filename. +.TP +.BI \-g +.br +.ns +Output a VCG definition of the LALR(1) grammar automaton computed by +Bison. If the grammar file is +.BR foo.y +, the VCG output file will be +.BR foo.vcg . +.TP +.BI \-\-graph= graph-file +The behaviour of +.BI \-\-graph +is the same than +.BI \-g +option. The only difference is that it has an optionnal argument which +is the name of the output graph filename. +.TP +.B \-k +.br +.ns +.TP +.B \-\-token-table +This switch causes the \fIname\fB.tab.c\fR 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 . +.TP .B \-l .br .ns @@ -143,6 +204,17 @@ 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. .TP +.B \-n +.br +.ns +.TP +.B \-\-no-parser +Do not generate the parser code into the output; generate only +declarations. The generated \fIname\fB.tab.c\fR file will have only +constant declarations. In addition, a \fIname\fB.act\fR file is +generated containing a switch statement body containing all the +translated actions. +.TP .BI \-o " outfile" .br .ns @@ -174,7 +246,7 @@ The precise list of symbols renamed is .BR yylex , .BR yyerror , .BR yylval , -.BR yychar , +.BR yychar , and .BR yydebug . .sp @@ -190,9 +262,9 @@ and so on. .ns .TP .B \-\-debug -Output a definition of the macro -.B YYDEBUG -into the parser file, +In the parser file, define the macro +.B YYDEBUG +to 1 if it is not already defined, so that the debugging facilities are compiled. .TP .B \-v @@ -235,6 +307,7 @@ and exit. .B \-h .br .ns +.TP .B \-\-help Print a summary of the options to .I bison @@ -269,14 +342,21 @@ bison \-y $* .ft R .sp .RE -.PP -The long-named options can be introduced with `+' as well as `\-\-', -for compatibility with previous releases. Eventually support for `+' -will be removed, because it is incompatible with the POSIX.2 standard. .SH FILES -/usr/local/lib/bison.simple simple parser +/usr/local/share/bison/bison.simple simple parser .br -/usr/local/lib/bison.hairy complicated parser +/usr/local/share/bison/bison.hairy complicated parser +.SH "ENVIRONMENT VARIABLES" +.TP +.SM BISON_SIMPLE +If this is set, it specifies the location in which the +.B bison.simple +parser can be found. +.TP +.SM BISON_HAIRY +If this is set, it specifies the location in which the +.B bison.hairy +parser can be found. .SH SEE ALSO .IR yacc (1) .br @@ -289,4 +369,3 @@ in the source distribution. .SH DIAGNOSTICS Self explanatory. -