GATE 2026 CS1 Q.53
Consider the following two syntax-directed definitions SDD1 and SDD2 for type declarations.
SDD1, grammar G1 and semantic rules:
- : ;
- :
- :
- : ;
- :
SDD2, grammar G2 and semantic rules:
- : ;
- : ;
- :
- :
is the start symbol, and int, float and id are the three terminals. The non-terminal is the same as and the non-terminal is the same as . Here, the subscript is used to differentiate the grammar symbols on the two sides of a production. The function put updates the symbol table with the type information for an identifier.
Let P and Q be the languages specified by grammars G1 and G2, respectively.
Which of the following statements is/are true?
Tap to open full sizeFigure description
Two side-by-side tables titled SDD1 and SDD2, each with columns Grammar (G1 or G2) and Semantic Rules, listing the productions and semantic rules given in the stem.
- (A)
The languages P and Q are the same
- (B)
SDD2 is S-attributed and contains only synthesized attributes
- (C)
SDD1 is L-attributed and contains only inherited attributes
- (D)
The specifications of SDD1 and SDD2 are such that the same entries get added to the symbol table





