Gcc standardization of something like gccxml?

andy.glew@amd.com andy.glew@amd.com
Sat Oct 25 18:20:00 GMT 2003


Are there any plans to include something like gccxml
in the standard GCC distribution?
   ... please?
   ... I hope so ...
   ... it would be really cool ...
   ... [grovel, whine, whimpeer]

gccxml, www.gccxml.org, patches several versions of gcc
to print an XML representation of the C++ data structures,
something like 
   <Struct id="_45" name="Foo" context="_33" members="_46 _47" />
   <Member id="_46" name="m_bar" context="_45" type="_66"/>
   <Member id="_47" name="m_blick" context="_45" type="_66"/>
The XML may not be pretty - in particular, it is flat,
not hierarchical - but it is easier to parse than C++.

I would like to use gccxml in tools that understand C++ code,
and perform introspection, reflection, or code generation actions 
upon it - stuff like
   a) generating boilerplate code, such as print functions
      and serialization routines
   b) test coverage and driver tools
   etc.
But I am somewhat reluctant to base such tools on something
like gccxml that may break in a future release of GCC.

There are other, similar, reflective tools for C and C++,
such as SWIG (www.swig.org) and OpenC++ (http://opencxx.sourceforge.net).
However, these tools are based on their own compilers or parsers,
which means that they often do not parse the full C/C++
languages.  In particular, SWIG doesn't handle nested structs.

By basing itself on GCC, gccxml is much more likely to be able
to handle the full language handled by gcc/g++.

---

I think that providing standard support for something like
gccxml would make it easier to build "smart" tools in a GCC
environment.

===

Flip side:  if gccxml is too ugly and grotty to put into
the distribution, can anyone give me some pointers as to
the right way?



More information about the Gcc mailing list