Forum: Ruby Parsing C header files

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1ccae317ad748fd670fdb8ef5d26586e?d=identicon&s=25 Wayne (Guest)
on 2007-08-03 02:51
(Received via mailing list)
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.
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 Eric Hodel (Guest)
on 2007-08-04 10:13
(Received via mailing list)
On Aug 2, 2007, at 17:50, Wayne wrote:

> 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.
This topic is locked and can not be replied to.