GATE CS 2025 (Afternoon) — Question 22

Compiler DesignSyntax-Directed Translation & Runtime EnvironmentsMCQ1 mark · −1/3 if wrongMedium

Given the following syntax directed translation rules: Rule 1: \( R \rightarrow AB \{B.i = R.i - 1; A.i = B.i; R.i = A.i + 1;\} \) Rule 2: \( P \rightarrow CD \{P.i = C.i + D.i; D.i = C.i + 2\} \) Rule 3: \( Q \rightarrow EF \{Q.i = E.i + F.i;\} \) Which ONE is the CORRECT option among the following?
  1. A
    Rule 1 is S-attributed and L-attributed; Rule 2 is S-attributed and not L-attributed; Rule 3 is neither S-attributed nor L-attributed
  2. B
    Rule 1 is neither S-attributed nor L-attributed; Rule 2 is S-attributed and L-attributed; Rule 3 is S-attributed and L-attributed
  3. C
    Rule 1 is neither S-attributed nor L-attributed; Rule 2 is not S-attributed and is L-attributed; Rule 3 is S-attributed and L-attributed
  4. D
    Rule 1 is S-attributed and not L-attributed; Rule 2 is not S-attributed and is L-attributed; Rule 3 is S-attributed and L-attributed
Practise the full 2025-AN paper
Challenge a friend: WhatsApp Telegram
From RENYXERAThis week's 10-question challengeSame 10 past-GATE questions for everyone this week — see where you stand.
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