List Info

Thread: Generating glue code from C header files




Generating glue code from C header files
user name
2007-01-20 10:05:20
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.gccx
ml.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



_______________________________________________
help-smalltalk mailing list
help-smalltalkgnu.org

http://lists.gnu.org/mailman/listinfo/help-smalltalk

Re: Generating glue code from C header files
user name
2007-01-21 05:21:48
> 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.gccx
ml.org/HTML/Index.html).

Hi Honza,

GCCXML is indeed interesting (it would be even more
interesting if it 
was distributed as a patch against GCC mainline). 
Unfortunately, the 
fact that it works on preprocessed source code is a main
hindrance to 
its usage for this purpose.

You may want to take a look, on the other hand, at the XML
output mode 
of SWIG.

Ciao,

Paolo


_______________________________________________
help-smalltalk mailing list
help-smalltalkgnu.org

http://lists.gnu.org/mailman/listinfo/help-smalltalk

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )