[Prev][Next][Index]
Re: A question about SgStatement::expr()
- To: Diego Novillo <diego@cs.ualberta.ca>
- Cc: sage-bugs@cica.indiana.edu
- Subject: Re: A question about SgStatement::expr()
- In-Reply-To: Your message of "Thu, 28 Jul 1994 15:12:52 MDT."
<Pine.3.89.9407281537.A3627-0100000@sundance.cs.ualberta.ca>
- Date: Thu, 28 Jul 1994 16:20:46 -0500
- From: Andrew Mauer <mauer@mcs.anl.gov>
> I've been experimenting with SgStatement::expr() and it appears
> that it is always true that given,
>
> SgStatement *st = .... ;
>
> Then, if the statement is executable, st->expr(i)->lhs() will
> contain the executable expression and st->expr(i)->rhs() will be NULL. Is
> that true?
>
> I tried it on several sources and it seems to be true, but I wanted to
> confirm that.
>
It is not always true. Except in pathological circumstances, it
probably is, but check out this program:
int main (void)
{
int i,j,k;
k, j = 0; /* Counterexample :-) */
}
The top-level EXPR_LIST is used to make the comma that appears. Real
nice, huh?
If you want my dep-file cheat sheet that I wrote as I was learning how
to understand what was going on, let me know and I will send it to you.
/Andrew/
Follow-Up(s):
Reference(s):