Parsing C header files

Discussion in 'Ruby' started by Wayne, Aug 3, 2007.

  1. Wayne

    Wayne Guest

    I was wondering if there is a tool that can parse a C header file and
    give me an AST that would allow me to process it in Ruby. Does anyone
    know of a relatively easy way to do this? I was thinking that a lot
    of people probably need to parse API's for one reason or another.

    My situation is that we have a large application that was originally
    written in Ada, but now has a C interface. We need to make the API
    available to Matlab/Simulink, which is a model-based development
    system (basically it's programming with diagrams). This is done in
    Matlab via S-functions (system functions). This system is pretty
    large and writing all the S-functions by hand would be a big job.
    Seems to me that a tool is the best choice and Ruby seems like the
    tool to do it.
     
    Wayne, Aug 3, 2007
    #1
    1. Advertising

  2. Wayne

    Eric Hodel Guest

    On Aug 2, 2007, at 17:50, Wayne wrote:

    > I was wondering if there is a tool that can parse a C header file and
    > give me an AST that would allow me to process it in Ruby. Does anyone
    > know of a relatively easy way to do this? I was thinking that a lot
    > of people probably need to parse API's for one reason or another.
    >
    > My situation is that we have a large application that was originally
    > written in Ada, but now has a C interface. We need to make the API
    > available to Matlab/Simulink, which is a model-based development
    > system (basically it's programming with diagrams). This is done in
    > Matlab via S-functions (system functions). This system is pretty
    > large and writing all the S-functions by hand would be a big job.
    > Seems to me that a tool is the best choice and Ruby seems like the
    > tool to do it.


    Take a look at h2rb in ext/dl/ in a ruby checkout/tarball.

    --
    Poor workers blame their tools. Good workers build better tools. The
    best workers get their tools to do the work for them. -- Syndicate Wars
     
    Eric Hodel, Aug 4, 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. Newsgroup - Ann
    Replies:
    4
    Views:
    716
    lilburne
    Nov 2, 2003
  2. Ian McConnell

    Parsing C header files with python

    Ian McConnell, Aug 21, 2004, in forum: Python
    Replies:
    6
    Views:
    1,779
    Miki Tebeka
    Aug 23, 2004
  3. 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
  4. Replies:
    3
    Views:
    1,309
    Walter Roberson
    May 1, 2006
  5. mlt
    Replies:
    2
    Views:
    853
    Jean-Marc Bourguet
    Jan 31, 2009
Loading...

Share This Page