0% found this document useful (0 votes)
26 views

CS1352 Courseplan

The document outlines a course plan for principles of compiler design. It details the 5 units that will be covered across 15 weeks, including topics like lexical analysis, syntax analysis, code generation, and optimization. It also lists the textbook and references that will be used.

Uploaded by

mbilalarshad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

CS1352 Courseplan

The document outlines a course plan for principles of compiler design. It details the 5 units that will be covered across 15 weeks, including topics like lexical analysis, syntax analysis, code generation, and optimization. It also lists the textbook and references that will be used.

Uploaded by

mbilalarshad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

-1-

CS1352 PRINCIPLES OF COMPILER DESIGN 3 1 0 100

AIM

At the end of the course the student will be able to design and implement a simple compiler.

OBJECTIVES
 To understand, design and implement a lexical analyzer.
 To understand, design and implement a parser.
 To understand, design code generation schemes.
 To understand optimization of codes and runtime environment.

UNIT I INTRODUCTION TO COMPILING 9


Compilers – Analysis of the source program – Phases of a compiler – Cousins of the
Compiler – Grouping of Phases – Compiler construction tools – Lexical Analysis – Role of
Lexical Analyzer – Input Buffering – Specification of Tokens.
UNIT II SYNTAX ANALYSIS 9
Role of the parser –Writing Grammars –Context-Free Grammars – Top Down parsing
– Recursive Descent Parsing – Predictive Parsing – Bottom-up parsing – Shift Reduce Parsing –
Operator Precedent Parsing – LR Parsers – SLR Parser – Canonical LR Parser – LALR Parser.
UNIT III INTERMEDIATE CODE GENERATION 9
Intermediate languages – Declarations – Assignment Statements – Boolean
Expressions – Case Statements – Back patching – Procedure calls.
UNIT IV CODE GENERATION 9
Issues in the design of code generator – The target machine – Runtime Storage
management – Basic Blocks and Flow Graphs – Next-use Information – A simple Code generator
– DAG representation of Basic Blocks – Peephole Optimization.
UNIT V CODE OPTIMIZATION AND RUN TIME ENVIRONMENTS 9
Introduction– Principal Sources of Optimization – Optimization of basic Blocks –
Introduction to Global Data Flow Analysis – Runtime Environments – Source Language issues –
Storage Organization – Storage Allocation strategies – Access to non-local names – Parameter
Passing.
TUTORIAL 15
TOTAL : 60
TEXT BOOK
1. Alfred Aho, Ravi Sethi, Jeffrey D Ullman, “Compilers Principles, Techniques and
Tools”, Pearson Education Asia, 2003.
REFERENCES
1. Allen I. Holub “Compiler Design in C”, Prentice Hall of India, 2003.
2. C. N. Fischer and R. J. LeBlanc, “Crafting a compiler with C”, Benjamin Cummings,
2003.
3. J.P. Bennet, “Introduction to Compiler Techniques”, Second Edition, Tata McGraw-Hill,
2003.
4. Henk Alblas and Albert Nymeyer, “Practice and Principles of Compiler Building with
C”, PHI, 2001.
5. Kenneth C. Louden, “Compiler Construction: Principles and Practice”, Thompson
Learning, 2003
-2-

KAMARAJ COLLEGE OF ENGINEERING AND TECHNOLOGY


VIRUDHUNAGAR

Department of CSE

COURSE PLAN
Name of the staff : Mrs. R.Ramya
Subject with code : CS1352 – Principles of Compiler Design
Course : B.E
Semester / Branch : VI / CSE

Aim

To provide a strong foundation in phases of the compiler so that the students


will be able to design and implement a simple compiler.

Text book

T. Alfred Aho, Ravi Sethi, Jeffrey D Ullman, “Compilers Principles, Techniques and
Tools”, Pearson Education Asia, 2003.

Lesson Plan

Sl. Topics References Teaching No. Of cum


No aids Periods hrs
1. Introduction 1 1
UNIT – I INTRODUCTION TO COMPILING
2. Compilers T P.No. 13 – 22 1 2
Analysis of the source program
3. Phases of a compiler T P.No. 22 – 27 OHP 1 3
4. Cousins of the compiler T P.No. 2 8– 35
Grouping of phases 1 4
Compiler construction tools
5. Lexical analysis: T P.No. 95 – 158 6 10
Role of lexical analyzer
Input buffering
Specification of tokens
Total No of periods for UNIT – I 9
UNIT – II SYNTAX ANALYSIS
6. Role of the parser – Writing
grammars – Context-Free grammars T P.No. 135 –182 2 12
7. Top Down Parsing: Recursive OHP
descent parsing, Predictive parsing T P.No.193 – 207 2 14
8. Bottom-up parsing: Shift Reduce OHP
Parsing, Operator precedent parsing T P.No.207 – 227 2 16
9. LR parsers: SLR parser, Canonical OHP
LR parser, LALR parser T P.No. 227 –269 3 19
Total No of periods for UNIT – II 9
-3-
UNIT – III INTERMEDIATE CODE GENERATION
10. Intermediate languages T P.No. 476 – 485 2 21
11. Declarations T P.No. 485 – 490 1 22
12. Assignment statements T P.No. 490 – 500 2 24
13. Boolean expressions T P.No. 500 – 509 2 26
14. Case statements T P.No. 509-512 1 27
Procedure calls T P.No. 518 - 520
15. Back patching T P.No. 500 - 506 1 28
Total No of periods for UNIT – III 9
UNIT – IV CODE GENERATION
16. Issues in the design of code
generator T P.No. 526 – 540 3 31
The target machine
Runtime storage management OHP
17. Basic blocks and flow graphs
Next-use information T P.No. 540 – 547 2 33
18. A simple code generator T P.No. 547 – 558 2 35
19. DAG representation of basic blocks T P.No. 558 – 569 2 37
Peephole optimization
Total No of periods for UNIT – IV 9
UNIT – V CODE OPTIMIZATION AND RUN TIME ENVIRONMENTS
20. Introduction
Principal sources of optimization T P.No. 597 – 610 2 39
21. Optimization of basic blocks
Introduction to global data flow T P.No. 620 – 635 2 41
analysis
22. Runtime Environments:
Source language issues T P.No. 401 – 408 1 42
Storage Organization T P.No. 408 - 412 1 43
Storage Allocation strategies T P.No. 413 – 423 1 44
Access to non-local names T P.No. 423 – 435 1 45
Parameter passing T P.No. 436 – 441 1 46
Total No of periods for UNIT – V 9
23. Review 1 47
Tutorial: 15
Advanced topics beyond syllabus
 Code Generation using an Internal Test Portions
Orthogonal Model I Internal Test Unit I & II

 Incremental Recursive Descent II Internal Test Units: III, ½ of IV

Parsing III Internal Test Units: ½ of IV, V

 Inter procedural Optimization

STAFF INCHARGE HOD/CSE

You might also like