X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/ec3bc3961dd154cde7a14ce7e6b97b901af1dadb..1ce5149ac8ffb10e03301661ac3abcc39de31702:/doc/bison.texinfo diff --git a/doc/bison.texinfo b/doc/bison.texinfo index be4d69e2..0d3ce7d5 100644 --- a/doc/bison.texinfo +++ b/doc/bison.texinfo @@ -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. +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 +#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)