[GCC-XML]Re: [cable] swig + cable.

Brad King brad.king at kitware.com
Sun Feb 24 19:11:36 EST 2002


> > In any case, I'd look at 1.3 to see if it solves your problem.   If
> > not, it would be interesting to know how gcc-xml could be used as a
> > possible front-end to SWIG.   I'm not aware of anyone working on this,
> > so you might be the first.  I think it would be interesting to see how
> > something like that might work.
>
> I don't really know enough about the swig internals to try this yet.  
> However it seems like a sensible idea( being a more complete parser,
> with many active developers ).  It looks like a class which emulates
> the Node class could be put into the various swig Language classes.  
> It would read the xml output from gccxml.  gccxml uses the
> preprocessor which includes everything, so something may have to be
> done there( although in the xml output there is info about which file
> each node comes from ).

GCC-XML was not designed originally to facilitate source code
transformations.  The new version I'm writing that dumps a more useful
graph-like representation of the source may eventually be sufficient to
handle this.

> The other problem I've had is that gcc refuses to read in a header
> file.  Is there anyway to get it to do this?  The way I got around it
> was to make a .cpp file with just a #include "bla.h" in it :)

The build system I've been using for GCC-XML/CABLE (CMake) generates a
.cxx file which #includes the needed headers and then uses sizeof(T) to
guarantee an implicit instantiation of whatever type T we are interested
in wrapping (even a template instantation).  GCC-XML is then run on this
.cxx file.  I'm not aware of any way to directly read a .h file with GCC.

-Brad




More information about the gccxml mailing list