Released an updated source code package for Flex Bison C++ Example. The example source code is released into the public domain or, at your option, under the Do What The Fuck You Want To Public License (WTFPL).
This bugfix release solves two problems there were reported to me via e-mail:
The first problem were compilation errors that occured when no %union
directive is used in the grammar: in this case the include headers order is changed around by bison and thereby breaks compilation. This was fixed by never including parser.h directly, but always using scanner.h.
And the second issue was raised because new versions of flex were released after years of stagnation. The new flex version 2.5.35 adds a virtual function yywrap()
to the yyFlexLexer
class. This function is automatically defined in any lexer source file generated by flex. However because I copied FlexLexer.h from an older flex distribution, the function definition throughs a "no yywrap()
member function" compiler error. Updating the FlexLexer.h with a conditional declaration of yywrap()
hopefully did the trick and now works on all versions. Usually this file should be taken from /usr/include
and not from the package. However that will break compilation if flex is not installed, and a self-sufficient compilation package was a primary goal of the example.
For more information and the download package see the Flex Bison C++ Example web page.