CS-603 · Compiler Design/Unsolved PYQ Paper
CS-603 Compiler Design - Dec 2024 Question Paper
-
8 MarksaWhat is a translator? Compare compiler and interpreter in terms of translation method, memory requirement and speed.
-
3 MarksbExplain LEX tool in brief.
-
3 MarkscWhat is left factoring in grammar? Explain with an example.
-
6 MarksaConsider the following grammar for list structures: $$S \rightarrow a / \wedge(T)$$ $$T \rightarrow T,S / S$$ Find left most derivation, right most derivation and parse tree for the string $(((a,a),\wedge(a)),a)$.
-
4 MarksbFor the following grammar find First and Follow sets for each of non-terminal. $$S \rightarrow aAB / bA / \varepsilon$$ $$A \rightarrow aAb / \varepsilon$$ $$B \rightarrow bB / \varepsilon$$
-
4 MarkscDescribe the following in brief. i) Ambiguity ii) Left recursion
-
8 MarksaWhat is parser? Explain backtracking and non-backtracking parsers with their types.
-
6 MarksbConsider the following grammar. $$E \rightarrow E + T$$ $$T \rightarrow TF / F$$ $$F \rightarrow F* / a / b$$ Construct the SLR Parsing table for this grammar.
-
8 MarksaDefine the following with an example. i) Synthesized attributes ii) Annotated parse tree iii) Dependency graph
-
6 MarksbGenerate the three address code for the following code segment: While (a < c and b < d) do If a = 1 then c = c + 1. Else While (a <= d) do a = a + 3
-
8 MarksaExplain various intermediate code generation techniques in brief.
-
6 MarksbConsider the grammar with the following translation rules and E as the start symbol. $$E \rightarrow E1 \# T \; \{E.value = E1.value * T.value\}$$ $$| T \; \{E.value = T.value\}$$ $$T \rightarrow T1 \& F \; \{T.value = T1.value + F.value\}$$ $$| F \; \{T.value = F.value\}$$ $$F \rightarrow num \; \{F.value = num.value\}$$ Compute E.value for the root of the parse tree for the expression. $$2 \ll 3 \& 5 \# 6 \& 4$$
-
6 MarksaWrite an algorithm to construct a DAG from a basic block.
-
8 MarksbWhat is S-attributed SDT & L-attributed SDT? Consider the following grammar and write the SDT rules for the given grammar. $$S \rightarrow S * A$$ $$S \rightarrow A$$ $$A \rightarrow A + B$$ $$B \rightarrow (S)$$ $$A \rightarrow B$$ $$B \rightarrow id$$
-
7 MarksaWrite the differences between Synthesized and inherited attributes.
-
7 MarksbExplain the common sub expression, elimination, copy propagation, and Transformation for moving loop invariant computations in detail.
-
4 MarksaWhat is Local transformation and Global transformation.
-
10 MarksbWhat are the 3 areas of code optimization? Explain each one in detail.
Go to where you left off?
Quick Add to Notes
Save questions, your own notes and screenshots into notes filed by unit. It takes a free account.
Create free accountHave an account? Log in
Notes Panel