GATE Compiler Design: Syntax-Directed Translation – Previous Year Questions
10 GATE previous year questions on Syntax-Directed Translation (Compiler Design, Computer Science) with answers and explanations, from every paper.
- GATE 2016 CS Q56 – Consider the following Syntax Directed Translation Scheme (SDTS), with non-terminals \S, A\ and terminals \a, b\. S aA print 1 S a print 2 A Sb print…
- GATE 2019 CS Q46 – Consider the following grammar and the semantic actions to support the inherited type declaration attributes. Let X 1, X 2, X 3, X 4, X 5, and X 6 be…
- GATE 2026 CS (CS1) Q53 – Consider the following two syntax-directed definitions SDD1 and SDD2 for type declarations: **SDD1**: - D T \, V \ D.type = T.type; \; V.type =…
- GATE 2025 CS (CS2) Q22 – Given the following syntax directed translation rules: Rule 1: R AB\ \B.i = R.i - 1;\ A.i = B.i;\ R.i = A.i + 1;\ Rule 2: P CD\ \P.i = C.i + D.i;\ D.i…
- GATE 2024 CS (CS2) Q29 – Which of the following statements is/are FALSE?
- GATE 2024 CS (CS1) Q37 – Consider the SDD: S→DHTU S.val=D.val+H.val+T.val+U.val; D→"M"D1 D.val=5+D1.val; D→ε D.val=−5; H→"L"H1 H.val=5*10+H1.val; H→ε H.val=−10; T→"C"T1…
- GATE 2023 CS Q60 – Consider the syntax directed translation given by the following grammar and semantic rules. Here N, I, F and B are non-terminals. N is the starting…
- GATE 2022 CS Q65 – Consider the following grammar along with translation rules. S S 1\ \#\ T\S.val=S 1.val * T.val\ S T\S.val=T.val\ T T 1\ \%\ R\T.val=T 1.val R.val\ T…
- GATE 2021 CS Q36 – Consider the following grammar (that admits a series of declarations, followed by expressions) and the associated syntax directed translation (SDT)…
- GATE 2020 CS Q43 – Consider the productions A → PQ and A → XY. Each of the five non-terminals A, P, Q, X, and Y has two attributes: s is a synthesized attribute, and i…