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]
Other format: [Raw text]

How to run over each node of a tree ?


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


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