You are on page 1of 6

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,


V.Jeffery Ullman D/
Pearson Education/ 2006

Compiler Design in C

Allen Holub l/ Prentice


Hall of India/ 2003.

Crafting a compiler
with C

Charles N.Fischer Richard


J.Leblanc/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.

http://www.aue.auc.dk/~akbar/2007/compl
Compiler Construction: Kenneth C. Louden/
ierconst07.html
Principles and Practice Thompson Learning/ 2003.

REFERENCE BOOK(S)

TEXTBOOK

Sno

Name of the Book

Companion Websites

http://dragonbook.stanford.edu/

www.holub.com/software/compiler.design.
in.c.docs.pdf
http://163.21.82.150/compiler/
http://www.macs.hw.ac.uk/~gabbay/teachi
ng/2007-f23pf2/index.html
-------

Web links for similar courses offered at other universities


S.No

Course Title

Introduction to
Compiler Design

Compiler Design

Introduction to
Compilers

Name of the
University
University of
Pittsburgh

Web site
http://www.cs.pitt.edu/undergrad/courses/cs1622.php

Kent State
University
Cornell University

http://www.personal.kent.edu/
%7Ermuhamma/Compilers/compiler.html
http://www.cs.cornell.edu/courses/cs412/2002sp/sched
ule.html

Write State
University
Rice University

http://www.cs.wright.edu/people/faculty/tkprasad/cours
es/cs780/cs780.html
http://www.owlnet.rice.edu/%7Ecomp412/

Compiler Design and


Construction I
Topics in Compiler
Construction
Compilers

Rutgers University

http://www.cs.rutgers.edu/%7Eryder/415/lectures/

Compilers

Stanford University

http://www.stanford.edu/class/cs143/

Compilers

University of Texas

http://www.cs.utexas.edu/users/novak/cs375contents.html

Web Resources
S.No

Topic Name

Website

Compiler Construction Tools

http://www.linuxgazette.com/issue39/sevenich.html

Derivation and Parse tree

http://www.softpanorama.org/Algorithms/compilers.shtml

3
4

Parse tree, Lex, Yacc


Context free grammar

www.flint.cs.yale.edu
http://www.cs.nmsu.edu/~jeffery/courses/unlv/478/lecture.ht

LL(1)

ml
http://ag-kastens.uni-paderborn.de /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/Blatt3.html
www.pdclab.cs.ucdavis.edu
http://www.cs.umd.edu/class/spr98/c msc430/slides
www.cs.gmu.edu
www.csee.umbc.edu
www.ambda.uta.edu
www.userpages.umbc.edu
www.cs.waikato.ac.nz
www.cwi.nl/~jurgenv/publications/slides/cc2002.ppt
www.wikipedia.org
www.idt.mdh.se/kurser/cd5110/ht01/t1_02 s.html
www.hardcoreprocessing.com/articles/presentations/

Flow Control Stmts


Symbol Table
Procedure Calls
Syntax Directed translation
Syntax Directed translation
Code Optimization
Code Generation

tiliaoc /TheDocument.html
www.met.ed.ac.uk/~hcp/wrk/idlcourse/notes/node16.html
www.isr.uci.edu/projects/archstudio/symboltable.html
www.sei.cmu.edu/str/descriptions/rpc.html
www.dcs.warwick.ac.uk
websrv.cs.fsu.edu
www.uni-koeln.de
cs.wwc.edu

17
18
19
20
21
22
23

Lesson Plan
S.No

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


http://www.cs.wustl.edu/~toplas/

ACM SIGPLAN sponsored conferences


http://www.acm.org/sigplan/#conferences

Upcoming Compiler and Parallel Computing Conferences


http://www.cs.rice.edu/~roth/conferences.html

Prepared By

Course Coordinator
(S.Sankara Narayanan)

Verified By

HOD/CSE
(Dr.D.Devaraj)

You might also like