Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Compiler Design

2nd Internal Examination B. Tech CSE (6th SEM)

Marks: 100

Time: 3 Hours

Total Marks: 100

Q.No.1 Attempt any FOUR parts: (5*4)

(a) What is compiler? Compared it with Q.No.3Attempt any two parts: (2*10)
interpreter. Discuss the different phases of
compiler. (a) Describe syntax directed translation. How
synthesized and inherited attribute can be
(b) Describe the process of bootstrapping. What represented?
is the role of cross compiler in it?
(b) What data structure is used for representing
(c) Discuss the term Ambiguity with a suitable three address codes?
example. (c)Write quadruple, triple and indirect for
(d) What is the role of LEX and YACC expression.
compiler? - (a + b) * (c + d) - (a + b+ c)
(e)Describe finite Automata. Write some Q.N. (4) Attempt any two parts: (2*10)
properties for Regular expression
(a) Construct LALR parsing table for following
Qno.2 Attempt any FOUR parts: (5*4) grammar with A as a starting symbol.

(a)Write a short note on parsing. Explain the ABrC /CpBa Cw Bq
term Backtracking and predictive top down (b) What is the role of Symbol table in
parser. compiler? Write different data structure for
(b) Check this grammar is LL (1) or not? creating symbol table.

EE+T/T TT*F/F (c) Explain Error detection and recovery with


respect to all phases of compiler.
F (E)/id
Q.No.5 Attempt any two parts: (2*10)
(c) Write a stack implementation of shift reduce
parser. Why we use handle in it? (a) Write a three address code for a given
program. While (a>b or b<c and a>20) do
(d)Discuss operator precedence parser? Create a
precedence relation table for id+id*id. If(d>20 or not b>c) Then a=a+b

(e)Write an algorithm for CLR(1) parsing table? Else do b=b-20 while(x>y and y>z)
(b)What is code optimization? Explain DAG (c)How loop optimization can be done in code
representation of basic block? optimization?

Compiler Design
2nd Internal Examination B. Tech CSE (6th SEM)

Marks: 100

Time: 3 Hours

Total Marks: 100

Q.No.1 Attempt any FOUR parts: (5*4) (e) Write a short note on parsing. Explain the
term Backtracking and predictive top down
(a) Write a stack implementation of shift reduce parser.
parser. Why we use handle in it?
(b) What is compiler? Compared it with
interpreter. Discuss the different phases of Q.No.3Attempt any two parts: (2*10)
compiler.
(a)Describe syntax directed translation. How
(c)Write an algorithm for CLR(1) parsing table? synthesized and inherited attribute can be
represented?
(d) Discuss the term Ambiguity with a suitable
example. (b) What data structure is used for representing
(e)Describe finite Automata. Write some three address codes?
properties for Regular expression (c)Write quadruple, triple and indirect for
Qno.2 Attempt any FOUR parts: (5*4) expression.
- (a + b) * (c + d) - (a + b+ c)
(a) Describe the process of bootstrapping. What
is the role of cross compiler in it? (b) Check this Q.N. (4) Attempt any two parts: (2*10)
grammar is LL (1) or not?
(a) Write a three address code for a given
EE+T/T TT*F/F program. While (a>b or b<c and a>20) do
F (E)/id If(d>20 or not b>c) Then a=a+b
(c) What is the role of LEX and YACC Else do b=b-20 while(x>y and y>z)
compiler?
(b)What is code optimization? Explain DAG
(d)Discuss operator precedence parser? Create a representation of basic block?
precedence relation table for id+id*id.
(c)How loop optimization can be done in code
optimization?
Q.No.5 Attempt any two parts: (2*10)
(a) Construct LALR parsing table for following
grammar with A as a starting symbol.
ABrC /CpBa Cw Bq
(b) What is the role of Symbol table in
compiler? Write different data structure for
creating symbol table.
(c) Explain Error detection and recovery with
respect to all phases of compiler.

You might also like