[GCC-XML] FW: GCC-XML extension and example dump files

Dupont, Michael michael.dupont at mciworldcom.de
Thu Jan 18 16:58:30 EST 2001


Brad,

Sorry about using the wrong email address (again).

>>I'd be interested in seeing what you have, if possible.  Could you post a
>>link to the list?
I have been meaning to send you a file for a while,
and I have to admit that I am not happy with the current output format.
But it is work in progress, and I have not consolidated the work from three
different location yet.

Here is a good shot at three cleaned up xml files :
http://www.geocities.com/mdupont777/sample.tgz
they are 
	identifier.xml  -- all the identifier nodes created when compiling
tree.c
	field_decl.xml  -- all the fields declared, points to identifier and
type.
	record_type.xml -- all the structures, points to fields and
identifier.

There are still redundant fields in them and they represent 
an older version from the c++ interface to the compiler.

Some info can be found at my (out of date) web page here :
http://www.geocities.com/mdupont777/

the old code archive is here:
http://www.geocities.com/mdupont777/release1.tgz
an example (buggy)xml dump is here
http://www.geocities.com/mdupont777/output_example.tgz

----------------------------------------------------------------------------
----------------

> 1. Taking the tree.h from the GCC and running it through your XML output
> routine.
> 	Maybe you can run this through your currently running copy?
> 	Even an example XML output directory would be cool.....
>>I'll try that out when I get a chance, and put the results on the
>>web.  You should be able to do it, though, by just creating a short .cxx
>>file that includes tree.h, and run g++ on that.  Remember that the
>>extension is in the C++ front end, so it won't do anything for c-only
>>code, unless it is compiled by the C++ compiler.

Thats exaclty how I got the C++ interface to the compiler going,
If you run generator over the CHandles.hpp in the code archive 
http://www.geocities.com/mdupont777/release1.tgz
(assuming it will compile... := )
Otherwise I WILL try it out on the weekend on my linux box.

>> 6. make a routine to be able to also dump a DTD from a given data
structure.
>I'm not sure what you mean by this.  Could you elaborate, please?
Given a C++ Class, and create a routine to output it, and an DTD that would
describe it.
If you can output the record, and know what the objects pointed to are, then

you can make a dtd.

> 4. Adding in the knowledge that I have gained from the tree-internals
> and the dynamic usage data to create a kick-ass : 
	interface to the compilers tree-struct and even a C++ one.
	create a dtd for the tree struct.

>>This is adding an extra
>>stage, though, and the GCC tree would be HUGE in XML.
This would be a question of tweaking the output routine to only output what
you want.
I am thinking about some way to add a XSLT or XPATH routine at run time 
that would evaluate *which* pieces would be outputted.
Even creating a DOM interface that would "SIT" on top of the tree memory
structure at run time,
a interface that would map a data structure onto a read-only XML/DOM
representation.
This would replace the save/parse interface with a very fast in-memory
interface with the option
to write to file.
Of course this is a *LONG* way off.... *grin*

Mike
-----Original Message-----
From: Brad King [mailto:brad.king at kitware.com]
Sent: 18 January 2001 21:42
To: Dupont, Michael
Cc: 'gccxml at kitware.com'
Subject: RE: GCC-XML extension


Mike,

> I am happy to see this project start up and that you are going to be
> working on the project. As you might have remembered, I have been
> working in parallel on a complementry xml interface.
I'd be interested in seeing what you have, if possible.  Could you post a
link to the list?

> 1. Taking the tree.h from the GCC and running it through your XML output
> routine.
> 	Maybe you can run this through your currently running copy?
> 	Even an example XML output directory would be cool.....
I'll try that out when I get a chance, and put the results on the
web.  You should be able to do it, though, by just creating a short .cxx
file that includes tree.h, and run g++ on that.  Remember that the
extension is in the C++ front end, so it won't do anything for c-only
code, unless it is compiled by the C++ compiler.

> 2. Creating a XSLT routine to extract the field members and thier types
from
> XML file.
> 3. Generating a better XML-Output routine that uses the full type info to
> extract all the fields.
Things like this are the reason I created this list.

> 4. Adding in the knowledge that I have gained from the tree-internals
> and the dynamic usage data to create a kick-ass 
Huh?  I think you might have forgotten to complete this sentence :)

> 5. Extending this to be able to xml-dump *any* compiler data structure.
> 	- rtl
> 	- preprocessor tokens
> 	- bison rules 
> 	- STABS debugging information
> 	- object file layout.
> I think that this would be a great contribution to the gnu compiler
This would certainly be interesting, and could facilitate external
debuggers for the compiler.  For this GCC-XML project, I had in mind to be
able to describe C++ in XML, but we could have both.  If we integrate
something into GCC to dump out its tree representation of the program,
then something else could get the information it needs to generate a C++
program representation in another XML format.  This is adding an extra
stage, though, and the GCC tree would be HUGE in XML.

> 6. make a routine to be able to also dump a DTD from a given data
structure.
I'm not sure what you mean by this.  Could you elaborate, please?

-Brad

-- 
This communication contains information which is confidential and 
may also be privileged.  It is for the exclusive use of the 
intended recipient(s).  If you are not the intended recipient(s), 
please note that any distribution, copying or use of this 
communication or the information in it is strictly prohibited.  
If you have received this communication in error, please notify 
the sender immediately and then destroy any copies of it.





More information about the gccxml mailing list