GATEverse Practice, past papers & mock tests
GATE 2019
Compiler DesignSyntax Directed TranslationmediumMCQ2 marks

Consider the following grammar and semantic actions to support inherited type declaration attributes:

GRAMMAR RULES
DT L { X1.type = X2.type }
Tint { T.type = int }
Tfloat { T.type = float }
LL1, id { X3.type = X4.type; add_type(id.entry, X5.type) }
Lid { add_type(id.entry, X6.type) }

Which one of the following are the appropriate choices for (X1, X2, X3, X4)?

Save your progress

Related Compiler Design PYQs