[Prev][Next][Index]

Re: Valid Expressions



[...]
> Ok. Now, suppose I have the same statement *st and one of st->expr(i) is 
> a valid expression, is it true that the LHS of this expression will 
> always be non-NULL? I think yes, because cases like your counterexample, 
> the LHS will be the EXPR_LIST that I can traverse.
> 

I think you are correct, but I am not sure why it is so important. If
you are traversing the expression tree, I would suggest doing so in a
"safe" manner --- descend the entire tree looking for what you are
interested in; if you do not find it, fine, but there is never any
chance of dying because some node had an unexpectedly null child.  My
Iterator_Expr class provides this functionality (if you do not have it
and want it, email me).

/Andrew/




Follow-Up(s): Reference(s):