This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
How do I print a tree?
- To: <gcc at gcc dot gnu dot org>
- Subject: How do I print a tree?
- From: klaxi at t-online dot de (Christian Baxmann)
- Date: Sat, 8 Apr 2000 19:24:09 +0200
Hi there!
I'd like to know how to print a tree (AST), generated by the g++-Front-End.
I don't know if gcc/g++ can do that by themself (via compiler options) or
somehow
have to be inctructed to do so.
There are several print-routines (print_node, print_lang_identifier,
print_lang_type etc.),
but I can't figure out where in gcc/g++ they are used to print a tree (AST).
I searched and
tried to understand the source code, but still can't say where to "activate"
or integrate it.
There has to be a routine that walks through the tree. So, my idea by now is
to use
the print_node-routine (in gcc/print-tree.c) for each node it "walks
trough".
But I guess there is a more simple or allready integrated routine in gcc/g++
that I can't find.
Hopefully yours
Christian Baxmann