GATE CS 2026 (Forenoon) — Question 53

Compiler DesignSyntax-Directed Translation & Runtime EnvironmentsMSQ2 marksMedium

Consider the following two syntax-directed definitions SDD1 and SDD2 for type declarations.
Question image
\( D \) is the start symbol, and int, float and id are the three terminals. The non-terminal \( V_1 \) is the same as \( V \) and the non-terminal \( D_1 \) is the same as \( D \). 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?
  1. A
    The languages \( P \) and \( Q \) are the same
  2. B
    SDD2 is S-attributed and contains only synthesized attributes
  3. C
    SDD1 is L-attributed and contains only inherited attributes
  4. D
    The specifications of SDD1 and SDD2 are such that the same entries get added to the symbol table
Practise the full 2026-FN paper
Challenge a friend: WhatsApp Telegram
From RENYXERAWhat rank do your marks get?GATE score, likely All-India Rank and qualifying marks for your category.
Practise more on Syntax-Directed Translation & Runtime EnvironmentsTimed, in the real exam interface · free to start

A GATE question every morning

One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.

Join
Stuck? Ask in the student group