3,453 views
18 votes
18 votes

Consider the syntax-directed translation schema (SDTS) shown below:

  • $E\rightarrow E + E$ {print “+”}
  • $E\rightarrow E * E$ {print “.”}
  • $E\rightarrow id$ {print id.name}
  • $E\rightarrow (E)$

An LR-parser executes the actions associated with the productions immediately after a reduction by the corresponding production. Draw the parse tree and write the translation for the sentence.

$(a+b)*(c+d)$, using SDTS given above.

2 Answers

Best answer
28 votes
28 votes

$\mathbf{ab+cd+.}$

edited by

Related questions

38 votes
38 votes
2 answers
4
Kathleen asked Oct 9, 2014
12,822 views
The pass numbers for each of the following activitiesobject code generationliterals added to literal tablelisting printedaddress resolution of local symbols that occur in...