why <<<NULL>>> in AST dump

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

why <<<NULL>>> in AST dump

Rajendra
Hi,

I am wondering why there is <<<NULL>>> printed in AST dump

   (IfStmt 0xb828598 <line:8:3, line:13:10>
     <<<NULL>>>

for code below and I see the same happening in case of while stmt?

int main()
{
   int x, y;

   x = 10;

   if (x > 0)
     y = 1;
   else if (x == 0)
     y = 0;
   else
     y = -1;

   return 0;
}

Why?

- Rajendra
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: why <<<NULL>>> in AST dump

Philip Craig
On Wed, Dec 26, 2012 at 6:54 PM, Rajendra <[hidden email]> wrote:
> Hi,
>
> I am wondering why there is <<<NULL>>> printed in AST dump
>
>   (IfStmt 0xb828598 <line:8:3, line:13:10>
>     <<<NULL>>>
>
> for code below and I see the same happening in case of while stmt?

These statements can optionally have a condition variable, such as in:

if (int i = foo()) { ... }

The first child of the statement is the DeclStmt for the condition
variable. If there is no condition variable, then <<<NULL>>> is
printed instead.

>
> int main()
> {
>   int x, y;
>
>   x = 10;
>
>   if (x > 0)
>     y = 1;
>   else if (x == 0)
>     y = 0;
>   else
>     y = -1;
>
>   return 0;
> }
>
> Why?
>
> - Rajendra
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev