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]

How do I print a tree?


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


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