Question

For the following, translate into three address codes, and make the abstract syntax tree (1) x[i]...

For the following, translate into three address codes, and make the abstract syntax tree

(1) x[i] = y[j] + z[k]

(2) a[i] = b[c[j]] + d[e[k] + f[i]]

(3) a[i][j] = b[k][i] + x

Homework Answers

Answer #1

Three adress code for abstract syntax tree for :

(1) x[i] = y[j] + z[k]

T1= z[k]

T2=y[j]

T3= T1+T2

x[i]=T3

(2)  a[i] = b[c[j]] + d[e[k] + f[i]]

  a[i] = bc[j] + de[k] + f[i]

T1=f[i]

T2=de[k]

T3=bc[j]

T4=T1+T2+T3

a[i]=T4

or

   a[i] = b[c[j]+ d[e[k] + f[i]]

=b*c[j] + d*e[k] + d*f[i]

T1=e[k]

T2=d*T1

T3=f[i]

T4=d*T3

T5=c[j]

T6=b*T[5]

T7=T2+T4+T6

a[i]=T[6]

HOPE I ANSWERED YOUR QUESTION AND WISH YOU ALL THE BEST.

PLEASE RATE THIS ANSWER WITH AN UPVOTE, THANKYOU.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Assignment-I Do the Lexical Analysis and draw the parse tree in the syntax analysis for the...
Assignment-I Do the Lexical Analysis and draw the parse tree in the syntax analysis for the following source code statement                        “ Sum : = PI + r1 * r2*80 “ Draw the transition diagram and transition table for NFA that recognizes the language:                     (a | b)* aabbb If x and y are strings ; write the answers for the following if x=”Hello” and y=”Welcome” : x2y4= xy2  =   x5 y.epsilon =
Write each of the following expressions in unit vector notation of the form , x i...
Write each of the following expressions in unit vector notation of the form , x i + y j + z k , where x, y, and z are just numbers. A: (i x j) x (i + k) B: [i x (j x i)] x k C: [(i + j) x (j+k)] x ( i x k) D: (i + j) x [(j + k) x (i x k)]
The following is a 3 x 3 two-way table: X = 1 X = 2 X...
The following is a 3 x 3 two-way table: X = 1 X = 2 X = 3 Total Y = 1 A B C D Y = 2 E F G H Y = 3 I J K L Total M N O P According to this table: a) A P is a joint or conditional or marginal probability. b) N P is a joint or conditional or marginal probability. c) F H is a joint or conditional or...
(1 point) For each of the following vector fields F , decide whether it is conservative...
(1 point) For each of the following vector fields F , decide whether it is conservative or not by computing curl F . Type in a potential function f (that is, ∇f=F). If it is not conservative, type N. A. F(x,y)=(10x+7y)i+(7x+10y)j f(x,y)= 10 B. F(x,y)=5yi+6xj f(x,y)= N C. F(x,y,z)=5xi+6yj+k f(x,y,z)= D. F(x,y)=(5siny)i+(14y+5xcosy)j f(x,y)= E. F(x,y,z)=5x2i+7y2j+5z2k
CRYPTOGRAPHY PROBABILITY DISTRIBUTION Bad Shuffles Consider the following card shuffling algorithm. There are three cards in...
CRYPTOGRAPHY PROBABILITY DISTRIBUTION Bad Shuffles Consider the following card shuffling algorithm. There are three cards in the deck and they are each represented by an element in {X, Y, Z}. [Bonus marks if you use the deck {W, X, Y, Z}] Algorithm Shuffle --------------------------------------------------- deck := [X,Y,Z] for i from 0 to 2 do j := RANDOM(i) swap values of deck[i] and deck[j] end for return deck --------------------------------------------------- For each of the following definitions of RANDOM(i), compute the probability distribution...
1. Write the following sets in list form. (For example, {x | x ∈N,1 ≤ x...
1. Write the following sets in list form. (For example, {x | x ∈N,1 ≤ x < 6} would be {1,2,3,4,5}.) (a) {a | a ∈Z,a2 ≤ 1}. (b) {b2 | b ∈Z,−2 ≤ b ≤ 2} (c) {c | c2 −4c−5 = 0}. (d) {d | d ∈R,d2 < 0}. 2. Let S be the set {1,2,{1,3},{2}}. Answer true or false: (a) 1 ∈ S. (b) {2}⊆ S. (c) 3 ∈ S. (d) {1,3}∈ S. (e) {1,2}∈ S (f)...
Suppose that P{X=i,Y=j} = c(i+j) for non negative integers i and j with i+j <= 3;...
Suppose that P{X=i,Y=j} = c(i+j) for non negative integers i and j with i+j <= 3; otherwise, the probability is zero. (a) Determine c. (b) Compute the marginal p.m.f. of X. (c) Compute the marginal p.m.f. of Y. (d) Are X and Y be independent? (e) Compute P(X+Y<2). (f) ComputeE[XY]. (g) Compute E[X] and E[Y]. (h) Compute E[X+Y].
Let F(x,y,z) = ztan-1(y^2) i + (z^3)ln(x^2 + 8) j + z k. Find the flux...
Let F(x,y,z) = ztan-1(y^2) i + (z^3)ln(x^2 + 8) j + z k. Find the flux of F across the part of the paraboloid x2 + y2 + z = 20 that lies above the plane z = 4 and is oriented upward.
Consider F and C below. F(x, y, z) = yz i + xz j + (xy...
Consider F and C below. F(x, y, z) = yz i + xz j + (xy + 12z) k C is the line segment from (2, 0, −3) to (4, 6, 3) (a) Find a function f such that F = ∇f. f(x, y, z) =       (b) Use part (a) to evaluate    C ∇f · dr along the given curve C.
Consider F and C below. F(x, y, z) = yz i + xz j + (xy...
Consider F and C below. F(x, y, z) = yz i + xz j + (xy + 18z) k C is the line segment from (1, 0, −3) to (4, 4, 1) (a) Find a function f such that F = ∇f. f(x, y, z) = (b) Use part (a) to evaluate C ∇f · dr along the given curve C.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT