KALASALINGAM UNIVERSITY
ANAND NAGAR, KRISHNAN KOIL 626 126
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
ODD SEMESTER 2012 - 2013
COURSE PLAN
Subject with Code
: Compiler Design / CSE304
Semester/Branch/Section
: V / CSE / A, B
Credits
: 3
Prerequisites
Familiarity with programming languages
Basic knowledge in Theory of Computation (CSE204) and Data Structures and
Algorithms (CSE202).
Course Goal
Provide the foundation for understanding the theory and pracitce of compilers. Learn
programming language translation and compiler design concepts; language recognition,
symbol table management, semantic analysis and code generation.
Course Objectives
To understand the theory and practice of compiler implementation.
To learn finite state machines and lexical scanning.
To learn context free grammars, compiler parsing techniques, construction of abstract
syntax trees, symbol tables, intermediate machine representations and actual code
generation
Learning Outcomes
Implementing a small compiler using modern compiler writing tools.
Providing the student with skills and knowledge (such as lexical analysis and parsing)
which are applicable to a broad range of computer science application areas (such as text
editors, information retrieval, etc...).
Author / Publisher(s) /
Year
Compilers principles,
techniques and tools
Alfred Aho, Ravi Sethi,
[Link] Ullman D/
Pearson Education/ 2006
Compiler Design in C
Allen Holub l/ Prentice
Hall of India/ 2003.
Crafting a compiler
with C
Charles [Link] Richard
[Link]/Benjamin
Cummings/ 2003.
Introduction to
Compiler Techniques
J.P. Bennet /Tata McGrawHill/ 2003.
Practice and Principles
of Compiler Building
with C
Henk Alblas and Albert
Nymeyer/ PHI/2001.
[Link]
Compiler Construction: Kenneth C. Louden/
[Link]
Principles and Practice Thompson Learning/ 2003.
REFERENCE BOOK(S)
TEXTBOOK
Sno
Name of the Book
Companion Websites
[Link]
[Link]/software/[Link].
[Link]
[Link]
[Link]
ng/2007-f23pf2/[Link]
-------
Web links for similar courses offered at other universities
[Link]
Course Title
Introduction to
Compiler Design
Compiler Design
Introduction to
Compilers
Name of the
University
University of
Pittsburgh
Web site
[Link]
Kent State
University
Cornell University
[Link]
%7Ermuhamma/Compilers/[Link]
[Link]
[Link]
Write State
University
Rice University
[Link]
es/cs780/[Link]
[Link]
Compiler Design and
Construction I
Topics in Compiler
Construction
Compilers
Rutgers University
[Link]
Compilers
Stanford University
[Link]
Compilers
University of Texas
[Link]
Web Resources
[Link]
Topic Name
Website
Compiler Construction Tools
[Link]
Derivation and Parse tree
[Link]
3
4
Parse tree, Lex, Yacc
Context free grammar
[Link]
[Link]
LL(1)
ml
[Link] /lehre /material /compi
6
7
8
9
10
11
12
13
14
15
16
SLR,LALR,First and Follow
Parsing ,LALR ,LR(0),LR(1)
LR(0),LR(1),SLR,YACC,LEX
Semantics, Grammar
Predictive Parsing
Recursive descent
Predictive parser
LR Parser
LR parser - LR(0)
SLR
Intermediate Languages
/aufgaben/blatt3/[Link]
[Link]
[Link] msc430/slides
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]/~jurgenv/publications/slides/[Link]
[Link]
[Link]/kurser/cd5110/ht01/t1_02 [Link]
[Link]/articles/presentations/
Flow Control Stmts
Symbol Table
Procedure Calls
Syntax Directed translation
Syntax Directed translation
Code Optimization
Code Generation
tiliaoc /[Link]
[Link]/~hcp/wrk/idlcourse/notes/[Link]
[Link]/projects/archstudio/[Link]
[Link]/str/descriptions/[Link]
[Link]
[Link]
[Link]
[Link]
17
18
19
20
21
22
23
Lesson Plan
[Link]
Topic Name
Reference Book
No. of
Periods
Cumulative No.
of Periods
UNIT I INTRODUCTION TO COMPILER
1.
2.
3.
4.
5.
6.
Introduction to compiler-The
structure of compiler
Lexical analysis-The Role of
Lexical analyzer
Input Buffering
Specification of tokens
Recognition of tokens
Lexical analyzer generator
T1(4-12)
T1(109-114)
T1(115-116)
T1(116-128)
T1(128-140)
T1(140-146)
1
2
2
1
4
6
8
9
T1(147-152)
T1(152-166)
T1(173-187)
T1(192-196)
T1(197-208)
T1(209-216)
T1(217 220)
1
2
2
1
1
1
10
12
14
15
16
17
18
T1(226-228)
19
20
21
23
25
26
28
1
1
29
30
31
1
1
32
33
UNIT II : LEXICAL ANALYSIS
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
Finite Automata
Regular expressions to an NFA
Optimization of DFA
The Role of parser
Context free grammars
Writing a Grammar
Top Down parsing -Recursive
Descent Parsing
Predictive parsing
Bottom up parsing-Shift reduce
parsing
Operator Precedence parsing
T1(233-238)
Course material
UNIT III SYNTAX ANALYSIS
17.
18.
19.
20.
21.
22.
23.
24.
25.
Introduction to LR parsing &
T1(241-256)
SLR parser
Canonical LR parser and LALR
T1(259-275)
parser generator
Intermediate languages
T1(363-369)
Declarations ,control flow and
T1(373)
Boolean expressions
T1(399-408)
Switch statements
T1(418-420)
Back patching
T1(410-416)
UNIT IV CODE GENERATION
Issues in the design of code
T1(506-511)
generator
The target Language
T1(512-515)
Addresses in target code
T1(518-522)
26.
27.
28.
Basic Blocks and Flow Graphs
A simple Code generator
DAG representation of Basic
Blocks
T1(525-531)
T1(542-547)
1
1
34
35
T1(533 540)
36
UNIT V CODE OPTIMIZATION AND RUN TIME ENVIRONMENTS
29.
30.
31.
32.
33.
34
35.
Introduction Principal
Sources of Optimization
Peephole optimization
Optimization of basic Blocks
Loops in Flow Graphs
Run time environments-Storage
organization
Stack allocation of space
Access to non local data on the
stack
T1(584 596)
38
T1(549-552)
T1(533 540)
T1(655-667)
T1(427-429)
1
1
2
39
40
42
43
T1(430-438)
T1(441-449)
45
47
Sessional Exam Portions
S. No
1
2
3
Exam
Sessional I
Sessional - II
End Exam
Related Magazine:
o Software
o IT Professional
o IEEE
Links to research journals and conference proceedings
Topic No
1 - 23
24 - 33
1 - 39
ACM Transactions on Programming Languages and Systems
[Link]
ACM SIGPLAN sponsored conferences
[Link]
Upcoming Compiler and Parallel Computing Conferences
[Link]
Prepared By
Course Coordinator
([Link] Narayanan)
Verified By
HOD/CSE
([Link])