The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+4 votes
381 views
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:
$$\begin{array}{ll} \text{$A \rightarrow id : =E$}  &&  \text{$E \rightarrow E+T\mid T$} && \text{$T \rightarrow (E)\mid id$}\\  \end{array}$$
Write a syntax directed translation to generate code using this grammar for the computer described above.
asked in Compiler Design by Veteran (59.9k points)
edited ago by | 381 views

Please log in or register to answer this question.

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,430 questions
53,616 answers
185,968 comments
70,892 users