[GCC-XML] Where to start to adapt GCC-XML ontop the gcc C parser and not the C++ one?

Brad King brad.king at kitware.com
Fri Feb 25 10:55:25 EST 2005


Thomas Menguy wrote:
> Everything is in the title, I would like to have strong support for C
> as well, and I'm ready to inverst some time to see if its possible to
> work with the C parser as well ... where should I start? :-)
> What are the modifications you've made to g++ ?(hooks to access the data tree?).
> Ideally I would like to reuse the xml.c you've done and change the
> parser according to the source file extension, is it a big effort ?
> (that I think I would be ready to do when needed .. and of course
> share it!)

Look in the GCC-XML source tree under the GCC/gcc and GCC/gcc/cp 
directories.  Several files have been modified.  All modifications are 
marked by comments like this:

/* BEGIN GCC-XML MODIFICATIONS ($Date: 2003/11/21 21:29:54 $) */
...
/* END GCC-XML MODIFICATIONS ($Date: 2003/11/21 21:29:54 $) */

The main dump code is in GCC/gcc/cp/xml.c.  The hook from the C++ parser 
is in GCC/gcc/cp/semantics.c in the finish_translation_unit function 
when it calls do_xml_output.  You'll have to find the equivalent place 
in the C parser.

-Brad



More information about the gccxml mailing list