SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
FACULTY OF ENGINEERING AND TECHNOLOGY
COMPUTER SCIENCE AND ENGINEERING
COURSE PLAN
Course Code : 15CS314J Semester: VI
Course Title : Compiler Design Course Time: Jan – May 2018
Batch-I Batch-II
Day Order
Timing* Timing*
8.00 – 8.45AM 12.30 -1.20
Day 2
8.45 – 9.40 AM 1.25 - 2.15
Day 4
9.45 - 10.30 A.M 2.20 - 3.10
Day 5
3.15 - 4.05 P.M 10.40 -11.30
*Any Three hours
Location : Tech Park
Faculty Details
S.N
Name Office Office hour Mail id
o
Tech Park
1 Mrs.R.Jeya 8.00 – 5.00 P.M sridhar.s@ktr.srmuniv.ac.in
Tech Park 8.00 – 5.00 P.M
2 Ms.J.V.Vidhya vidhya.j@ktr.srmuniv.ac.in
Tech Park 8.00 – 5.00 P.M
3 Ms.S.Nagadevi nagadevi.s@ktr.srmuniv.ac.in
Tech Park 8.00 – 5.00 P.M
4 Ms.K.Deeba deeba.k@ktr.srmuniv.ac.in
Tech Park 8.00 – 5.00 P.M
5 Mrs G.Abirami abirami.g@ktr.srmuniv.ac.in
Tech Park 8.00 – 5.00 P.M
6 Mr.JothiKumar jothikumar.c@ktr.srmuniv.ac.in
Tech Park 8.00 – 5.00 P.M
7 Mrs.S.Sharanya sharanya.se@ktr.srmuniv.ac.in
Tech Park 8.00 – 5.00 P.M
8 Mrs.S.Ushasukhanya ushasukhanya.s@ktr.srmuniv.ac.in
Mrs.A.Meena Tech Park 8.00 – 5.00 P.M
9 meenapriyadharshini.a@ktr.srmuniv.ac.in
Priyadharshini
Tech Park 8.00 – 5.00 P.M
10 Mrs.J.Prathipa prathipa.j@ktr.srmuniv.ac.in
Tech Park 8.00 – 5.00 P.M
11 Mrs.G.Abirami abirami.g@ ktr.srmuniv.ac.in
Tech Park 8.00 – 5.00 P.M
12 Mrs.M.Uma Devi umadevi.mu@ktr.srmuniv.ac.in
Tech Park 8.00 – 5.00 P.M
13 Mrs.S.Thenmalar thenmalar.s@ktr.srmuniv.ac.in
Tech Park 8.00 – 5.00 P.M
14 Mrs.R.Brindha brindha.ra@ktr.srmuniv.ac.in
Text Books:
1. Alfred V. Aho, Ravi Sethi & Jeffrey. D. Ullman, “Compilers Principles, Techniques &
Tools”,Pearson Education, third edition, 2011.
2. S.Godfrey Winster,S.Aruna Devi,R.Sujatha,”Compiler Design”,Yesdee Publishing Pvt.Ltd, 2016
References
3. K.Muneeswaran, ”Compiler Design”, Oxford Higher Education,Fourth edition 2015
4. David Galles, “Modern Compiler Design”, Pearson Education, Reprint 2012.
5. Raghavan V., “Principles of Compiler Design”, Tata McGraw Hill Education Pvt. Ltd., 2010.
Prerequisite : 15CS301-Theory Of Computation
Objectives
1. To learn the fundamentals of design of Compilers by applying mathematics and engineering
principles
2. To design a system for parsing the sentences in a compiler grammar
3. To design a system to translate into various intermediate codes
4. To analyze the methods of implementing a Code Generator for compilers
5. To analyze and design the methods of developing a Code Optimizer
Assessment Details
Cycle Test – I : 15 Marks
Cycle Test – II : 25 Marks
Surprise Test : 5 Marks
Attendance : 5 Marks
Test Schedule
S.No. DATE TEST TOPICS DURATION
1 From 19/2/2018 Cycle Test - I Unit I & II 2 Hours
2 From 17/4/2018 Cycle Test - II Unit III,IV& V 3 Hours
Purpose
To acquire analytical ability in solving mathematical problems as applied to the respective branches of
Engineering.
Instructional Objectives Course outcomes
1.To learn the fundamentals of design of An ability to understand the basic functioning of
Compilers by applying mathematics and compiler and its tools.
engineering principles To implement various parsing, conversion,
2. To design a system for parsing the optimization and generation algorithms for the
sentences in a compiler grammar design of a compiler
3. To design a system to translate into various To analyze and be able to design a compiler
intermediate codes
4. To analyze the methods of implementing a
Code Generator for compilers
5. To analyze and design the methods of
developing a Code Optimizer
Detailed Session Plan
UNIT I: INTRODUCTION TO COMPILER & AUTOMATA(9 Hours)
Sessi
Time Teaching
on Topics to be covered Ref Testing Method
(hr) Method
No.
Compilers – Analysis of the source Discussion
1 1 1,2 BB
program
Phases of a compiler – Cousins of the Discussion
2 1 1,2 BB
Compiler
Grouping of Phases – Compiler Illustration by examples
3 1 1 BB
construction tools
Lexical Analysis – Role of Lexical 1 Illustration by examples
4 1,2 BB
Analyzer
Input Buffering – Specification of 1 Illustration by examples
5 1 BB / PPT
Tokens- design of lexical analysis (LEX)
Finite automation (deterministic & non 2 Illustration by examples
1,2,3,4
6 deterministic) - Conversion of regular BB
,5
expression of NDFA – Thompson’s
Conversion of NDFA to DFA- 1,2,3,4 Illustration by examples
7 1 BB
minimization of NDFA ,5
Derivation - parse tree - ambiguity 1,2,3,4 Discussion
8 1 BB
,5
UNIT II: SYNTAX ANALYSIS – PARSING(10 Hours)
Definition - role of parsers - top down Discussion
9 1 1,2 BB
parsing - bottom-up parsing
Left recursion - left factoring - Handle
10 1 1,2 BB / PPT
pruning , Shift reduce parsing Illustration by examples
LEADING- TRAILING- Operator Illustration by
11 precedence parsing 1 2 BB / PPT examples
FIRST- FOLLOW 1,2,3,4
12 1 BB / PPT Illustration by examples
,5
Predictive parsing 1,2,3,4 Illustration by examples
13 1 BB
,5
Recursive descent parsing Illustration by examples
14 1 1 BB
LR parsing – LR (0) items - SLR parsing 1,2,3,4
15 2 BB / PPT Illustration by examples
,5
16 Canonical LR parsing 1 1,2 BB Illustration by examples
17 LALR parsing 1 1,2 BB / PPT Surprise Test
UNIT III: INTERMEDIATE CODE GENERATION (9 Hours)
Intermediate Languages - prefix -
1,2,3,4 Group discussion
18 postfix - Quadruple - triple - indirect 1 BB
,5
triples
Syntax tree- Evaluation of expression - Group discussion
19 1 1,2 BB
three-address code
Synthesized attributes – Inherited Group discussion
20 1 1,2 BB
attributes
Intermediate languages – Declarations Group discussion
21 1 1,2 BB
Assignment Statements 1,2,3,4
22 1 BB Group discussion
,5
Boolean Expressions 1,2,3,4 Group discussion,
23 2 BB
,5
24 Case Statements 1 1 BB Illustration by examples
25 Back patching – Procedure calls. 1 1 BB Illustration by examples
UNIT IV: CODE GENERATION (9 Hours)
26 Issues in the design of code generator 1 1 BB Group discussion
The target machine – Runtime Storage
27 2 1 BB / PPT Group discussion
management
Basic Blocks and Flow Graphs 1,2,3,4
28 1 BB Illustration by examples
,5
Next-use Information – A simple Code 1
29 1 BB Illustration by examples
generator
DAG representation of Basic Blocks 1,2,3 Illustration by
30 1 BB
examples
31 Peephole Optimization 1 1 BB Group discussion
32 Cross Compiler – T diagrams 1 1 BB / PPT Group discussion
UNIT V: CODE OPTIMIZATION (9 Hours)
Introduction– Principal Sources of Group discussion
33 1 1 BB
Optimization
34 Optimization of basic Blocks 1 1,2,3 BB / PPT Group discussion
35 Loop Optimization 2 1,2,3 BB Group discussion
Introduction to Global Data Flow Group discussion
36 1 1 BB
Analysis – Illustration
Runtime Environments – Source Group discussion
37 1 1 BB / PPT
Language issues
38 Storage Organization 1 1 BB Group discussion
Storage Allocation strategies – Access to Group discussion
39 1 1 BB
non-local names
40 Parameter Passing. 1 1 BB Group discussion
Signature of Faculty Member Head of the Department