Compiler Design UTU QUESTION PAPER (2021-22)
Compiler Design UTU PREVIOUS YEAR QUESTION PAPER
Even Semester Examination, 2021-22
Course Name: B.TECH
Branch: CS
Semester: VI
Subject: Compiler Design
Time: 3 Hours
Max Marks: 100
Number of Printed pages: 2
Note: Attempt all questions: All Questions carry equal marks
Q1. Attempt any four parts of the following (5 x 4 = 20)
(a) Define compiler with some construction tools
(b) Differentiate between compiler and interpreter.
(c) Summarize function of preprocessor?
(d) What is lexical analysis discuss the design of a lexical analyzer generator?
(e) Explain LEX compiler
Q2. Attempt any four parts of the following (5 x 4 = 20)
(a) Define Context Free Grammar with example.
(b) Define parser, with its advantages and disadvantages.
(c) What is meant by syntax tree? Explain the construction of syntax tree with an example?
(d) Explain Top Down parsing and compare it with Bottom Up parsing
(e) What are S-attributed and L-attributed definition?
Q3. Attempt any two parts of the following (10 x 2 = 20)
(a) Describe the Error recovery scheme in YACC
(b) What is Code Optimization? Mention the criteria for achieving machine independent optimization.
(c) Design LL(1) parsing table for following:
A→ AcB/cC/C
B→bB/id
C→ CaB/BbB/B
Q4. Attempt any two parts of the following: (10 x 2 = 20)
(a) Draw NFA for the regular expression ab* | ab
(b) Construct the minimised DFA for the regular expression (0+1)*(0+1) 10.
(c) Construct and explain the DAG for the following basic block.
d: b c
e:= a+b
b: b*c
a:-e-d.
Q5. Attempt any two parts of the following: (10 x 2 = 20)
(a) Explain formal grammar with suitable example.
(b) Write short note on LALR and SLR parsing tables.
(c) Explain symbol table with proper examples.
0 Comments