The GATE Grind

GATE 2024 CS (CS2) – Question 29

Compiler Design · Syntax-Directed Translation · 1 mark · Multiple select

Which of the following statements is/are FALSE?

  1. An attribute grammar is a syntax-directed definition (SDD) in which the functions in the semantic rules have no side effects
  2. The attributes in a L-attributed definition cannot always be evaluated in a depth-first order
  3. Synthesized attributes can be evaluated by a bottom-up parser as the input is parsed
  4. All L-attributed definitions based on LR(1) grammar can be evaluated using a bottom-up parsing strategy

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (B) The attributes in a L-attributed definition cannot always be evaluated in a depth-first order

Explanation

L-attributed definitions can always be evaluated in a depth-first (left-to-right) order, so B is false. A, C and D are standard true results.