GATE CSE 2025 Session 2 Q22: Classify three SDT rules as S-attributed or L-attributed
- Compiler Design
- 1 mark
- MCQ
- −1/3 if wrong
Question
Given the following syntax directed translation rules:
Rule 1:
Rule 2:
Rule 3:
Which ONE is the CORRECT option among the following?
Try it: multiple choice: exactly one correct option
Show answer and explanation
Answer: C (official GATE 2025 final answer key)
Concept used: S-attributed: only synthesized attributes. L-attributed: inherited attributes may depend only on the parent and siblings to the left.
First step: In Rule 1, makes depend on its right sibling; in Rule 2, is inherited from the left sibling .
Full step-by-step solution
Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.
Share this question
Source: official GATE 2025 Session 2 CS question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key
More Compiler Design PYQs
- 2026 Session 1 · Q27Classify errors in three C string declarations
- 2026 Session 1 · Q28True statements about LL(1) parsing
- 2026 Session 1 · Q42Redundant (common) subexpressions in blocks B4 and B5 of a CFG
- 2026 Session 1 · Q53Compare two SDDs for type declarations
- 2026 Session 2 · Q35Count tokens produced by a lexer for a given string
- 2026 Session 2 · Q41Shift-reduce conflicts in the LR(0) table of a grammar