CSC376 · TU past paper
Compiler Design and Construction 2076 question paper
The complete TU 2076 exam paper for Compiler Design and Construction (CSC376), all 10 questions with solved model answers written to the mark scheme.
Tap a question to open its answer.
- Q1.6 marksCompiler StructureHideAnswer
Explain briefly about different phases involved in compiler, with a block diagram[6]
- Q2.6 marksNumericalFinite Automata relevant to compiler constHideAnswer
Given a regular expression (ε+0)∗10(\varepsilon + 0)^* 10(ε+0)∗10. Construct the DFA recognizing the pattern described by this regular expression using syntax tree based reduction.[6]
- Q3.6 marksNumericalBottom-up parsingHideAnswer
What is shift reduce parsing techniques? Show shift reduce parsing action for the string (x+x)*a, given the grammar[6]
- Q4.6 marksNumericalLR parsingHideAnswer
Construct SLR parsing table for the following grammar.S→aAa∣bAb∣baS \rightarrow aAa | bAb | baS→aAa∣bAb∣ba[6]
- Q5.6 marksNumericalAnnotated Parse TreeHideAnswer
Syntax Directed Definition and Annotated Parse Tree
- Q6.6 marksType Checking and ConversionHideAnswer
Write Syntax Directed Definition to carry out type checking for the following expression.E→id∣E1 op E2∣E1 relop E2∣E1[E2]∣E1↑E \rightarrow id | E1 \text{ op } E2 | E1 \text{ relop } E2 | E1[E2] | E1↑E→id∣E1 op E2∣E1 relop E2∣E1[E2]∣E1↑[6]
- Q7.6 marksIntermediate Code GeneratorHideAnswer
Explain with example about different methods of intermediate code representation.[6]
- Q8.6 marksCode OptimizationHideAnswer
What is the purpose of code optimization? Explain different types of loop optimization techniques with example.[6]
- Q9.6 marksCode GeneratorHideAnswer
Discuss about the different factors affecting target code generation.[6]
- Q10.6 marksBasic concepts related to Compiler such asHideAnswer
Discuss the importance of error handler in compiler. How is it manipulated in the different phases of compilation?[6]