Question: Question In Theory of Compilers 2 . Implement the statement a: = - b + c * ( d - e ) + f *

Question In Theory of Compilers
2. Implement the statement a:=-b + c*(d-e)+ f *(c*(d-e)) into following Intermediate code representation.
a) Quadruple
b) Triple
c) Indirect Triple
.
Solve it like this Example
.
.
Problem Based on Representation of Three Address code
Problem-01:
Translate the following expression to quadruple, triple and indirect triple-
a+bceuarrf+bc
Solution-
Three Address Code for the given expression is-
T1=euarrf
T2=bc
T3=T2T1
T4=ba
T5=a+T3
T6=T5+T4
Quadruple Representation-
\table[[Location,op,Arg1,Arg2,Result],[(0),uarr,e,f,T1],[(1),x,b,c,T2],[(2),??,T2,T1,T3],[(3),x,b,a,T4],[(4),+,a,T3,T5],[(5),+,T5,T4,T6]]
Now, we write the required representations-
Shabbir Alam
COMP 433
Chapter -5- Intermediate Code Generation
Problem Based on Representation of Three Address code
Triple Representation-
\table[[Location,Op,Arg1,Arg2],[(0),uarr,e,f
 Question In Theory of Compilers 2. Implement the statement a:=-b +

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!