GATEverse
← GATE CSE 1996

Q20

NATMarks unknown

Consider the syntax-directed translation schema (SDTS) shown below: E→E+EE\rightarrow E + E {print “+”} E→E∗EE\rightarrow E * E {print “.”} E→idE\rightarrow id {print id.name} E→(E)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)(a+b)*(c+d), using SDTS given above.

Sign in to save attempts.

Loading…