]> git.saurik.com Git - bison.git/blobdiff - doc/bison.texinfo
doc: fixes.
[bison.git] / doc / bison.texinfo
index f05418142bfb921f972851528231259465a16932..ccff9d51e3d91ee14889c511c0f91884e6da34ae 100644 (file)
@@ -3806,8 +3806,11 @@ typedef struct YYLTYPE
 @} YYLTYPE;
 @end example
 
-At the beginning of the parsing, Bison initializes all these fields to 1
-for @code{yylloc}.
+When @code{YYLTYPE} is not defined, at the beginning of the parsing, Bison
+initializes all these fields to 1 for @code{yylloc}.  To initialize
+@code{yylloc} with a custom location type (or to chose a different
+initialization), use the @code{%initial-action} directive.  @xref{Initial
+Action Decl, , Performing Actions before Parsing}.
 
 @node Actions and Locations
 @subsection Actions and Locations
@@ -4846,7 +4849,7 @@ the selected target language and/or the parser skeleton (@pxref{Decl
 Summary,,%language}, @pxref{Decl Summary,,%skeleton}).
 
 It is an error if a @var{variable} is defined by @code{%define} multiple
-times, but @ref{Bison Options,,-D @var{name}[=@var{value}]}.
+times, but see @ref{Bison Options,,-D @var{name}[=@var{value}]}.
 
 Omitting @code{"@var{value}"} is always equivalent to specifying it as
 @code{""}.
@@ -4998,23 +5001,6 @@ empty
 @c api.tokens.prefix
 
 
-@item error-verbose
-@findex %define error-verbose
-@itemize
-@item Languages(s):
-all.
-@item Purpose:
-Enable the generation of more verbose error messages than a instead of
-just plain @w{@code{"syntax error"}}.  @xref{Error Reporting, ,The Error
-Reporting Function @code{yyerror}}.
-@item Accepted Values:
-Boolean
-@item Default Value:
-@code{false}
-@end itemize
-@c error-verbose
-
-
 @item lr.default-reductions
 @cindex default reductions
 @findex %define lr.default-reductions
@@ -5209,6 +5195,8 @@ facilitate the development of a grammar.
 Obsoleted by @code{api.namespace}
 @c namespace
 
+
+@c ================================================== parse.assert
 @item parse.assert
 @findex %define parse.assert
 
@@ -5225,6 +5213,34 @@ destroyed properly.  This option checks these constraints.
 @end itemize
 @c parse.assert
 
+
+@c ================================================== parse.error
+@item parse.error
+@findex %define parse.error
+@itemize
+@item Languages(s):
+all.
+@item Purpose:
+Control the kind of error messages passed to the error reporting
+function.  @xref{Error Reporting, ,The Error Reporting Function
+@code{yyerror}}.
+@item Accepted Values:
+@itemize
+@item @code{"simple"}
+Error messages passed to @code{yyerror} are simply @w{@code{"syntax
+error"}}.
+@item @code{"verbose"}
+Error messages report the unexpected token, and possibly the expected
+ones.
+@end itemize
+
+@item Default Value:
+@code{simple}
+@end itemize
+@c parse.error
+
+
+@c ================================================== parse.trace
 @item parse.trace
 @findex %define parse.trace
 
@@ -5884,7 +5900,7 @@ int yyparse (int *nastiness, int *randomness);
 @cindex parse error
 @cindex syntax error
 
-The Bison parser detects a @dfn{syntax error} or @dfn{parse error}
+The Bison parser detects a @dfn{syntax error} (or @dfn{parse error})
 whenever it reads a token which cannot satisfy any syntax rule.  An
 action in the grammar can also explicitly proclaim an error, using the
 macro @code{YYERROR} (@pxref{Action Features, ,Special Features for Use
@@ -5896,8 +5912,8 @@ called by @code{yyparse} whenever a syntax error is found, and it
 receives one argument.  For a syntax error, the string is normally
 @w{@code{"syntax error"}}.
 
-@findex %define error-verbose
-If you invoke the directive @samp{%define error-verbose} in the Bison
+@findex %define parse.error
+If you invoke @samp{%define parse.error "verbose"} in the Bison
 declarations section (@pxref{Bison Declarations, ,The Bison Declarations
 Section}), then Bison provides a more verbose and specific error message
 string instead of just plain @w{@code{"syntax error"}}.
@@ -8153,7 +8169,7 @@ already defined, so that the debugging facilities are compiled.
 
 @item -D @var{name}[=@var{value}]
 @itemx --define=@var{name}[=@var{value}]
-@item -F @var{name}[=@var{value}]
+@itemx -F @var{name}[=@var{value}]
 @itemx --force-define=@var{name}[=@var{value}]
 Each of these is equivalent to @samp{%define @var{name} "@var{value}"}
 (@pxref{Decl Summary, ,%define}) except that Bison processes multiple
@@ -8821,7 +8837,7 @@ error messages.
 @comment file: calc++-parser.yy
 @example
 %define parse.trace
-%define error-verbose
+%define parse.error "verbose"
 @end example
 
 @noindent
@@ -9309,7 +9325,7 @@ Run the syntactic analysis, and return @code{true} on success,
 @deftypemethod {YYParser} {boolean} getErrorVerbose ()
 @deftypemethodx {YYParser} {void} setErrorVerbose (boolean @var{verbose})
 Get or set the option to produce verbose error messages.  These are only
-available with the @samp{%define error-verbose} directive, which also turn on
+available with @samp{%define parse.error "verbose"}, which also turns on
 verbose error messages.
 @end deftypemethod
 
@@ -10238,7 +10254,7 @@ token is reset to the token that originally caused the violation.
 @end deffn
 
 @deffn {Directive} %error-verbose
-An obsolete directive standing for @samp{%define error-verbose}.
+An obsolete directive standing for @samp{%define parse.error "verbose"}.
 @end deffn
 
 @deffn {Directive} %file-prefix "@var{prefix}"
@@ -10444,8 +10460,8 @@ An obsolete macro used in the @file{yacc.c} skeleton, that you define
 with @code{#define} in the prologue to request verbose, specific error
 message strings when @code{yyerror} is called.  It doesn't matter what
 definition you use for @code{YYERROR_VERBOSE}, just whether you define
-it.  Using @samp{%define error-verbose} is preferred (@pxref{Error
-Reporting, ,The Error Reporting Function @code{yyerror}}).
+it.  Using @samp{%define parse.error "verbose"} is preferred
+(@pxref{Error Reporting, ,The Error Reporting Function @code{yyerror}}).
 @end deffn
 
 @deffn {Macro} YYINITDEPTH
@@ -10793,6 +10809,10 @@ grammatically indivisible.  The piece of text it represents is a token.
 
 @bye
 
+@c Local Variables:
+@c fill-column: 76
+@c End:
+
 @c LocalWords: texinfo setfilename settitle setchapternewpage finalout
 @c LocalWords: ifinfo smallbook shorttitlepage titlepage GPL FIXME iftex
 @c LocalWords: akim fn cp syncodeindex vr tp synindex dircategory direntry