0% found this document useful (0 votes)
70 views10 pages

Course Plan CD

The document outlines the course plan for CS3501 Compiler Design at DMI Engineering College, detailing the course description, objectives, syllabus, and expected outcomes. It includes information on course structure, teaching methodologies, assignments, and resources for students. The course aims to provide students with knowledge of compiler phases, parsing techniques, code generation, and optimization methods.

Uploaded by

anorelindhinesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views10 pages

Course Plan CD

The document outlines the course plan for CS3501 Compiler Design at DMI Engineering College, detailing the course description, objectives, syllabus, and expected outcomes. It includes information on course structure, teaching methodologies, assignments, and resources for students. The course aims to provide students with knowledge of compiler phases, parsing techniques, code generation, and optimization methods.

Uploaded by

anorelindhinesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

DMI ENGNIEERING COLLEGE

Kumarapuram Road, Aralvaimozhi – 629 301

Department of Computer Science


and Engineering

COURSE PLAN
(Regulation 2022)

CS3501 COMPILER DESIGN


Subject
Code&Name
Computer Science and Engineering
Programme

Year &Semester III & V

Nature of Course / Theory / Laboratory Credits :3


Credit

Name of the faculty Mrs.A.Anorelin


1. COURSE DESCRIPTION: COMPILER DESIGN

Subject Name : COMPILER DESIGN L T P C


3 0 0 3
Programme Sem
Computer Science and Engineering Category:
: :
Prerequiste TOC
Aim:
Course Objectives:
1 To learn the various phases of compiler.
2 To learn the various parsing techniques.
3 To understand intermediate code generation and run-time environment.
4 To learn to implement the front-end of the compiler.
5 To learn to implement code generator.
6 To learn to implement code optimization.

2. SYLLABUS

UNIT I INTRODUCTION TO COMPILERS & LEXICAL ANALYSIS 8

Introduction- Translators- Compilation and Interpretation- Language processors -The Phases of


Compiler – Lexical Analysis – Role of Lexical Analyzer – Input Buffering – Specification of Tokens
– Recognition of Tokens – Finite Automata – Regular Expressions to Automata NFA, DFA –
Minimizing DFA - Language for Specifying Lexical Analyzers – Lex tool

UNIT II SYNTAX ANALYSIS 11

Role of Parser – Grammars – 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 tool - Design of a syntax Analyzer for a
Sample Language

UNIT III SYNTAX DIRECTED TRANSLATION & INTERMEDIATE CODE GENERATION 9

Syntax directed Definitions-Construction of Syntax Tree-Bottom-up Evaluation of S-Attribute


Definitions- Design of predictive translator - Type Systems-Specification of a simple type Checker-
Equivalence of Type Expressions-Type Conversions. Intermediate Languages: Syntax Tree, Three
Address Code, Types and Declarations, Translation of Expressions, Type Checking, Back
patching.

UNIT IV RUN-TIME ENVIRONMENT AND CODE GENERATION 9

Runtime Environments – source language issues – Storage organization – Storage Allocation


Strategies: Static, Stack and Heap allocation - Parameter Passing-Symbol Tables - Dynamic
Storage Allocation - Issues in the Design of a code generator – Basic Blocks and Flow graphs -
Design of a simple Code Generator - Optimal Code Generation for Expressions– Dynamic
Programming Code Generation.
UNIT V CODE OPTIMIZATION 8

Principal Sources of Optimization – Peep-hole optimization - DAG- Optimization of Basic Blocks -


Global Data Flow Analysis - Efficient Data Flow Algorithm – Recent trends in Compiler Design
Total: 45 Periods

3. Course Outcome (COs): (should follow Bloom’s taxonomy)

Course Outcomes: After successful completion of the course, the students


should be able to

COs CO Statements POs


Understand the techniques in PO2, PO3.PO12
CO1:
different phases of a compiler.
Design a lexical analyzer for a PO1, PO2, PO3,PO9
CO2: sample language and learn to use the
LEX tool.
Apply different parsing algorithms to PO1, PO2, PO3
CO3: develop a parser and learn to use
YACC tool
Understand semantics rules (SDT), PO1, PO2, PO3
CO4: intermediate code generation and
run-time environment
Implement code generation and apply
CO5:
code optimization techniques.
PO1, PO2, PO3,PO9
4. Text Books & Reference Books

S. Text / Title of the Book Author/Publisher/ Web link


No Reference Year/ Edition
. book
https://docs.google.com/
Compilers: Principles,
Alfred V. Aho, Monica S. viewer?
Techniques and Tools Lam, Ravi Sethi, Jeffrey D. a=v&pid=sites&srcid=ZGVmYX
1 Text
Ullman/”, Second Edition, VsdGRvbWFpbnxmYTIwMTdjb
Pearson Education, 2009 21wNDUxfGd4OjJlZDU4ZWQ4
YzE3ODUwYjY- pdf
https://dl.acm.org/doi/
Optimizing Compilers
10.5555/502981
for Modern Randy Allen, Ken Kennedy/
2 Reference Architectures: A Morgan Kaufmann Publishers,
Dependence based 2002.
Approach
https://kupdf.net/download/
Advanced Compiler Steven S. Muchnick,
steven-s-muchnick-advanced-
Design and
3 Reference Morgan Kaufmann compiler-design-
Implementation Publishers / Indian Reprint and_5a991f80e2b6f50c26845
2003. 592_ pdf
https://gacbe.ac.in/images/E
Engineering a Compiler
%20books/Engineering%20a
Keith D Cooper and Linda %20Compiler%202nd%20ed
Torczon/ Morgan Kaufmann %2-%20K.%20Cooper,%20L.
4 Reference
Publishers Elsevier Science, %20Torczon%20(Morgan
2004. %20Kaufman,
%202012)%20BBS%20bbbb.
pdf
https://www.cb-india.com/
Principles of Compiler V. Raghavan/ Tata McGraw
books/computer-science/
5 Reference Design Hill Education Publishers,
compiler-design/principles-of-
2010.
compiler-design/
https://holub.com/goodies/
Compiler Design in C Allen I. Holub/ Prentice-Hall
6 Reference compiler/
Software Series, 1993.
compilerDesignInC.pdf

5. Web Resources: (other tLhan NPTEL, SWAYAM and other e


learning resources)

S.No Topic Web link


.

1 Principles of Compiler https://nptel.ac.in/courses/106102064


Design
2 Compiler Design https://www.edx.org/learn/compiler-design

3 Compiler Design https://onlinecourses.nptel.ac.in

6. E – learning videos/NPTEL/ SWAYAM and other resources


(IMPORTANT!)

1 Compiler Design https://www.udemy.com/course/compiler-design-


n/

2 Compiler Design https://www.youtube.com

3 Compiler Design https://www.geeksforgeeks.org/compiler-design-


tutorials
4 Compiler Design https://www.udemy.com/course/compiler-design-
n/

7. Lesson Plan

Mode of
Text/
Hours teaching Page
S.no Unit Topic to be covered Ref.
need (BB/PPT/ no
book
Others)
UNIT I INTRODUCTION TO COMPILERS & LEXICAL ANALYSIS 8

1 Introduction- Translators- 1 Blackboard T1 1-3


Compilation and
Interpretation- Language
processors
2 The Phases of Compiler 1 Blackboard T1 4-12
3 Lexical Analysis – Role of 1 Blackboard T1 109-
Lexical Analyzer 114
4 Input Buffering – 2 Blackboard T1 115-
I Specification of Tokens 116
5 Recognition of Tokens – 2 Blackboard T1 128-
Finite Automata 133
6 Regular Expressions to 2 Blackboard T1 152-
Automata NFA, DFA 157
7 Minimizing DFA 1 Blackboard T1 159
8 Language for Specifying 1 Blackboard T1
Lexical Analyzers – Lex
tool
UNIT II SYNTAX ANALYSIS 11

9 II Role of Parser – Grammars 1 Blackboard T1 192-


– Context-free grammars 208
10 Writing a grammar Top 1 Blackboard T1 210-
Down Parsing 216
11 General Strategies - 1 Blackboard T1 219
Recursive Descent Parser
Predictive Parser
12 LL(1) Parser 1 Blackboard T1 222
13 Shift Reduce 1 Blackboard T1 236
Parser
14 LR Parser 1 Blackboard T1 241
15 LR (0)Item Construction of 1 Blackboard T1 248
SLR Parsing Table
16 Introduction to LALR 1 Blackboard T1 266
Parser
17 Error Handling and 1 Blackboard T1 296-
Recovery in Syntax 297
Analyzer
18 YACC tool 1 Blackboard T1 287-
295
19 Design of a syntax 1 Blackboard T1
Analyzer for a
Sample Language
UNIT III SYNTAX DIRECTED TRANSLATION & INTERMEDIATE CODE
GENERATION 9
20 Syntax directed Definitions- 1 Blackboard T1 304-
- Construction of Syntax 309
Tree
21 Bottom-up Evaluation of S- 1 Blackboard T1 310-
Attribute Definitions- 314
Design of predictive
translator
22 Type Systems-Specification 1 Blackboard T1
of a simple type Checker
23 Equivalence of Type 1 Blackboard T1
Expressions
24 III Type Conversions. 1 Blackboard T1
Intermediate Languages:
Syntax Tree
25 1 Blackboard T1 363-
Three Address Code
370
26 1 Blackboard T1 370-
Types and Declarations,
378
27 1 Blackboard T1 378-
Translation of Expressions,
384
28 Type Checking, Back 1 Blackboard T1 386-
patching. 396
UNIT IV RUN-TIME ENVIRONMENT AND CODE GENERATION 9
29 IV Runtime Environments – 1 Blackboard T1 427-
source language issues - 429
Storage organization –
30 Storage Allocation 1 Blackboard T1 430-
Strategies: Static, Stack and 438,51
Heap allocation- Parameter
Passing 8-522
31 Symbol Tables 1 Blackboard T1 85-88
32 Dynamic Storage 1 Blackboard T1
Allocation
33 Issues in the Design of a 1 Blackboard T1 505-
code generator 510
34 Basic Blocks and Flow 1 Blackboard T1 525-
graphs 531
35 Design of a simple Code 1 Blackboard T1
Generator
36 Optimal Code Generation 1 Blackboard T1 567-
for Expressions 568
37 Dynamic Programming 1 Blackboard T1 573-
Code Generation 577
UNIT V CODE OPTIMIZATION 8
38 Principal Sources of 1 Blackboard T1 584-
Optimization 592
39 Peep-hole optimization 1 Blackboard T1
40 DAG 1 Blackboard T1
41 Optimization of Basic 1 Blackboard T1 533-
V Blocks 541
42 Global Data Flow Analysis 1 Blackboard T1 PPT
43 Efficient Data Flow 1 Blackboard T1 PPT
Algorithm
44 Recent trends in Compiler 2 Blackboard T1 PPT
Design

*Beyond the syllabus topics to be included

8. Class Time Table

PERIOD I II BREAK III IV V VI BREAK VII VIII


12.30-1.00

9.00 – 9.50 – 10.40- 10.50- 11.40- 1.00- 1.45- 2.30- 2.40-


DAY/TIME 3.25-4.10
9.50 10.40 10.50 11.40 12.30 1.45 2.30 2.40 3.25

CS3551 CB3491 CS3501 CCS358 CS3501 CCS375 CB3491 MX3084


MONDAY
DS CCS CD PPL CD WT CCS DRRM
CB3491 CS3591 CCS358 CCS375 CS3551 CS3591 CS3501 CCS358
TUESDAY
CCS CN PPL WT DS CN CD PPL
CCS358 CCS375 CS3591 CB3491 BRE CS3501 CS3551 CS3501 CD/
WEDNESDAY BREAK BREAK
PPL WT CN CCS AK CD DS CCS375WT
CS3501 CCS358 CS3501 CD/ MX3084 CCS375 CB3491
THURSDAY LIBRARY
CD PPL CCS375WT DRRM WT CCS
CS3591 CS3501 CCS375 CS3551 CS3591 CB3491 CS3591
FRIDAY
CN CD WT DS CN CCS CN
9.Course Time Table

PERIOD I II BREAK III IV V VI BREAK VII VIII

12.30-1.00
9.00 – 9.50 – 10.40- 10.50- 11.40- 1.00- 1.45- 2.30- 2.40-
DAY/TIME 3.25-4.10
9.50 10.40 10.50 11.40 12.30 1.45 2.30 2.40 3.25

CS3501 CS3501
MONDAY
CD CD
CS3501
TUESDAY
CD
BRE CS3501 CS3501 CD
WEDNESDAY BREAK BREAK
AK CD
CS3501
THURSDAY
CD
CS3501
FRIDAY
CD

10. Content Delivery Methodologies (Chalk and Board, Power


point presentations, Videos, E-content etc.)

1.Chalk and Board


2. Power point presentation.

11.Assignments

Assignmen Description Submission due


t No.

1 Regular Expressions to Automata NFA, DFA, 3/8/2023


Minimizing DFA

2 Construction of SLR construction Table, 11/9/2023


canonical parsing Table, predictive parser

3 Translation of expression into intermediate 4/10/2023


code, Translation of expression into three
address code

4 Construction of Symbol Tables 16/10/2023

5 Construction of DAG 24/11/2023


12.Assignment Rubrics:

Quality Marks
Submission on Date 3
Understanding 2
Solving skill/ Presentation 2
End results with correct units conversions / 3
Conclusion

13.Mapping of CO to Assignment:

CO’s CO - STATEMENTS A1 A2 A3 A4 A5

CO1: Understand the techniques in different phases of a 


compiler.
CO2: Design a lexical analyser for a sample language and learn 
to use the LEX tool.
Apply different parsing algorithms to develop a parser and
CO3: 
learn to use YACC tool

CO4: Understand semantics rules (SDT), intermediate code 


generation and run-time environment
Implement code generation and apply code optimization 
CO5:
techniques.

14.Assessment Methodologies:

Assessment Tool Description


Internal Test
(30%)
40
Direct
Assignments %
Assessme
(10%)
nt
(80%)
End semester 60
Examination %
Indirect Course End Survey
Assessme (80%)
nt
Exit Survey (20 %)
(20%)
15.Distribution of portions for assessment tests

Assessments Portion Covering Unit % of weightage


IAT – I Unit I & unit II (50%) 20
IAT – II Unit III , Unit III & Unit V 20
Assignments Unit – I to Unit-V 20
Class Test Unit – I to Unit-V 20
Attendance 20
End Semester Unit - I to V 100

16.Content beyond syllabus


1. Language Grammar
2.Theory of computation

Prepared by:
Signature

Ms.M.Princy
Name : Mrs.A.Anorelin Dr.A.Albert Raj
Usha

Designation: Prof. / CSE HoD / CSE Principal

You might also like