]> git.saurik.com Git - bison.git/blobdiff - doc/bison.texi
gnulib: strtoul is considered obsolete and now useless
[bison.git] / doc / bison.texi
index cd5e440ec571fbe353d49c5b181097c577d2de6c..1a2b169bf1db909fab8b37c3d278533479a4cc25 100644 (file)
@@ -1,6 +1,8 @@
 \input texinfo @c -*-texinfo-*-
 @comment %**start of header
 @setfilename bison.info
+@documentencoding UTF-8
+@documentlanguage en
 @include version.texi
 @settitle Bison @value{VERSION}
 @setchapternewpage odd
@@ -33,7 +35,7 @@
 This manual (@value{UPDATED}) is for GNU Bison (version
 @value{VERSION}), the GNU parser generator.
 
-Copyright @copyright{} 1988-1993, 1995, 1998-2013 Free Software
+Copyright @copyright{} 1988-1993, 1995, 1998-2015 Free Software
 Foundation, Inc.
 
 @quotation
@@ -3849,7 +3851,7 @@ example:
 @noindent
 specifies the union tag @code{value}, so the corresponding C type is
 @code{union value}.  If you do not specify a tag, it defaults to
-@code{YYSTYPE}.
+@code{YYSTYPE} (@pxref{%define Summary,,api.value.union.name}).
 
 As another extension to POSIX, you may specify multiple @code{%union}
 declarations; their contents are concatenated.  However, only the first
@@ -5143,7 +5145,9 @@ value by default.  However, when the parser displays a @code{STRING1} or a
 @code{string1}, it formats it as a string in double quotes.  It performs
 only the second @code{%printer} in this case, so it prints only once.
 Finally, the parser print @samp{<>} for any symbol, such as @code{TAGLESS},
-that has no semantic type tag.  See also
+that has no semantic type tag.  @xref{Mfcalc Traces, ,Enabling Debug Traces
+for @code{mfcalc}}, for a complete example.
+
 
 
 @node Expect Decl
@@ -6010,12 +6014,12 @@ Use this @var{type} as semantic value.
 @item Default Value:
 @itemize @minus
 @item
-@code{%union} if @code{%union} is used, otherwise @dots{}
+@code{union-directive} if @code{%union} is used, otherwise @dots{}
 @item
 @code{int} if type tags are used (i.e., @samp{%token <@var{type}>@dots{}} or
-@samp{%token <@var{type}>@dots{}} is used), otherwise @dots{}
+@samp{%type <@var{type}>@dots{}} is used), otherwise @dots{}
 @item
-@code{""}
+undefined.
 @end itemize
 
 @item History:
@@ -6026,6 +6030,30 @@ introduced in Bison 3.0.  Was introduced for Java only in 2.3b as
 @c api.value.type
 
 
+@c ================================================== api.value.union.name
+@deffn Directive {%define api.value.union.name} @var{name}
+@itemize @bullet
+@item Language(s):
+C
+
+@item Purpose:
+The tag of the generated @code{union} (@emph{not} the name of the
+@code{typedef}).  This variable is set to @code{@var{id}} when @samp{%union
+@var{id}} is used.  There is no clear reason to give this union a name.
+
+@item Accepted Values:
+Any valid identifier.
+
+@item Default Value:
+@code{YYSTYPE}.
+
+@item History:
+Introduced in Bison 3.0.3.
+@end itemize
+@end deffn
+@c api.value.type
+
+
 @c ================================================== location_type
 @deffn Directive {%define location_type}
 Obsoleted by @code{api.location.type} since Bison 2.7.
@@ -10354,9 +10382,23 @@ declare @code{yyerror} as follows:
 int yyerror (char const *);
 @end example
 
-Bison ignores the @code{int} value returned by this @code{yyerror}.
-If you use the Yacc library's @code{main} function, your
-@code{yyparse} function should have the following type signature:
+@noindent
+The @code{int} value returned by this @code{yyerror} is ignored.
+
+The implementation of Yacc library's @code{main} function is:
+
+@example
+int main (void)
+@{
+  setlocale (LC_ALL, "");
+  return yyparse ();
+@}
+@end example
+
+@noindent
+so if you use it, the internationalization support is enabled (e.g., error
+messages are translated), and your @code{yyparse} function should have the
+following type signature:
 
 @example
 int yyparse (void);
@@ -10658,12 +10700,17 @@ The first, inclusive, position of the range, and the first beyond.
 Forwarded to the @code{end} position.
 @end deftypemethod
 
-@deftypemethod {location} {location} operator+ (const location& @var{end})
-@deftypemethodx {location} {location} operator+ (int @var{width})
+@deftypemethod  {location} {location} operator+  (int @var{width})
 @deftypemethodx {location} {location} operator+= (int @var{width})
-@deftypemethodx {location} {location} operator- (int @var{width})
+@deftypemethodx {location} {location} operator-  (int @var{width})
 @deftypemethodx {location} {location} operator-= (int @var{width})
-Various forms of syntactic sugar.
+Various forms of syntactic sugar for @code{columns}.
+@end deftypemethod
+
+@deftypemethod {location} {location} operator+ (const location& @var{end})
+@deftypemethodx {location} {location} operator+= (const location& @var{end})
+Join two locations: starts at the position of the first one, and ends at the
+position of the second.
 @end deftypemethod
 
 @deftypemethod {location} {void} step ()