I have a project for school where we need to use flex and bison. I want to use C++ so that I have access to STL and my own classes that I wrote. We were provided with the fo
For using flex with C++:
1: read the flex docs:
2: use flex -+ -o file.cc parser.ll
3: In the .ll file:
%option c++
%option yyclass="Your_class_name"
%option batch
4: In your .hh file, derive Your_class_name from public yyFlexLexer
5: you can then use your_class_instance.yylex()