Consider the following two syntax-directed definitions SDD1 and SDD2 for type…
GATE · 2026 · CS · Set 1 · Computer Science & IT
Consider the following two syntax-directed definitions SDD1 and SDD2 for type declarations.

𝐷 is the start symbol, and 𝑖𝑛𝑡, 𝑓𝑙𝑜𝑎𝑡 and 𝑖𝑑 are the three terminals. The non-terminal 𝑉1 is the same as 𝑉 and the non-terminal 𝐷1 is the same as 𝐷. Here, the subscript is used to differentiate the grammar symbols on the two sides of a production. The function 𝑝𝑢𝑡 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?
- 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
Attempted by 27 students.
Sign up free to check your answer
Sign up freeLoading lesson…