Syntax Directed Translation
Study notes are awaiting editorial approval. You can still practise the reviewed questions below.
Related previous-year questions
Practise this topic- 2026 · Consider the following two syntax-directed definitions SDD1 and SDD2 for type declarations. $D$ is the start symbol, and $int$, $float$ and $id$ are
- 2025 · 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 \rightarr
- 2024 · Which of the following statements is/are FALSE?
- 2024 · Consider the following syntax-directed definition (SDD). $S \to DHTU \{ S.val = D.val + H.val + T.val + U.val; \}$ $D \to \text{"M"}D_1 \{ D.val = 5 +
- 2023 · 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 start
- 2022 · Consider the following grammar along with translation rules. $$S \to S_1 \# T \quad \{S_{\text{val}} = S_{1\text{val}} * T_{\text{val}}\}$$ $$S \to T
- 2021 · Consider the following grammar (that admits a series of declarations, followed by expressions) and the associated syntax directed translation (SDT) ac
- 2020 · Consider the productions $A \rightarrow PQ$ and $A \rightarrow XY$. Each of the five non-terminals A, P, Q, X, and Y has two attributes: $s$ is a synt
- 2019 · 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$
- 2016 · Consider the following Syntax Directed Translation Scheme (SDTS), with non-terminals {S, A} and terminals {a, b}. $S \to aA \{ \text{print } 1 \}$ $S