How to run over each node of a tree ?

Matthieu Moy Matthieu.Moy@imag.fr
Tue May 20 10:12:00 GMT 2003


Hi,

I want to do a complete run over a tree (GCC AST). 

Basically, this is a recursive function with a switch statement on the
TREE_CODE of the top of the tree. 

But is there a  way to be sure I didn't forget  any case. For example,
on a  WHILE_STMT, I  may have forgoten  to explore the  WHILE_COND, or
something like this.

In particular, how  can I know wether a node has  a TREE_CHAIN field ?
This field sometimes points to a junk value (Not NULL, not a tree ...)

Thanks for your help,

-- 
Matthieu



More information about the Gcc mailing list