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.