]> git.saurik.com Git - bison.git/blobdiff - doc/bison.texinfo
* data/c.m4 (b4_yy_symbol_print_generate):
[bison.git] / doc / bison.texinfo
index 9e65195d129e846585b2d469674869cb933216e4..5021e2e3eaa0c34f4efa08dbadd9c82e2c366375 100644 (file)
@@ -356,9 +356,10 @@ This edition corresponds to version @value{VERSION} of Bison.
 @node Conditions
 @unnumbered Conditions for Using Bison
 
-As of Bison version 1.24, we have changed the distribution terms for
-@code{yyparse} to permit using Bison's output in nonfree programs when
-Bison is generating C code for @acronym{LALR}(1) parsers.  Formerly, these
+The distribution terms for Bison-generated parsers permit using the
+parsers in nonfree programs.  Before Bison version 2.2, these extra
+permissions applied only when Bison was generating @acronym{LALR}(1)
+parsers in C@.  And before Bison version 1.24, Bison-generated
 parsers could be used only in programs that were free software.
 
 The other @acronym{GNU} programming tools, such as the @acronym{GNU} C
@@ -370,10 +371,10 @@ License to all of the Bison source code.
 
 The output of the Bison utility---the Bison parser file---contains a
 verbatim copy of a sizable piece of Bison, which is the code for the
-@code{yyparse} function.  (The actions from your grammar are inserted
-into this function at one point, but the rest of the function is not
-changed.)  When we applied the @acronym{GPL} terms to the code for
-@code{yyparse},
+parser's implementation.  (The actions from your grammar are inserted
+into this implementation at one point, but most of the rest of the
+implementation is not changed.)  When we applied the @acronym{GPL}
+terms to the skeleton code for the parser's implementation,
 the effect was to restrict the use of Bison output to free software.
 
 We didn't change the terms because of sympathy for people who want to
@@ -383,13 +384,11 @@ 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 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
-inspecting it to see whether it says ``As a special exception, when
-this file is copied by Bison into a Bison output file, you may use
-that output file without restriction.''
+This exception applies when Bison is generating code for a parser.
+You can tell whether the exception applies to a Bison output file by
+inspecting the file for text beginning with ``As a special
+exception@dots{}''.  The text spells out the exact terms of the
+exception.
 
 @include gpl.texi
 
@@ -3068,6 +3067,8 @@ specify some other type, define @code{YYSTYPE} as a macro, like this:
 @end example
 
 @noindent
+@code{YYSTYPE}'s replacement list should be a type name
+that does not contain parentheses or square brackets.
 This macro definition must go in the prologue of the grammar file
 (@pxref{Grammar Outline, ,Outline of a Bison Grammar}).
 
@@ -3464,7 +3465,9 @@ actions to take when rules are matched.
 Defining a data type for locations is much simpler than for semantic values,
 since all tokens and groupings always use the same type.
 
-The type of locations is specified by defining a macro called @code{YYLTYPE}.
+You can specify the type of locations by defining a macro called
+@code{YYLTYPE}, just as you can specify the semantic value type by
+defining @code{YYSTYPE} (@pxref{Value Type}).
 When @code{YYLTYPE} is not defined, Bison uses a default structure type with
 four members:
 
@@ -7041,13 +7044,13 @@ An auxiliary class @code{stack} used by the parser.
 
 @item @var{file}.hh
 @itemx @var{file}.cc
-The declaration and implementation of the C++ parser class.
-@var{file} is the name of the output file.  It follows the same
-rules as with regular C parsers.
+(Assuming the extension of the input file was @samp{.yy}.)  The
+declaration and implementation of the C++ parser class.  The basename
+and extension of these two files follow the same rules as with regular C
+parsers (@pxref{Invocation}).
 
-Note that @file{@var{file}.hh} is @emph{mandatory}, the C++ cannot
-work without the parser class declaration.  Therefore, you must either
-pass @option{-d}/@option{--defines} to @command{bison}, or use the
+The header is @emph{mandatory}; you must either pass
+@option{-d}/@option{--defines} to @command{bison}, or use the
 @samp{%defines} directive.
 @end table
 
@@ -7584,10 +7587,14 @@ parser's to get the set of defined tokens.
 # include <string>
 # include "calc++-driver.hh"
 # include "calc++-parser.hh"
-/* Work around a bug in flex 2.5.31.  See Debian bug 333231
-  <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=333231>.  */
+
+/* Work around an incompatibility in flex (at least versions
+   2.5.31 through 2.5.33): it generates code that does
+   not conform to C89.  See Debian bug 333231
+   <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=333231>.  */
 # undef yywrap
 # define yywrap() 1
+
 /* By default yylex returns int, we use token_type.
    Unfortunately yyterminate by default returns 0, which is
    not of token_type.  */