766 |
|
|
767 |
@example |
@example |
768 |
%@{ |
%@{ |
769 |
@var{Prologue (declarations)} |
@var{Prologue} |
770 |
%@} |
%@} |
771 |
|
|
772 |
@var{Bison declarations} |
@var{Bison declarations} |
774 |
%% |
%% |
775 |
@var{Grammar rules} |
@var{Grammar rules} |
776 |
%% |
%% |
777 |
@var{Epilogue (additional code)} |
@var{Epilogue} |
778 |
@end example |
@end example |
779 |
|
|
780 |
@noindent |
@noindent |
2043 |
@cindex Prologue |
@cindex Prologue |
2044 |
@cindex declarations |
@cindex declarations |
2045 |
|
|
2046 |
The @var{prologue} section contains macro definitions and |
The @var{Prologue} section contains macro definitions and |
2047 |
declarations of functions and variables that are used in the actions in the |
declarations of functions and variables that are used in the actions in the |
2048 |
grammar rules. These are copied to the beginning of the parser file so |
grammar rules. These are copied to the beginning of the parser file so |
2049 |
that they precede the definition of @code{yyparse}. You can use |
that they precede the definition of @code{yyparse}. You can use |
2079 |
@cindex epilogue |
@cindex epilogue |
2080 |
@cindex C code, section for additional |
@cindex C code, section for additional |
2081 |
|
|
2082 |
The @var{epilogue} is copied verbatim to the end of the parser file, just as |
The @var{Epilogue} is copied verbatim to the end of the parser file, just as |
2083 |
the @var{prologue} is copied to the beginning. This is the most convenient |
the @var{Prologue} is copied to the beginning. This is the most convenient |
2084 |
place to put anything that you want to have in the parser file but which need |
place to put anything that you want to have in the parser file but which need |
2085 |
not come before the definition of @code{yyparse}. For example, the |
not come before the definition of @code{yyparse}. For example, the |
2086 |
definitions of @code{yylex} and @code{yyerror} often go here. |
definitions of @code{yylex} and @code{yyerror} often go here. |