(R20CSE3202) Compiler Design: Question Bank With Blooms Taxonomy Level (BTL)
(R20CSE3202) Compiler Design: Question Bank With Blooms Taxonomy Level (BTL)
(R20CSE3202)Compiler Design
QUESTION BANK WITH BLOOMS TAXONOMY LEVEL (BTL)
(1. Remembering 2. Understanding 3. Applying 4. Analyzing 5. Evaluating 6.
Creating)-Faculty Name- G.Manasa & V.Mounica
UNIT-I
UNIT-1 : Introduction to Compiler Design
Course
1MARK QUESTIONS BT Level Outcome
1. What is a Compiler? I CO1
2. Define Lexical Analysis? II CO1
3 Describe Interpreter? II CO1
4. List out the phases of compiler? I CO1
5 What is the difference between Pass and Phase? I CO1
6. Define the term Symbol table? II CO1
7. How do you define Context Free Grammar? I CO1
8. Write one difference between compiler and Interpreter? IV CO1
9. What is a Regular Grammar? I CO1
10 Define Finite Automata with 5 tuples?
I CO1
.
11 Define parse tree?
I CO1
.
12 What is the purpose of Bootstrap?
I CO1
.
5 MARKS QUESTIONS
1. Define compiler? State the various phases of compilers? II CO1
2. Explain the various phases of a compiler in detail? And also write down the output II
for the following for each phase? Position = initial + rate *50 CO1
8. Define Backtracking? Construct the parse tree for the String “accd” using I
backtracking and also explain the ambiguous grammar with example.? S->aAd/aB
CO2
A->b/c B->ccd/ddc
9. Define LL(1)? Construct the LL(1) parsing table for the following grammar? E-> VI
TE’ E’->+TE’/€ T->FT’
CO2
T’->*FT’/€ F->(E)/id
Write the output at all phases of the compiler for the above C code.
12 What are the problems associated with top down parsing? Briefly explain Left I
Recursion & Left factoring with a suitable example. CO2
.
Unit -II
1 MARK QUESTIONS
1. Specify the basic principle of Bottom up parser. IV CO3
2. Draw the structure of Bottom up parsing table. I CO3
3 Write different types of Bottom up parsing. I CO3
4. Differentiate between SLR and CLR. IV CO3
5 Give an example for handle. III CO3
6. Define handle pruning. I CO3
7. Which type of parsing table builds up by YACC parser generator? IV CO3
8. Differentiate LR(1) from LL(1) in one statement. IV CO3
9. How the LALR (1) differs from LR (1). IV CO3
10. When will the reduce action is taken up by the Shift-reduce parser. IV CO3
11. Define conflicts of bottom up parsing? I CO3
12. What is Left and Right Associativity Rule? I CO3
5 MARKS QUESTIONS
1 Distinguish between Top-Down Parsing Vs Bottom Up Parsing. IV CO3
3. What is Shift-Reduce parser and construct Shift Reduce Parser for the input IV CO3
string id*id+id by using the grammar. (Create)
E-> E+E E-> E*E E-> (E) |id
6. Construct the Canonical LR (CLR) parser for the following grammar? VI CO3
S CC C bC | d
7. Construct the Canonical LR (CLR) parser for the following grammar? VI CO3
S->AA A->aA A->b
8. Explain about error recovery in LR parsers. II CO3
9. Construct the parsing table of LALR(1) for the following grammar VI CO3
S->L=R | R
L->*R
R->L
11. Briefly explain about the Automatic Parser Generator – YACC. II CO3
12 Ambiguity in the LR parsing table w.r.to taking action is handled by using V CO3
Operator Precedence and Associativity principle – Justify.
Unit – III
1 MARK QUESTIONS
1. What is Syntax Directed Definition (SDD). I CO4
11 POSIX is the technique used to represent the intermediate code - Justify. V CO4
12 Develop three address code for the expression a+b*c – d /e. VI CO4
5 MARKS QUESTIONS
1. Explain the role of Semantic Analyzer in compilation with an example. II CO4
2 What is difference between Semantic and Syntax analysis? I CO4
3. Construct the syntax tree for the grammar given using Syntax Directed VI CO4
Translation. E E+TEE*T ET T(E) Tid Tnum
4 Write an S-attributed grammar to connect the following grammar with prefix IV CO4
rotator.
L E E E+T|E-T|T T T*F|T/F|F
F P ↑ P|P P (E)
P id
6 What is an Abstract Syntax Tree. Give the procedure for constructing syntax I CO
tree for an expression with suitable example.
7 What is an intermediate code form and briefly explain about three address II CO4
codes.
8 Distinguish between static and dynamic storage allocation? II CO4
10 What is an intermediate code form and briefly explain about three address II CO4
codes.
11 Differentiate Block structures and Non Block structures storage allocations II CO4
12 Convert the arithmetic expression b*3*(a+b) into syntax tree and three III CO4
address code.
UNIT-IV
10. Mention the issues to be considered while applying the techniques for code II CO5
optimization?
5 MARKS QUESTIONS
1. What is the necessity of code optimization and how it can be organized? II CO5
2. What is a basic block and explain the construction of basic blocks for the II CO5
given code with an example?
3. What is local optimization and explain about Common Sub Expression II CO5
Elimination and Copy Propagation.
4. What is loop optimization and explain about loop unrolling and strength II CO5
reduction.
5. What is local optimization and explain about Dead Code Elimination and VI CO5
Constant Folding.
6. Explain about global optimization with control flow and data flow IV CO5
analysis?
7. What is a Flow Graph and explain about Reducible and Non-Reducible IV CO5
flow graphs.
8 What is DAG and explain the process of constructing the DAG with an II CO5
example.
10 Explain about common sub Expression elimination, copy Propagation and II CO5
Induction variable elimination through DAG.
Unit-V:
1 MARK QUESTIONS
1. Explain about machine independent and machine dependent CO6
optimization? I
3. Explain the instructions and address modes of the target machine? II CO6
4. Show the code sequence generated by the simple code generation III CO6
algorithm?
u = a-c v = t+u d = v + u/d
6. Generate the code for x=x+1 for the target machine? II CO6
4 What is machine dependent code optimization and list out various IV CO6
techniques in it.
5. What is an object mode. Explain about various object code forms. IV CO6
6. Briefly explain the strategies available for register allocation and II CO6
assignment.
10 How is object code different from intermediate code generation? What II CO6
are the factors to be considered in object code generation? Explain.
(Understand)