What level of C++ parsing can be done with Eclipse for plugin development? I’m interested in knowing if there is a way that I can access C++ class types, method signatures, etc and create another class using the information that I gather from the original class parsed/read/analyzed.
I’ve looked at many C++ front end tools such as EDG, ROSE, and CodeBoost, but they look very involved ( EDG even though many say it’s the best, it is a bit out of my price range ), the next thing I thought of was Eclipse since I know it can generate the AST for Java but I don’t know if it can do the same for C++. I’ve looked for tutorials to no avail so I come here seeking for help/advice.
EDIT 5/23:
GIYF: The phrase “Eclipse C++ parser” fed to Google produces this line to the CDT documentation:
http://wiki.eclipse.org/CDT/designs/Overview_of_Parsing
Regardless of which parser you choose, you’ll find that dealing with it is involved.
It isn’t the parser machinery; its C++ itself.
CDT does parse C++. I don’t know if it does C++11 yet. I know there is an attempt
to build refactoring tools on C++ with it, and that process is producing apparantly usable but not great results. One of the issues is that CDT apparantly can’t modify its ASTs; you have to emit some kind of text patch and reprocess the source code.
If you have examined that set of C++ parsers, you should consider our C++11 front end.
It produces ASTs and symbol tables, and control flow analysis. It can analyze/transform the code, and regenerate compilable source code. And it includes general purpose transformation machinery underneath, that applies directly to the trees. You don’t have to emit patches and reparse.
PS: EDG and Rose are really the same; Rose simply uses EDG.
EDG doesn’t have any transformational capability. Rose does have it but it seems convoluted, but then I’m spoiled by my own tools.