Some places cout and cerr are used, others fprintf. Pick one and use it consistantly throughout the code.
It's not obvious which to pick, because flex and bison are in c, but the rest is in c++. Perhaps it would be better to stick with the c instead of c++ here.