SAL EDUCATION CAMPUS
SAL INSTITUTE OF TECHNOLOGY AND ENGINEERING
RESEARCH
COMPUTER ENGINEERING DEPARTMENT
3170701 COMPILER DESIGN
ASSIGNMENT 1
Course Outcome: CO1
Issue Date:
Last Date of Submission:
Sr. Questions Marks
No.
1 Compare and contrast compilers and interpreters. 04
2 Explain phases of compilers with suitable example. 04
3 Define terms: pattern, lexeme, token 04
4 Write a brief note on input buffering techniques. 04
5 Explain the analysis synthesis model of compilation. List the factors 07
that affect the design of compiler. Also List major functions done by
compiler.
6 Explain front end and back end of compiler in detail. 07
Construct NFA for following regular expression using
7 Thompson’s notation and then convert it into DFA. (a/b)*abb# 07
Explain subset construction method with example.
8 07
Draw DFA for the following regular expression using
9 firstpos(), lastpos ( ) and followpos ( ) functions. ( a | b) * a 07
Subject Coordinator Signature:
SAL EDUCATION CAMPUS
SAL INSTITUTE OF TECHNOLOGY AND ENGINEERING
RESEARCH
COMPUTER ENGINEERING DEPARTMENT
3170701 COMPILER DESIGN
ASSIGNMENT 2
Course Outcome: CO2
Issue Date:
Last Date of Submission:
Sr. Questions Marks
No.
Differentiate Top Down Parsing and Bottom up parsing.
1 04
What is Ambiguous Grammar? Describe with example.
2 04
3 List the different conflicts that occur in Bottom up parsing and give examples
for that. 04
4 Give the difference between synthesized attributes and inherited attributes
04
5 Construct SLR parsing table for the following grammar :
07
S ->(L)|a
L->L,S|S
or
S -> aAb | bB
A ->Aa | ε
B -> Bb |ε
6 Implement the following grammar using Recursive Descent Parser. S ->
Aa | bAc | bBa 07
A -> d B -> d
7 Give the translation scheme that converts infix to postfix expression for the
following grammar and also generate the annotated parse tree for input 07
string “id+id*id”
E -> E+T | T
T ->T*F | F
F -> id
8 Find out FIRST and FOLLOW for the following grammar.
07
S->1AB | ε
A-> 1AC | 0C
B->0S
C-> 1
9 What is operator grammar? Check the following grammar is
operator or not. Justify your answer. 07
E-> EOE
E-> id
O-> * | + |
Subject Coordinator Signature:
SAL EDUCATION CAMPUS
SAL INSTITUTE OF TECHNOLOGY AND ENGINEERING
RESEARCH
COMPUTER ENGINEERING DEPARTMENT
3170701 COMPILER DESIGN
ASSIGNMENT 3
Course Outcome: CO3
Issue Date:
Last Date of Submission:
Sr. Questions Marks
No.
Explain error recovery strategies used by parser.
1 04
Explain Quadruple, triple and indirect triple with suitable example.
2 04
3 What is activation record? Explain stack allocation of activation
records using example. 04
4 What is code optimization? Explain data flow equation.
04
5 Describe code generator design issues.
07
6 Write difference between stack and heap memory allocation
07
7 Discuss various Storage allocation strategies in detail.
07
Subject Coordinator Signature: