Seeking code to parse header files

Discussion in 'C++' started by Baron Samedi, Aug 16, 2007.

  1. Baron Samedi

    Baron Samedi Guest

    I have been searching, unsuccessfully, for a program which will parse
    header files and generate stubs for all external declarations
    (classes, functions, <shudder> global variables).

    I want this so that I can generate dummies for interfacing software,
    for unit testing. As I say, I haven't found it, so it looks like I
    will have to code my own.

    Before I reinvent the wheel, does anyone know of any freely available
    software to parse header files?

    Thanks in advance.
     
    Baron Samedi, Aug 16, 2007
    #1
    1. Advertising

  2. Baron Samedi wrote:
    > I have been searching, unsuccessfully, for a program which will parse
    > header files and generate stubs for all external declarations
    > (classes, functions, <shudder> global variables).
    >
    > I want this so that I can generate dummies for interfacing software,
    > for unit testing. As I say, I haven't found it, so it looks like I
    > will have to code my own.
    >
    > Before I reinvent the wheel, does anyone know of any freely available
    > software to parse header files?

    There are two freely available projects that I'm aware of which can do
    this. Firstly SWIG (http://www.swig.org), and secondly the gcc-xml
    project (http://www.gccxml.org). Swig has an XML output target, which is
    what I used a while ago in a project to parse some C++, although the
    swig parser isn't really a full C++ parser (it only parses a commonly
    used subset)

    Alan
     
    Alan Woodland, Aug 16, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Smith

    Header files included in header files

    John Smith, Jul 21, 2004, in forum: C Programming
    Replies:
    18
    Views:
    611
    Jack Klein
    Jul 24, 2004
  2. Replies:
    19
    Views:
    1,136
    Daniel Vallstrom
    Mar 15, 2005
  3. Replies:
    3
    Views:
    1,309
    Walter Roberson
    May 1, 2006
  4. Baron Samedi
    Replies:
    0
    Views:
    382
    Baron Samedi
    May 15, 2007
  5. mlt
    Replies:
    2
    Views:
    853
    Jean-Marc Bourguet
    Jan 31, 2009
Loading...

Share This Page