Compiler Design
GATE CSE & IT · Compiler Design - Syntax Directed Translation · 1998-2025
Study anchor
Source-book anchor pending for this concept.
Practice action
Start latest PYQPYQs in this concept
All concepts →Which ONE of the following statements is FALSE regarding the symbol table?
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 = C.i + 2; } Rule 3: Q → EF {...
Which of the following statement(s) is/are TRUE while computing First and Follow during top down parsing by a compiler?
Consider two grammars G₁ and G₂ with the production rules given below: G₁: S → if E then S | if E then S else S | a E → b G₂: S → if E then S | M M → if E then M else S | c E → b w...
Refer to the given 3-address code sequence. This code sequence is split into basic blocks. The number of basic blocks is ________. (Answer in integer) 1001: i = 1 1002: j = 1 1003:...
Which of the following statement(s) is/are TRUE while computing First and Follow during top down parsing by a compiler?
Consider the following two sets: Set X P. Lexical Analyzer Q. Syntax Analyzer R. Intermediate Code Generator S. Code Optimizer Set Y 1. Abstract Syntax Tree 2. Token 3. Parse Tree...
Which of the following statements is/are FALSE?
Consider the following syntax-directed definition (SDD). S → DHTU { S.val = D.val + H.val + T.val + U.val; } D → "M"D₁ { D.val = 5 + D₁.val; } D → ε { D.val = -5; } H → "L"H₁ { H.v...
Consider the following pseudo-code. L1: t1 = -1 L2: t2 = 0 L3: t3 = 0 L4: t4 = 4 * t3 L5: t5 = 4 * t2 L6: t6 = t5 * M L7: t7 = t4 + t6 L8: t8 = a[t7] L9: if t8 <= max goto L11 L10:...
Consider the following context-free grammar where the start symbol is S and the set of terminals is {a,b,c,d}. S → AaAb | BbBa A → cS | ε B → dS | ε The following is a partially-fi...
Consider the following expression: x[i] = (p + r) * -s[i] + u/w. The following sequence shows the list of triples representing the given expression, with entries missing for triple...
Which of the following is/are Bottom-Up Parser(s)?
Consider the following expression: $x[i] = (p + r) * -s[i] + \frac{u}{w}$. The following sequence shows the list of triples representing the given expression, with entries missing...
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 non-terminal, and #, 0 and 1 are...
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 the placeholders for the n...
Consider the augmented grammar given below : S' → S S → 〈L〉 | id L → L,S | S Let I 0 = CLOSURE ({[S' → ●S]}). The number of items in the set GOTO (I 0 , 〈 ) is: _____.
Consider the following expression grammar G: E -> E - T | T T -> T + F | F F -> (E) | id Which of the following grammars is not left recursive, but is equivalent to G?
Consider the intermediate code given below. (1) i = 1 (2) j = 1 (3) t1 = 5 ∗ i (4) t2 = t1 + j (5) t3 = 4 ∗ t2 (6) t4 = t3 (7) a[t4] = -1 (8) j = j + 1 (9) if j<=5 goto (3) (10) i=...
Which of the following statements are CORRECT? 1) Static allocation of all data areas by a compiler makes it impossible to implement recursion. 2) Automatic garbage collection is e...
In a compiler, keywords of a language are recognized during
Which data structure in a compiler is used for managing information about variables and their attributes?
Some code optimizations are carried out on the intermediate code because
Consider the following grammar. $$\eqalign{ & S \to S*E \cr & S \to E \cr & E \to F + E \cr & E \to F \cr & F \to id \cr} $$ Consider the following LR(0) items corresponding to the...
Which of the following statements is true?