Kcs502 Compiler Design 23
Kcs502 Compiler Design 23
BTECH
(SEM V) THEORY EXAMINATION 2023-24
COMPILER DESIGN
TIME: 3 HRS M.MARKS: 100
Note: 1. Attempt all Sections. If require any missing data; then choose suitably.
SECTION A
1. Attempt all questions in brief. 2 x 10 = 20
Q no. Question Marks CO
a. Define bootstrapping in the context of compilers. 2 1
b. Which phase of compiler is optional and why? 2 1
c. Explain the concept of shift-reduce parsing. 2 2
d. Differentiate Parse tree and Syntax tree with an example. 2 2
e. Define syntax-directed translation schemes. 2 3
f. What are the two types of attributes that are associated with a grammar 2 3
symbol?
g. Discuss how scope information is represented in a symbol table. 2 4
h. What is mean by Activation record? 2 4
i. Discuss two design issues in code generation. 2 5
90
1
j. Explain the concept of global data-flow analysis. 2 5
13
_2
2.
SECTION B
P1
24
2. Attempt any three of the following: 10x3=30
a. Describe the relationship between finite state machines and regular 10 1
4D
5.
expressions. Discuss how regular expressions are used in lexical analysis
.5
P2
|1
support optimization.
:2
program execution. Explain how it is used for storing local variables and
4
SECTION C
|2
1|Page
QP24DP1_290 | 24-01-2024 13:27:35 | 117.55.242.131
Downloaded from: uptukhabar.net
Printed Page: 2 of 2
Subject Code: KCS502
0Roll No: 0 0 0 0 0 0 0 0 0 0 0 0 0
BTECH
(SEM V) THEORY EXAMINATION 2023-24
COMPILER DESIGN
TIME: 3 HRS M.MARKS: 100
1
13
E→id
_2
2.
P1
arithmetic expressions.
24
4D
5.
6. Attempt any one part of the following: 10x1=10
.5
P2
a. Define Symbol table? Explain about the data structures used for symbol 10 4
17
table.
Q
1. x = a + b
2. y = x * c
4
02
3. z = y – d
Apply common sub expression elimination to optimize the basic block.
-2
basic block:
4-
1. x = a + b
|2
2. y = c - d
3. z = x * y
2|Page
QP24DP1_290 | 24-01-2024 13:27:35 | 117.55.242.131
Downloaded from: uptukhabar.net