I’m trying to control where bison outputs the prologue sections of the code while using it in c++ mode and in the defines mode (i.e. write out a header)
Basically, I have :-
%{
// stuff that should go into the parser.tab.hxx
%}
%{
// stuff that should go into the parser.tab.cxx
%}
I’m using bison 2.3 and don’t have easy access to bison 2.5 (which seems to have some sort of functionality for doing the same).
I’m also aware that this can be done since some of the exmaples online seem to be able to achieve this… Any help?
Easy workaround: in a file with the name you want the source file to have, put
and nothing else. Similarly for the
.hxxfile. (Make sure your build system doesn’t try to build all.cxxfiles in the directory.)