This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Using of parse tree externally


Hello Denis, 

>>Sure. I would like to have a look at it.
I have a first release of my code at :
	www.geocities.com/mdupont777
it is not really ready for release and does not build perfectly, it is just
a bunch of C++ Interfaces to the Tree,
I have a lot of work to do to clean it up. :) 
The code for the visualisation I have to prepare it, it was not in the first
release.


>>Hmmm... Looks like you have a little bit different problem than I. You
need to
>>output the parse tree. I just need to get the parse tree in a reasonable
form.

Exactly that is the problem that I am working on, in an abstract sense.

As far as I can tell you have three types of trees :
	1. The Parse Tree that is thrown away during the parsing.
	2. tree_t trees inside the built by compiler.
	3. A tree of RTL nodes (which I have not looked at at all yet.)

The reasonable form could be a DOM object or an XML subtree that has all the
information that you need to say, look at a class or a function.
Even if you have a nice C++ Class that has all the information,
it would be isomorphic to a XML graph of all the information.

You still need to know :
1. What is the root of the parse tree
2. What rules are of interest from the parser, and how deep do you need to
go in that parse tree.
3. What are the other trees that are affected or used by one other tree.
4. What about the TreeNodes created by a Parser, what is the connection?
5. What are the most likely occuring configurations of syntax trees, how do
they look and how do them map onto what we see when we write code.

I am still working on mapping out the c grammar and seeing what rules are
used how and what nodes are created when.


Mike

-----Original Message-----
From: Denis Perchine [mailto:dyp@perchine.com]
Sent: 10 October 2000 14:52
To: Dupont, Michael
Subject: Re: Using of parse tree externally


Hello Michael,

> There are two areas that I have been looking into in the last months,
> I am not finished and I did not want to raise false hopes, but I think
some
> of it might be of use :
>
> one is the tree structure, which I have built a C++ Wrapper for and can
> output it to a simple HTML/XML file.
> After that I realised that you need to understand the grammar to
understand
> the nodes for a good part.
>
> Then I was working on some modules to read the dump file produced with -Dy
> when compiling.
> Although only for the c-parse.y grammer, I have a set of perl modules that
> will graph out
> syntax trees and show *how* it is used and not just the what is possible.
>
> I have made a interface for both to the VCG toolkit for displaying the
> graphs.
>
> Denis, The work is not done yet and still needs to be cleaned up, but
maybe
> it would be of interest to you?

Sure. I would like to have a look at it.

> Ideally we could output a parse tree *WITH* the Tree Nodes attached in a
> rich XML file and post process them with XLST.
>
> What do you think?

Hmmm... Looks like you have a little bit different problem than I. You need
to
output the parse tree. I just need to get the parse tree in a reasonable
form.

-- 
Sincerely Yours,
Denis Perchine

----------------------------------
E-Mail: dyp@perchine.com
HomePage: http://www.perchine.com/dyp/
FidoNet: 2:5000/120.5
----------------------------------
-- 
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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]