X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/0cc3da3a4e993080b69ee94156c280b5f2630013..eda429346ae70445be1cffbe729c63fca7848ad6:/doc/bison.texinfo diff --git a/doc/bison.texinfo b/doc/bison.texinfo index 84761760..8f35ac60 100644 --- a/doc/bison.texinfo +++ b/doc/bison.texinfo @@ -16,6 +16,10 @@ @c @clear shorttitlepage-enabled @c @set shorttitlepage-enabled +@c Set following if you want to document %default-prec and %no-default-prec. +@c This feature is experimental and may change in future Bison versions. +@c @set defaultprec + @c ISPELL CHECK: done, 14 Jan 1993 --bob @c Check COPYRIGHT dates. should be updated in the titlepage, ifinfo @@ -352,7 +356,7 @@ encourage people to make other software free. So we decided to make the practical conditions for using Bison match the practical conditions for using the other @acronym{GNU} tools. -This exception applies only when Bison is generating C code for a +This exception applies only when Bison is generating C code for an @acronym{LALR}(1) parser; otherwise, the @acronym{GPL} terms operate as usual. You can tell whether the exception applies to your @samp{.c} output file by @@ -2477,7 +2481,8 @@ does not enforce this convention, but if you depart from it, people who read your program will be confused. All the escape sequences used in string literals in C can be used in -Bison as well. However, unlike Standard C, trigraphs have no special +Bison as well, except that you must not use a null character within a +string literal. Also, unlike Standard C, trigraphs have no special meaning in Bison string literals, nor is backslash-newline allowed. A literal string token must contain two or more characters; for a token containing just one character, use a character token (see above). @@ -3684,10 +3689,12 @@ Declare a terminal symbol (token type name) that is nonassociative Using it in a way that would be associative is a syntax error. @end deffn +@ifset defaultprec @deffn {Directive} %default-prec Assign a precedence to rules lacking an explicit @code{%prec} modifier (@pxref{Contextual Precedence, ,Context-Dependent Precedence}). @end deffn +@end ifset @deffn {Directive} %type Declare the type of semantic values for a nonterminal symbol @@ -3759,11 +3766,13 @@ and so on. @xref{Multiple Parsers, ,Multiple Parsers in the Same Program}. @end deffn +@ifset defaultprec @deffn {Directive} %no-default-prec Do not assign a precedence to rules lacking an explicit @code{%prec} modifier (@pxref{Contextual Precedence, ,Context-Dependent Precedence}). @end deffn +@end ifset @deffn {Directive} %no-parser Do not include any C code in the parser file; generate tables only. The @@ -4863,6 +4872,7 @@ exp: @dots{} @end group @end example +@ifset defaultprec If you forget to append @code{%prec UMINUS} to the rule for unary minus, Bison silently assumes that minus has its usual precedence. This kind of problem can be tricky to debug, since one typically @@ -4882,6 +4892,7 @@ grammar, but it helps to protect against incorrect rule precedences. The effect of @code{%no-default-prec;} can be reversed by giving @code{%default-prec;}, which is the default. +@end ifset @node Parser States @section Parser States @@ -6814,11 +6825,13 @@ parsing. @xref{Parser Function, ,The Parser Function @code{yyparse}}. Equip the parser for debugging. @xref{Decl Summary}. @end deffn +@ifset defaultprec @deffn {Directive} %default-prec Assign a precedence to rules that lack an explicit @samp{%prec} modifier. @xref{Contextual Precedence, ,Context-Dependent Precedence}. @end deffn +@end ifset @deffn {Directive} %defines Bison declaration to create a header file meant for the scanner. @@ -6873,11 +6886,13 @@ function is applied to the two semantic values to get a single result. Bison declaration to rename the external symbols. @xref{Decl Summary}. @end deffn +@ifset defaultprec @deffn {Directive} %no-default-prec Do not assign a precedence to rules that lack an explicit @samp{%prec} modifier. @xref{Contextual Precedence, ,Context-Dependent Precedence}. @end deffn +@end ifset @deffn {Directive} %no-lines Bison declaration to avoid generating @code{#line} directives in the