[GCC-XML]Some questions

Brad King brad.king at kitware.com
Tue Mar 11 17:32:51 EST 2003


> 1) Does gccxml parse and generate function bodies?

No.  See this web page for an explanation:

  http://www.gccxml.org/HTML/FAQ.html

> 2) It would be nice to have more detailed information about the location
> of constructs. As far as I understand, only the first line of function
> definition is currently included in the output.

This answer is subsumed by the fact that only declarations are dumped.
Every declaration has its exact location dumped, but function definitions
(bodies) are not dumped.

> I think that the output would ideally contain the entire parse tree with
> detailed connection to the source text. Using such a representation, it
> would be easy to build various tools that need to deal with C/C++-code
> (and it is the final purpose of the project, as I can see it). For
> example, let's suppose we are going to create a tool that enables
> automatic renaming of all occurrences of an identifier (taking into
> account language visibility rules). Beyond other issues, we will need
> the entire parse tree to find all occurrences of the identifier.

Yes, that is the ultimate goal.  Having an XML representation of all of
C++ will open the language to tools in many other languages.  For now, you
might want to look at OpenC++ for a more complete parser.

-Brad




More information about the gccxml mailing list