Computer Science, asked by pruthvi7417, 8 months ago

Write a program to generate three address code in c

Answers

Answered by Anonymous
1

Explanation:

There are 3 representations of three address code namely

There are 3 representations of three address code namelyQuadruple

There are 3 representations of three address code namelyQuadrupleTriples

There are 3 representations of three address code namelyQuadrupleTriplesIndirect Triples

There are 3 representations of three address code namelyQuadrupleTriplesIndirect Triples1. Quadruple –

There are 3 representations of three address code namelyQuadrupleTriplesIndirect Triples1. Quadruple –It is structure with consist of 4 fields namely op, arg1, arg2 and result. op denotes the operator and arg1 and arg2 denotes the two operands and result is used to store the result of the expression.

There are 3 representations of three address code namelyQuadrupleTriplesIndirect Triples1. Quadruple –It is structure with consist of 4 fields namely op, arg1, arg2 and result. op denotes the operator and arg1 and arg2 denotes the two operands and result is used to store the result of the expression.Advantage –

There are 3 representations of three address code namelyQuadrupleTriplesIndirect Triples1. Quadruple –It is structure with consist of 4 fields namely op, arg1, arg2 and result. op denotes the operator and arg1 and arg2 denotes the two operands and result is used to store the result of the expression.Advantage –Easy to rearrange code for global optimization.

There are 3 representations of three address code namelyQuadrupleTriplesIndirect Triples1. Quadruple –It is structure with consist of 4 fields namely op, arg1, arg2 and result. op denotes the operator and arg1 and arg2 denotes the two operands and result is used to store the result of the expression.Advantage –Easy to rearrange code for global optimization.One can quickly access value of temporary variables using symbol table.

There are 3 representations of three address code namelyQuadrupleTriplesIndirect Triples1. Quadruple –It is structure with consist of 4 fields namely op, arg1, arg2 and result. op denotes the operator and arg1 and arg2 denotes the two operands and result is used to store the result of the expression.Advantage –Easy to rearrange code for global optimization.One can quickly access value of temporary variables using symbol table.Disadvantage –

There are 3 representations of three address code namelyQuadrupleTriplesIndirect Triples1. Quadruple –It is structure with consist of 4 fields namely op, arg1, arg2 and result. op denotes the operator and arg1 and arg2 denotes the two operands and result is used to store the result of the expression.Advantage –Easy to rearrange code for global optimization.One can quickly access value of temporary variables using symbol table.Disadvantage –Contain lot of temporaries.

There are 3 representations of three address code namelyQuadrupleTriplesIndirect Triples1. Quadruple –It is structure with consist of 4 fields namely op, arg1, arg2 and result. op denotes the operator and arg1 and arg2 denotes the two operands and result is used to store the result of the expression.Advantage –Easy to rearrange code for global optimization.One can quickly access value of temporary variables using symbol table.Disadvantage –Contain lot of temporaries.Temporary variable creation increases time and space complexity.

There are 3 representations of three address code namelyQuadrupleTriplesIndirect Triples1. Quadruple –It is structure with consist of 4 fields namely op, arg1, arg2 and result. op denotes the operator and arg1 and arg2 denotes the two operands and result is used to store the result of the expression.Advantage –Easy to rearrange code for global optimization.One can quickly access value of temporary variables using symbol table.Disadvantage –Contain lot of temporaries.Temporary variable creation increases time and space complexity.Example – Consider expression a = b * – c + b * – c.

There are 3 representations of three address code namelyQuadrupleTriplesIndirect Triples1. Quadruple –It is structure with consist of 4 fields namely op, arg1, arg2 and result. op denotes the operator and arg1 and arg2 denotes the two operands and result is used to store the result of the expression.Advantage –Easy to rearrange code for global optimization.One can quickly access value of temporary variables using symbol table.Disadvantage –Contain lot of temporaries.Temporary variable creation increases time and space complexity.Example – Consider expression a = b * – c + b * – c.The three address code is:

t1 = uminus c

t1 = uminus ct2 = b * t1

t1 = uminus ct2 = b * t1t3 uminus c

t1 = uminus ct2 = b * t1t3 uminus ct4 b * t3

t1 = uminus ct2 = b * t1t3 uminus ct4 b * t3t5 = t2 t4

t1 = uminus ct2 = b * t1t3 uminus ct4 b * t3t5 = t2 t4a = t5

Similar questions