2055 |
need any C declarations, you may omit the @samp{%@{} and @samp{%@}} |
need any C declarations, you may omit the @samp{%@{} and @samp{%@}} |
2056 |
delimiters that bracket this section. |
delimiters that bracket this section. |
2057 |
|
|
2058 |
|
You may have more than one @var{Prologue} section, intermixed with the |
2059 |
|
@var{Bison declarations}. This allows you to have C and Bison |
2060 |
|
declarations that refer to each other. For example, the @code{%union} |
2061 |
|
declaration may use types defined in a header file, and you may wish to |
2062 |
|
prototype functions that take arguments of type @code{YYSTYPE}. This |
2063 |
|
can be done with two @var{Prologue} blocks, one before and one after the |
2064 |
|
@code{%union} declaration. |
2065 |
|
|
2066 |
|
@smallexample |
2067 |
|
%@{ |
2068 |
|
#include <stdio.h> |
2069 |
|
#include "ptypes.h" |
2070 |
|
%@} |
2071 |
|
|
2072 |
|
%union @{ |
2073 |
|
long n; |
2074 |
|
tree t; /* @r{@code{tree} is defined in @file{ptypes.h}.} */ |
2075 |
|
@} |
2076 |
|
|
2077 |
|
%@{ |
2078 |
|
static void yyprint(FILE *, int, YYSTYPE); |
2079 |
|
#define YYPRINT(F, N, L) yyprint(F, N, L) |
2080 |
|
%@} |
2081 |
|
|
2082 |
|
@dots{} |
2083 |
|
@end smallexample |
2084 |
|
|
2085 |
@node Bison Declarations |
@node Bison Declarations |
2086 |
@subsection The Bison Declarations Section |
@subsection The Bison Declarations Section |
2087 |
@cindex Bison declarations (introduction) |
@cindex Bison declarations (introduction) |