help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] Generating glue code from C header files


From: Jan Vrany
Subject: [Help-smalltalk] Generating glue code from C header files
Date: Sat, 20 Jan 2007 17:05:20 +0100

Hi,

a few months ago, we have been talking about problems
with interfacing big C libraries with huge amonunt of functions
and types. 

I found very interesting tool - GCCXML
(http://www.gccxml.org/HTML/Index.html).

It generates XML output from given C (resp. C++) header.
Cool thing is that this tool is implemented as
GCC backend, so it can parse everything that GCC can.

Once xml is generated, one can write XSL stylesheet to generate
customized interface code. I've been playing with those tools
and I wrote (incomplete) XSL stylesheet for creating inteface
code for Smalltalk/X (I'm creating interface for APR ans subversion
libs). 

Generated XML headers as well as XSL stylesheets can be found at
http://moon.felk.cvut.cz/~vranyj1/download/stuff/libapr/
It is nothing more than result of one-evening experiment,
but it looks quite good, I thing.

Main disadvantage of GCCXML is that it operates on
preprocessed source, so all macros are lost. This
could result in some troubles when used with libraries
that uses macros a lot (as GTK+ :-)

However, it might be better solution than AWK/SED scripts.

Cheers,

Jan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]