C++ language parser?

M

Markus Dehmann

Sorry, this is slightly offtopic, but: Given a C++ header file, how
can I get information about all the member functions of the contained
classes, with information about the return types and parameters? In
other words, I need a (simple) C++ language parser. There are many
tools out there that parse C++ code, e.g. g++, swig, ebrowse, etags?,
eclipse-cdt, ... Has anyone experience with using the parser component
of one of these, or are there other C++ language parsers available?

Thanks
Markus
 
J

John Harrison

Sorry, this is slightly offtopic, but: Given a C++ header file, how
can I get information about all the member functions of the contained
classes, with information about the return types and parameters? In
other words, I need a (simple) C++ language parser. There are many
tools out there that parse C++ code, e.g. g++, swig, ebrowse, etags?,
eclipse-cdt, ... Has anyone experience with using the parser component
of one of these, or are there other C++ language parsers available?

Thanks
Markus

No experience but these FAQs might help

http://www.faqs.org/faqs/by-newsgroup/comp/comp.compilers.html

john
 
G

Gernot Frisch

If you want to write a parser, use Spitit++ (www.spirit.sf.net) it's
the best C++ template based parser generator. It has a sample of
parsing complete C-syntax.


--
-Gernot
int main(int argc, char** argv) {printf
("%silto%c%cf%cgl%ssic%ccom%c", "ma", 58, 'g', 64, "ba", 46, 10);}

________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com
 
I

Ira Baxter

Markus Dehmann said:
Sorry, this is slightly offtopic, but: Given a C++ header file, how
can I get information about all the member functions of the contained
classes, with information about the return types and parameters? In
other words, I need a (simple) C++ language parser. There are many
tools out there that parse C++ code, e.g. g++, swig, ebrowse, etags?,
eclipse-cdt, ... Has anyone experience with using the parser component
of one of these, or are there other C++ language parsers available?

If you want to parse real C++ code, there isn't any such thing
as a "simple C++" language parser. If you additionally want
the type information, you need a full C++ front end.

GCC is clearly one option available. It isn't specifically designed
to extract such information for "public use".

Our DMS Software Reengineering Toolkit is another (commercial)
option. It does have a full C++ front end, and all the information
you want is explicitly available through its C++ symbol table
APIs.

See http://www.semdesigns.com/Products/FrontEnds/CppFrontEnd.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top