GATE | GATE CS 1996 | Question 68

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

E → E + E         {print “+”}
E → E ∗ E         {print “.”}
E → id            {print}
E → ( 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 the SDTS given above.



Quiz of this Question
Please comment below if you find anything wrong in the above post

My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.

Please write to us at to report any issue with the above content.