0% found this document useful (0 votes)
103 views10 pages

(R20CSE3202) Compiler Design: Question Bank With Blooms Taxonomy Level (BTL)

Uploaded by

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

(R20CSE3202) Compiler Design: Question Bank With Blooms Taxonomy Level (BTL)

Uploaded by

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

DEPA

RTMENT OF COMPUTER SCIENCE AND ENGINEERING

(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

3 Define Lex tool? Explain the general format of a Lex Program? II


CO1
4. Define about Finite Automata and their types of Finite Automata with an example? II CO1
5 Write the rules for constructing First and Follow functions with example? I CO2
6. Construct Finite Automata for the regular Expression (a+b)*abb* VI CO2
7. Write the Recursive Descent parsing for the following gramma And draw the parse II
tree for input string : w=id*(id+id)?
CO2
EE+E/T T->T*F/F F->(E)/id

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

10 What are the major Data Structures of Compilation? Explain in detail? I


CO1
.
11 Consider the following fragment of a C code III
. float i,j; i= i*70+j+2; CO1

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

2. Construct the LR (0) parser for the following grammar? VI CO3


S CC C bC | d

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

4. Why we need LR parser and explain the working of LR parser. II CO3


5. Explain the working of SLR parser? construct SLR Parsing table for the III CO3
following grammar(Apply)
E-> E+T/T T-> T*F/F F-> (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

10. Distinguish between LR, CLR and LALR parsers. IV CO3

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

2. How an Intermediate Code gets generated. II CO4

3 What is an Annotated Tree? I CO4


4. How Synthesized Attribute differs from Inherited Attribute. IV CO4

5 Define synthesized Attribute. I CO4

6 Give an example for Abstract Syntax Tree. III CO4

7 Define Inherited Attribute. I CO

8 Give an example for Semantic checks. III CO4

9 Give an example for S-attributed and L-attributed grammar. III CO4

10 Define types of Storage Allocation strategies. 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+TEE*T ET T(E) Tid Tnum

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

5. Check whether the given SDD is L-attributed or Not. V CO4


A PQ P.in:= p(A.in) Q.in:= q(P.in)
A.sy:= f(Q.sy)
AXY Y.in:= y(A.in) X.in:= x(Y.in)
A.sy:=f(X.sy)

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

9 Explain organization for block structure Languages? 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

1. Define code Optimization? II CO5

2. Define common sub expression? II CO5

3. Explain Dead code? II CO5

4. Differentiate Machine independent and machine dependent optimization? I CO5

5. Explain about Loop optimization? II CO5

6. Differentiate local and global optimization? I CO5

7. Define constant folding? II CO5

8. Define flow graph? II CO5

9. Define DAG? II CO5

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.

9 Explain live variable analysis algorithm with example? II CO5

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

2. Explain the role of code generator in a compiler? II CO6

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

5. Mention the properties that a code generator should process. IV CO6

6. Generate the code for x=x+1 for the target machine? II CO6

7. Explain relocatable machine code? II CO6

8. List out the characteristics of peephole optimization? II CO6

9. Define linker and loader? II CO6

10. Explain about Top down parsing? II CO6


5 MARKS QUESTIONS
1. Explain the issues in the design of a code generator. II CO6

2. What is an addressing mode? Explain about various addressing modes. II CO6

3. Explain about peep hole optimization. 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.

7. Explain three peephole optimization with suitable example? II CO6


8 Generate the code for the following c statement? VI CO6
i) X= f(a) + f(a) +f(a)
ii) X= f(a)/g(b,c)
iii) X= f(f(a))
iv) X= ++ f(a)

9 Generate the code for the following statements? VI CO6


i) x=a[i] +1
ii) a[i]= b[c[i]]
iii) a[i][j]=b[i][k]*c[k][j]
iv) a[i]=a[i]+b[j]

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)

You might also like