Node:C Code, Previous:Grammar Rules, Up:Grammar Outline



The Additional C Code Section

The additional C code section is copied verbatim to the end of the parser file, just as the C declarations section is copied to the beginning. This is the most convenient place to put anything that you want to have in the parser file but which need not come before the definition of yyparse. For example, the definitions of yylex and yyerror often go here. See Parser C-Language Interface.

If the last section is empty, you may omit the %% that separates it from the grammar rules.

The Bison parser itself contains many static variables whose names start with yy and many macros whose names start with YY. It is a good idea to avoid using any such names (except those documented in this manual) in the additional C code section of the grammar file.