1. %code{...} is the most common place for parser implementation code.
In C/C++, it goes in the code file. In Java, it goes in the parser class.
2. %requires{...} is a place to put dependency code for externally exposed
definitions required by Bison. In C/C++, it's for dependencies of YYSTYPE
and YYLTYPE. In Java, it's for import directives.
3. %provides{...} is a place for additional externally exposed
definitions. In C/C++, it goes at the bottom of the header file so that
it can depend on YYSTYPE, YYLTYPE, and yytokentype. In Java, I suppose it
could be used to define other package-visible classes in the same java
file.
This would be completely ok. For Java, %provides and the epilogue would
be synonyms.
Paolo