I wrote bison code header:
%{
#include \"foo.h\"
%}
And I defined a struct named \'Foo\' in header. I\'d like to use it as token type in Bi
For includes that should appear in both the .c and the .h file (before the definition for the %union
), you should use %code requires { ... }
. %{ ... }
inserts code in the .c file only.
For more information on the various %code
options, you can look at the "Prologue Alternatives" chapter of the Bison docs.