[GCC-XML] C++ Reflection Using GCCXML?

Brad King brad.king at kitware.com
Thu Sep 1 09:05:50 EDT 2005


Bryan Ischo wrote:
> The concept is pretty simple: GCCXML can be used to generate, via a tool
> which reads in the GCCXML output and constructs a representation of the
> class hierarchy and class structures thus parsed by GCCXML, a set of
> "tables" describing all of the data relevent to reflection for the input
> C++ classes.  These tables can be used at runtime by a library of methods
> for looking up information describing any C++ class.

A few years ago I wrote a proposal for the NSF describing exactly this 
idea.  I even added the idea of small plugin modules for interpreters 
such as Tcl or Python that load the reflection library and generate 
bindings in their corresponding language.  It was rejected because the 
reviewers thought "dlopen" could do what I proposed, which is completely 
bogus.

You're correct.  GCC-XML is perfectly suited for generating reflection 
libraries.  It was in fact written to be a full C++ parser for use in 
generating bindings for interpreted languages.  If you are interested in 
implementing such a tool that would be great!

-Brad



More information about the gccxml mailing list