GATE 2024 CS (CS2) – Question 29
Compiler Design · Syntax-Directed Translation · 1 mark · Multiple select
Which of the following statements is/are FALSE?
- An attribute grammar is a syntax-directed definition (SDD) in which the functions in the semantic rules have no side effects
- The attributes in a L-attributed definition cannot always be evaluated in a depth-first order
- Synthesized attributes can be evaluated by a bottom-up parser as the input is parsed
- 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.
More Syntax-Directed Translation questions
- GATE 2023 CS Q60 – Consider the syntax directed translation given by the following grammar and semantic…
- GATE 2022 CS Q65 – Consider the following grammar along with translation rules. S S 1\ \#\ T\S.val=S 1.val *…
- GATE 2021 CS (CS1) Q36 – Consider the following grammar (that admits a series of declarations, followed by…
- GATE 2020 CS Q43 – Consider the productions A → PQ and A → XY. Each of the five non-terminals A, P, Q, X, and…
- GATE 2019 CS Q46 – Consider the following grammar and the semantic actions to support the inherited type…
- GATE 2016 CS (CS1) Q56 – Consider the following Syntax Directed Translation Scheme (SDTS), with non-terminals \S,…
All Syntax-Directed Translation questions →