GATEverse
← GATE CSE 1994

Q23

NATMarks unknown

Suppose we have a computer with single register and only three instructions given below:

LOAD addren; load register; from addrenSTORE addren; store register; at addrenADD addren; add register to; contents of addren; and place the result; in the register\begin{array}{ll} \text{LOAD addren} & \text{; load register} \\ \text{} & \text{; from addren}\\ \text{STORE addren} & \text{; store register}\\ \text{} & \text{; at addren}\\ \text{ADD addren} & \text{; add register to}\\ \text{} & \text{; contents of addren}\\ \text{} & \text{; and place the result}\\ \text{} & \text{; in the register}\\ \end{array}

Consider the following grammar: A→id:=EA \rightarrow id : =E E→E+T∣TE \rightarrow E+T\mid T T→(E)∣idT \rightarrow (E)\mid id Write a syntax directed translation to generate code using this grammar for the computer described above.

Sign in to save attempts.

Loading…