Pass STL containers from Flex to Bison
问题 I'm writing a scanner/parser combination using Flex and Bison, if possible I would like to avoid using C++ specific features of both programs but nevertheless I need to access a C++ library from the source file generated by Bison. At the moment I'm compiling the source file generated by Flex as a C program. One thing I thought I might be able to do is to declare STL type members inside Bison's %union statement, e.g.: %union { std::string str; }; I quickly realized that this cannot work