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 |
What is activation record? Explain clearly the components of an activation record.
Write short notes on:
Show that no left recursive grammar can be LL(1). Show that no LL(1) grammar can be ambiguous.
What are the propositions of Putnam’s model?
What is Decomposition in project estimation method ?
Briefly Discuss about Requirements Analysis