Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Parsing C header files

Reply
Thread Tools

Parsing C header files

 
 
Wayne
Guest
Posts: n/a
 
      08-03-2007
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.

 
Reply With Quote
 
 
 
 
Eric Hodel
Guest
Posts: n/a
 
      08-04-2007
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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Header files with "header.h" or <header.h> ?? mlt C++ 2 01-31-2009 02:54 PM
UNIX header files to Windows header files anand.ba@gmail.com C Programming 3 05-01-2006 03:57 PM
Parsing C header files with python Ian McConnell Python 6 08-23-2004 08:55 AM
Header files included in header files John Smith C Programming 18 07-24-2004 04:55 AM
What is better /standard for creating files. a cpp file with header or cpp and seperate file for header DrUg13 C++ 1 02-10-2004 09:20 AM



Advertisments