Consider the grammar rule E → E1 - E2 for arith­metic expressions. The code…

PYQ GATE 2004

Consider the grammar rule E → E1 - E2 for arith­metic expressions. The code generated is targeted to a CPU having a single user register. The sub­traction operation requires the first operand to be in the register. If E1 and E2 do not have any com­mon sub expression, in order to get the shortest possible code

  1. A.

    E1 should be evaluated first

  2. B.

    E2 should be evaluated first

  3. C.

    Evaluation of E1 and E2 should necessarily be interleaved

  4. D.

    Order of evaluation of E1 and E2 is of no consequence

Attempted by 126 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…