I have written a parser in boost:spirit and now I wish to write the same stuff in antlr 3.1.1 to see if there are any performance gains or if it might be a better way to go about it as it also exports to many other languages besides c++ (The current 3.x branch actually does not export to c++).
3.1.1 is built using 2.7.x yet, it supports LL(*) rather than LL(k) so if we go with antrl it will be with the 3.x tree.
I have been successful generating and using the java examples and that is my main source of reversing howto do the c/c++ stuff.
Here are my problems:
no native c++ code generation -- you have to use hacks like extern and compile c as c++
even getting some things working in the c stuff produces a bunch of warnings which just doesn't make me feel good about what I'm doing
all the examples I've looked at and read on 3.x refer to old code making me sift through coredumps and the doxygen documentation to figure out what variable was renamed
The best resources I've found so far are:
http://www.antlr.org/wiki/display/ANTLR3/Five+minute+introduction+to+ANTLR+3
http://rails.wincent.com/wiki/C_language_target_(ANTLR_3.0_prerelease)
both of these, however, have already made me resort to various hacks
So my question is -- can someone point me to a full example from grammar --> code generation --> working executable?