java parser in c++?
This is a long shot, but does anyone know of a parser (in c++, of course) that can parse java files, and get me the call graphs of the functions?
I tried looking around for it, couldn't find much. Parsing C++ seems to be a challenge (think cure for AIDS), but they have have some incomplete solutions around (all thanks to the c++ templates). There seems to be a solid, stable one available, but for $40k to $250k, according to the developers (edg).
So yeah, any ideas?
So what, parse Java or C++?
For C++, the Mozilla project has some static analysis projects that should be able to do this.
For Java, I don't know. Maybe you can hook up the GCC-based tools that Mozilla has to GCJ.
Anyway, getting a complete callgraph for a program with dynamic dispatch (like function pointers or virtual functions) is impossible.
Yeah, well if I can have both it'd be great, but that's unlikely to happen..
I stumbled across a free c++ parser (Elsa), but it doesn't seem to work as well as I had hoped (compilation errors here and there). Maybe I'm just not trying hard enough..
It's true that you can't get a complete callgraph, but even an incomplete one would be useful for code analysis I'd imagine..
Sounds like Doxygen is what you need.