CS8602 CD Course Plan
CS8602 CD Course Plan
COURSE OBJECTIVE
To learn the various phases of compiler.
To learn the various parsing techniques.
To understand intermediate code generation and run-time environment.
To learn to implement front-end of the compiler.
To learn to implement code generator.
TEXT BOOK:
T1. Alfred V. Aho, Monica S. Lam, Ravi Sethi, Jeffrey D. Ullman, Compilers: Principles, Techniques and Tools‖, Second
Edition, Pearson Education, 2009.
REFERENCES:
R1.Randy Allen, Ken Kennedy, Optimizing Compilers for Modern Architectures: A Dependence based Approach, Morgan
Kaufmann Publishers, 2002.
R2. Steven S. Muchnick, Advanced Compiler Design and Implementation‖, Morgan Kaufmann Publishers - Elsevier Science,
India, Indian Reprint 2003.
R3. Keith D Cooper and Linda Torczon, Engineering a Compiler‖, Morgan Kaufmann Publishers Elsevier Science, 2004.
R4. V. Raghavan, Principles of Compiler Design‖, Tata McGraw Hill Education Publishers, 2010.
R5. Allen I. Holub, Compiler Design in C‖, Prentice-Hall Software Series, 1993.
WEB RESOURCES
W1: http://nptel.ac.in/syllabus/syllabus_pdf/106108052.pdf
W2:www.wikipedia.org
W3: http://studentsfocus.com/
TEACHING METHODOLOGIES:
BB - BLACK BOARD
VIDEO - VIDEO TUTORIAL
PPT - POWER POINT PRESENTATION
3024
Structure of a compiler – Lexical Analysis – Role of Lexical Analyzer – Input Buffering –Specification of Tokens –
Recognition of Tokens – Lex – Finite Automata – Regular Expressions to Automata – Minimizing DFA.
Role of Parser – Grammars – Error Handling – Context-free grammars – Writing a grammar –Top Down Parsing -
General Strategies Recursive Descent Parser Predictive Parser-LL(1)Parser-Shift Reduce Parser-LR Parser-LR
(0)Item Construction of SLR Parsing Table -Introduction to LALR Parser - Error Handling and Recovery in Syntax
Analyzer-YACC.
Syntax Directed Definitions, Evaluation Orders for Syntax Directed Definitions, Intermediate Languages: Syntax
Tree, Three Address Code, Types and Declarations, Translation of Expressions, Type Checking.
Storage Organization, Stack Allocation Space, Access to Non-local Data on the Stack, Heap Management - Issues in
Code Generation - Design of a simple Code Generator.
Principal Sources of Optimization – Peep-hole optimization - DAG- Optimization of Basic BlocksGlobal Data Flow
Analysis - Efficient Data Flow Algorithm.
8 LR Parser T1 241-242 BB 1 17
LR (0)Item Construction of SLR
9 T1 242-252 BB 1 18
Parsing Table
Introduction to LALR Parser
10 T1 266-270 BB 1 19
Analyzer
Error Handling and Recovery in
11 T1 281-285 BB 1 20
Syntax
12 YACC T1 287-295 BB 1 21
4 DAG T1 533-535 BB 1 41
LEARNING OUTCOME:
At the end of unit , the students will be able to
Understand the concept of Optimization.
Gain knowledge about Risk management
ASSIGNMENT DETAILS
ASSIGNMENT NUMBER I II III
TOPIC NUMBER FOR REFERENCE 1-18 (1st & 2nd units) 19-36 (3rd & 4th units) 1-45 (units 1-5)
DEAD LINE
1. Develop a lexical analyzer to recognize a few patterns in C. (Ex. identifiers, constants, comments, operators
etc.). Create a symbol table, while recognizing identifiers.
2. Implement a Lexical Analyzer using Lex Tool
3. Implement an Arithmetic Calculator using LEX and YACC
4. Generate three address code for a simple program using LEX and YACC.
5. Implement simple code optimization techniques (Constant folding, Strength reduction and Algebraic
transformation)
6. Implement back-end of the compiler for which the three address code is given as input and the 8086 assembly
language code is produced as output.
Ses Teachin No. Cumulativ
sion Experimental concepts to be covered
g Aid of e No. of
No Hour Hours
s
2 5
Development of a lexical analyzer to recognize a few patterns in C.
1
2 Implementation of Lexical Analyzer using Lex Tool. 2 10
3 2 15
Implementation of Calculator using LEX and YACC.
4 2 20
Implementation of three address code using LEX and YACC PP
T
5 2 25
Implementation of Simple Code Optimization Techniques.
6 2 30
Implementation of back end of the compiler.
OUTCOMES:
Upon the completion of Compiler Design practical course, the student will be able to:
1. Understand the working of lex and yacc compiler for debugging of programs.
2. Understand and define the role of lexical analyzer, use of regular expression and transition diagrams.
3. Understand and use Context free grammar, and parse tree construction.
4. Learn & use the new tools and technologies used for designing a compiler.
PREPARED BY VERIFIED BY
APPROVED BY
PRINCIPAL