]> git.saurik.com Git - bison.git/commitdiff
* doc/bison.texinfo: Document ability to have multiple
authorAkim Demaille <akim@epita.fr>
Wed, 19 Jun 2002 07:46:11 +0000 (07:46 +0000)
committerAkim Demaille <akim@epita.fr>
Wed, 19 Jun 2002 07:46:11 +0000 (07:46 +0000)
prologue sections.

ChangeLog
THANKS
doc/bison.texinfo

index de3b1bf33a0f40f2c79cb559a2d3caec7d08e2ca..0422816ffbfc47aa229863d504149f75df9be532 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-06-19  Zack Weinberg  <zack@codesourcery.com>
+
+       * doc/bison.texinfo: Document ability to have multiple
+       prologue sections.
+
 2002-06-18  Akim Demaille  <akim@epita.fr>
 
        * src/files.c (compute_base_names): When computing the output file
 2002-06-18  Akim Demaille  <akim@epita.fr>
 
        * src/files.c (compute_base_names): When computing the output file
diff --git a/THANKS b/THANKS
index 0c5b344a2c74dd329a62ccff5d5c4d111170fa00..1de53f0736ae9f7bedf76d9d4059017e12fd38fc 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -50,6 +50,7 @@ Tom Tromey              tromey@cygnus.com
 Wayne Green             wayne@infosavvy.com
 Wolfram Wagner          ww@mpi-sb.mpg.de
 Wwp                     subscript@free.fr
 Wayne Green             wayne@infosavvy.com
 Wolfram Wagner          ww@mpi-sb.mpg.de
 Wwp                     subscript@free.fr
+Zack Weinberg           zack@codesourcery.com
 
 Many people are not named here because we lost track of them.  We
 thank them!  Please, help us keeping this list up to date.
 
 Many people are not named here because we lost track of them.  We
 thank them!  Please, help us keeping this list up to date.
index be4d69e215170ddb1cbffef791a91f828b3bdb80..0d3ce7d5fd7d8f7e87c6fb0343205ba98b571776 100644 (file)
@@ -2055,6 +2055,33 @@ that they precede the definition of @code{yyparse}.  You can use
 need any C declarations, you may omit the @samp{%@{} and @samp{%@}}
 delimiters that bracket this section.
 
 need any C declarations, you may omit the @samp{%@{} and @samp{%@}}
 delimiters that bracket this section.
 
+You may have more than one @var{Prologue} section, intermixed with the
+@var{Bison declarations}.  This allows you to have C and Bison
+declarations that refer to each other.  For example, the @code{%union}
+declaration may use types defined in a header file, and you may wish to
+prototype functions that take arguments of type @code{YYSTYPE}.  This
+can be done with two @var{Prologue} blocks, one before and one after the
+@code{%union} declaration.
+
+@smallexample
+%@{
+#include <stdio.h>
+#include "ptypes.h"
+%@}
+
+%union @{
+  long n;
+  tree t;  /* @r{@code{tree} is defined in @file{ptypes.h}.} */
+@}
+
+%@{
+static void yyprint(FILE *, int, YYSTYPE);
+#define YYPRINT(F, N, L) yyprint(F, N, L)
+%@}
+
+@dots{}
+@end smallexample
+
 @node Bison Declarations
 @subsection The Bison Declarations Section
 @cindex Bison declarations (introduction)
 @node Bison Declarations
 @subsection The Bison Declarations Section
 @cindex Bison declarations (introduction)