This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Using of parse tree externally
- To: dewar at gnat dot com, michael dot dupont at mciworldcom dot de
- Subject: RE: Using of parse tree externally
- From: dewar at gnat dot com (Robert Dewar)
- Date: Fri, 20 Oct 2000 10:24:24 -0400 (EDT)
- Cc: gcc at gcc dot gnu dot org
<<The parser's syntax tree will also be interesting for cross referencing,
if you have a give AST node, in what parser rule was that node created from?
What where the tokens on the stack, or inherited that might be needed.
In the gcc -Dy dumps, you have the entire source code of the program,
albeit run through the "Fleischwolf" or meatgrinder.
That might be of interest to the two-way reverse engineering tools ala
rose/together and co.,
you can then get then entire token/rule stream associated with a AST, and be
able to reconstruct the original source code from an give dump.
>>
Well most certainly the AST should contain source location information,
generally the AST is precisely a superset of the parser syntax tree.
Clearly for cross-referencing you need visibility analysis to be
performed when you have a block structured language like C, where
you can have many instances of the same identifier in the same function.