Generate the three address code for the following code segment.
main() { int a=1, z=0; int b[10]; while (a<=10) b[a]=2*a; z=b[a]+a; }
Three address code for the above code segment:
I0 |
func begin main |
I1 |
a:=1 |
I2 |
z:=0 |
I3 |
Label .L0 |
I4 |
if a<=10 goto .L1 |
I5 |
goto .L2 |
I6 |
label .L1 |
I7 |
_t0:=2*a |
I8 |
_t1:=4*a |
I9 |
_t2:=&b |
I10 |
_t2[_t1]:=_t0; // assuming the (size of int) = 4 |
I11 |
goto .L0 |
I12 |
label .L2 |
I13 |
_t3:=a |
I14 |
_t4:=4*a |
I15 |
_t5:=&b |
I16 |
_t6:=_t5[_t4] |
I17 |
_t7:=_t6+_t3 |
I18 |
z:=_t7 |
I19 |
func end main |
Show that no left recursive grammar can be LL(1). Show that no LL(1) grammar can be ambiguous.
What is Decomposition in project estimation method ?
Write a C program to find a number is AMSTRONG or NOT.
What do you mean by co-channel interference and system capacity?
Discuss the different stages of ‘Capability Maturity Model’.
What is Risk? Why Risk Analysis is done?
Find the time complexity of Binary Search Algorithm.