recategorized by
1,002 views
5 votes
5 votes

Suppose we have a computer with single register and only three instructions given below:
$$\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 \rightarrow id : =E$
  • $E \rightarrow E+T\mid T$
  • $T \rightarrow (E)\mid id$

 Write a syntax directed translation to generate code using this grammar for the computer described above.

recategorized by

Please log in or register to answer this question.

Related questions

16 votes
16 votes
3 answers
2