1 Crore+ students have signed up on EduRev. Have you? |
In some phase of compiler
Input
temp1 := Inttoreal (60)
temp2 := id3 * temp1
temp3 := id2 + temp2
id1 := temp3
Output
temp 1 := id3 * 60.0
id1 := id2 + temp1
where temp 1 , temp 2 , temp 3 are temporary storage, id1, id2, Id3 are identifier into real is converting int 60 to real number. The above phase is
Input:
temp1: = inttoreal(60)
temp2: = id3*temp1
temp3 : = id2 + temp2
id1 : = temp3
Output:
temp1 : = id3*60.0
id1 : id2 + temp1
The above phase is code optimization, because it is optimizing the intermediate code using only storages as temp 1 and id1.
The above DAG represents
(a + b * C ) * { b * C - d )
Simplest DAG:
Simplifying the DAG:
Thus result: (a + b) * (c + cf) + (a - b) * (c + d)
Consider the DAG with V = {1, 2, 3, 4, 5, 6}, shown below
Which of the following is NOT a topological ordering
A directed acyclic graph represents one form of intermediate representation. The number of non terminals nodes in DAG of a = (b + c)*(b + c) expression is
Since indegree of node 3 is 1. So cannot start topological ordering with node 3 only start node will be 1.
A pictorial representation of the value computed by each statement in the basic block is
A pictorial representation of the value computed by. each statement in the basic block is control flow graph.
DAG representation of a basic block allows
DAG representation of a basic block allows automatic detection of local common sub expression.
The intermediate code generated for the following syntax tree is:
The intermediate code generated is iacb + cd uminus * - +
The triple representation for following representation is:
Generation of intermediate code based on an abstract machine model is useful in compilers because
Intermediate code enhance the portability of the front end of the compiler.
Three address code’ technique for intermediate code generation shows that each statement usually contains three addresses. Three addresses are as follows:
Three address code formate is two addresses for operands and one for operator.
Consider the following arithmetic infix expression Q.
Transform 'Q' into its equivalent postfix expression.
Given expression
Equivalent postfix expression;
Which of the following is not a type of three address statements?
Consider the following statements:
S1: Three address code is a linearized representation of a syntax tree.
S2: The syntax tree not depicts the natural hierarchical structure of source program
Which of the above statements is/are true
149 docs|215 tests
|
Use Code STAYHOME200 and get INR 200 additional OFF
|
Use Coupon Code |
149 docs|215 tests
|
|
|
|
|
|
|
|
|