hi guys.
Another problem facing in my profiler program is with branches.
I need to change this:
to this:
The problem is when i read an "if" line, i have to check include thebraces since i'm adding another statement that must be inside the if. Now i know the braces won't be there for the above one, but what if i have a :
How would i know when to close the matching braces that i opened??
Can anyone think of a way?
Thank you.
Another problem facing in my profiler program is with branches.
I need to change this:
Code:
x = 5; y = x + 2x + 7; if (x > y) printf(“x is %d\n”, x); else printf(“y is %d\n”, y);
Code:
x = 5; y = x + 2x + 7; if (x > y) { branch[0]++; printf(“x is %d\n”, x); } else { branch[1]++; printf(“y is %d\n”, y); }
Code:
if (....) if (.....) { .... }
Can anyone think of a way?
Thank you.
Comment