Re: C/C++ header file parser

daw@taverner.cs.berkeley.edu (David Wagner)
3 Oct 2006 18:12:22 -0400

          From comp.compilers

Related articles
C/C++ header file parser lost_stranger@verizon.net (Pankaj Garg) (2006-09-30)
Re: C/C++ header file parser daw@taverner.cs.berkeley.edu (2006-10-03)
Re: C/C++ header file parser pjb@informatimago.com (Pascal Bourguignon) (2006-10-03)
Re: C/C++ header file parser alex_mcd@btopenworld.com (Alex McDonald) (2006-10-03)
Re: C/C++ header file parser ppluzhnikov-nsp@charter.net (Paul Pluzhnikov) (2006-10-03)
Re: C/C++ header file parser tmk@netvision.net.il (Michael Tiomkin) (2006-10-03)
Re: C/C++ header file parser idbaxter@semdesigns.com (Ira Baxter) (2006-10-10)
| List of all articles for this month |
From: daw@taverner.cs.berkeley.edu (David Wagner)
Newsgroups: comp.compilers
Date: 3 Oct 2006 18:12:22 -0400
Organization: University of California, Berkeley
References: 06-09-169
Keywords: C, C++, parse
Posted-Date: 03 Oct 2006 18:12:22 EDT

Pankaj Garg wrote:
>I need to parse C/C++ header files and extract information about data
>types, functions and function arguments. Which tools/libraries would
>be suitable for me? Are there any examples/sample programs for such.
>
>I don't want to build a full fledged yacc based parser so i am looking
>for a ready made parser, preferably open source.


First, please fix the email address listed in the From: line.
I tried replying by email, but the email bounced.


Regarding your question, search the archives, and you will find
several options listed. One option is that you could try Elsa/Oink:
        http://www.cs.berkeley.edu/~smcpeak/elkhound/sources/elsa/
        http://www.cubewano.org/oink/features_of_elsa.html
        http://www.cubewano.org/oink/
Elsa is a C and C++ parser. Oink is a layer on top of Elsa that
simplifies ("lowers") the C++ and puts it into a canonical form so it
is a little easier to deal with. It's open source. It's not perfect,
but it seems fairly solid. We've been using it in our research to
parse and analyze all Debian C/C++ packages, and it works pretty well:
Elsa can parse most, but not all, of those packages.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.