in Compiler Design edited by
1,433 views
2 votes
2 votes

​Consider the following expression: $x[i]=(p+r) *-s[i]+u / w$. The following sequence shows the list of triples representing the given expression, with entries missing for triples $(1), (3)$, and $(6)$.
 

$$\begin{array}{|c|c|c|c|}
\hline(0) & + & p & r \\
\hline(1) & & & \\
\hline(2) & \text{uminus} & (1) & \\
\hline(3) & & & \\
\hline(4) & / & u & w \\
\hline(5) & + & (3) & (4) \\
\hline(6) & & & \\
\hline(7) & = & (6) & (5) \\
\hline
\end{array}$$

Which one of the following options fills in the missing entries CORRECTLY?

  1. $(1)$ $=\left[ ]\begin{array}{lll}\text {s } i    & (3) ^{*}(0)(2) & \text { (6) }[ ]= x  i\end{array}\right.$
  2. $(1) $[ ]$=s  i \quad (3)-(0)(2) \quad(6)=[ ] x(5)$
  3. $(1)=[ ]$ s $i \quad (3) ^{*}(0)(2) \quad(6)[ ]=x(5)$
  4. $(1)$ [ ]$=s i \quad(3)-(0)(2) \quad(6)=[ ] x i$
in Compiler Design edited by
by
1.4k views

1 Answer

0 votes
0 votes
A is the correct answer.

1 comment

Any resource for learning three address code where such array type questions are available?Ullman only has exercises for these types and no examples to understand how to write TAC for array indexes
0
0
Answer:

Related questions