Question - Bank - Complier Design
Question - Bank - Complier Design
Question Bank
Year: 2024-2025
Sr. Questions Marks
No.
UNIT 1 - (CO1)
1 What is the difference between compiler and interpreter? 3
2 Explain analysis phase of the source program with example 4
3 What is a pass in a compiler? What is the effect of reducing the number 3
of passes?
4 Explain buffer pairs and sentinels. 4
5 Translate the arithmetic expression a*-(b+c) into 1. Syntax tree 2. Postfix 3
notation 3. Three address code
6 List the cousins of compiler and explain the role of any one of them. 3
UNIT 2 - (CO1)
1 Write an algorithm for Thompson’s construction method. Apply the algorithm 7
to construct NFA for following regular expression. (a | b)*abb.
1 Define handle and handle pruning. Explain the stack implementation of shift 7
reduce parser with the help of example.
2 Give the translation scheme that converts infix to postfix notation. 3
Generate the annotated parse tree for input string 3-5+4. 7
3 Check given grammar is LL(1) but not SLR(1). S -> 7
AaAb | BbBa
A -> € B -> €
4 What is left factoring and left recursion? Explain it with suitable example. 7
7 List the different issues in code generation phase and describe any two issue 3
8 Draw syntax tree and DAG for the statement 3
x=(a+b)*(a+b+c)*(a+b+c+d) 4
Draw a DAG for expression: a + a * (b – c) + (b – c) * d. 4
Or 4
d: = b * c
e: = a + b
b: = b * c a: = e -d
9 Explain dynamic memory allocation strategy. OR 4
Compare: Static v/s Dynamic Memory Allocation. 4
10 Write difference(s) between stack and heap memory allocation 3
11 Write a grammar to declare variables with data type int or float or char. Also 7
develop a syntax directed definition for that. Draw the dependency graph for
same
12 Discuss various Storage allocation strategies in detail. 7