0% found this document useful (0 votes)
18 views2 pages

Dr. Rajesh Tewari: B.Tech. (Vi-Semester) Theory Examination 2017-18 Compiler Design 2

The document is a compiler design exam paper containing 7 sections with multiple choice and long answer questions. It tests knowledge of compiler design topics like parsing, symbol tables, code generation and optimization techniques. The paper contains instructions for students and evaluates knowledge of concepts like bootstrapping, regular expressions, syntax analysis, parsing algorithms and code improvement strategies.

Uploaded by

Priyanshu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views2 pages

Dr. Rajesh Tewari: B.Tech. (Vi-Semester) Theory Examination 2017-18 Compiler Design 2

The document is a compiler design exam paper containing 7 sections with multiple choice and long answer questions. It tests knowledge of compiler design topics like parsing, symbol tables, code generation and optimization techniques. The paper contains instructions for students and evaluates knowledge of concepts like bootstrapping, regular expressions, syntax analysis, parsing algorithms and code improvement strategies.

Uploaded by

Priyanshu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Printed Pages:02 Sub Code: NCS603

Paper Id: 110252 Roll No.

B.TECH.
(VI-SEMESTER) THEORY EXAMINATION 2017-18
COMPILER DESIGN
Time: 3 Hours Total Marks: 100
Note: 1. Attempt all Sections. If require any missing data; then choose suitably.
2. Any special paper specific instruction.

SECTION A

1. Attempt all questions in brief. 2 x10 = 20


a. What is Bootstrapping?
i
ar
b. What is Code Generator?

0
c. What is YACC & LEX tools?
w

.3
Te

d. Define Regular Expression using suitable example.

98
e. Explain Error detection in Symbol Table.
h

.1
f. Explain Back patching using suitable example.
es

.5
g. What is DAG?
aj

h.
39
What is the difference between Syntax Analyzer & Symantec Analyzer?
R

i. What is Data Flow Analysis?


|1
r.

j. Explain the difference between Top Down Parsing & Bottom Up Parsing.
D

6
:1

SECTION B
: 51

2. Attempt any three of the following: 10 x 3 = 30


13

a. What are the Phases and Passes of compiler? Explain the function of each
9

Phases briefly.
1

b. Explain LR(0) parsing Algorithm using suitable example.


20

c. Define a SDT to generate Three Address Code.


-
ay

d. What is role of Symbol Table? Discuss Data Structures used for Symbol Table.
e. Construct the DAG for the expression:
M

a+a*(b-c)+(b-c)*d+ e+e*(f-g)+(f-g)*h
4-
|1

SECTION C
3. Attempt any one part of the following: 10 x 1 = 10
(a) i) Remove left factoring of the following grammar:
S→aAB | aA | aAC
ii) Remove left Recursion of the following grammar:
S→Ab | B, A→Ac | Sb | ε
(b) i) Explain the role of precedence & associativity for the conversion of
ambiguous grammar to unambiguous grammar.

Dr. Rajesh Tewari | 14-May-2019 13:51:16 | 139.5.198.30


ii) Find out the FIRST() & FOLLOW() of the following grammar:
S → aBDh
B → cC
C → bC | ε
D → EF
E→g|ε
F→f|ε

P.T.O
4. Attempt any one part of the following: 10 x 1 = 10
(a) Check that the following grammar is LR(1) or LALR(1) or not by using their
table:
S → Aa | bAc | Bc | bBa
A→d
B→d
(b) Explain Recursive Descent Parsing using one suitable example. How it differ
from Operator Precedence Parsing.
5. Attempt any one part of the following: 10 x 1 = 10
(a) Consider the following three address code segment:
1. If i ≤ 10 goto 3
2. goto 7
i
ar
3. t1 = j * 4

0
w
4. t2 = t1 + 10

.3
Te

5. a = t2

98
6. j = j + 1
h

.1
7. stop
es

.5
find the basic block & flow graph of above sequence.
aj

39
(b) Generate Three Address Code,Quadraple,Triple & Indirect Triple for the
R

following statement: -(a+b)*(c+d)+(a+b+c)


|1
r.

6. Attempt any one part of the following: 10 x 1 = 10


D

(a) What are lexical phase errors, syntactic phase errors & semantic phase errors?
:1

Explain with suitable example.


51

(b) Explain Storage allocation Strategies in Runtime Environment.


:

7. Attempt any one part of the following: 10 x 1 = 10


13

(a) Explain different type of Loop Optimization Technique briefly.


9

(b) Write short note on :


1
20

i) Global Data Flow Analysis


ii) Peephole Optimization
-
ay
M
4-
|1

Dr. Rajesh Tewari | 14-May-2019 13:51:16 | 139.5.198.30

You might also like