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
Use either a C Compiler or a C++ compiler but not both (till you know what you are upto). You are sure to shoot yourself many times on both your feet otherwise. Mixing gcc and g++ isn't good.
This line is suspect:
lex.yy.o: scan.l parse.tab.h attr.h # added this ...
gcc -c -o lex.yy.o lex.yy.c
Also, you don't seem to be using CC anywhere, using that'd have made life easier.
Assuming you don't change a single line of the C code, you will possibly hit some errors and quite a few warnings (like deprecated headers etc). You'll have to fix them as well.