Closed zosrothko closed 8 years ago
Fixed -- the #include now appears in the tab.c file where the union declaration would have been without the -d flag -- it is after any %{
...%}
blocks that are before the %union
and before any blocks that are after it.
Hi
The CLI option -d creates a header file called prefix.tab.h along with prefix.tab.c, containing the symbol definitions and a declaration for YYSTYPE and yylval. If the union YYSTYPE contains C or C++ types that need an include like for exemple, then the generated code does not compile, while without the option -d, the generated code compiles without error.
With the snippet above, btyacc -E -l -d -v -r -b t3 t3.y generates the t3.code.c below
and t3.tab.h
which results in a compile error:
error C4430: missing type specifier line 17
I would suggest to add a new Yacc block introduced by the keyword %include or the keyword %header as