I noticed that some amount of effort has been put into Xcode to support yacc/Bison source files (.y, .ypp, .ymm) and lex/Flex source files (.l, .lpp, .lmm) out of the box conveniently with Xcode projects, that is you just add those source files to your Xcode project and Xcode will automatically generate the respective parser and scanner for you.
However there is one issue I encountered: for a pair of Flex/Bison scanner/parser one usually wants Bison to additionally generate the parser's definitions as separate header file, which would be on the command line either:
bison -d foo.y
mv y.tab.h foo.h
or
bison --defines=foo.h foo.y
That auto generated C/C++ header file (in this case foo.h) would then be included i.e. on scanner side (i.e. to avoid declaring terminal symbols twice on both ends).
Is there a convenient way to handle generation of such parser header files with Xcode as well?
As far as I can see it at the moment (with Xcode 7), when I look at the auto generated output files, Xcode actually calls Bison to let it generate the definition header file and a y.tab.h file is created accordingly, so if you just have exactly 1 Bison parser then you can do a hack and use a
#include "y.tab.h"
statement in your respective source files. But since the auto generated header file will always be named "y.tab.h", what would you do if you got multiple Bison parsers in your project? Shouldn't Xcode automatically do
mv y.tab.h foo.h
for each parser it generates?