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

CS8602 - Compiler Design

The document outlines the course plan for Compiler Design for the third year students. It includes 5 units - Introduction to Compilers, Syntax Analysis, Intermediate Code Generation, Run-time Environment and Code Generation. The course will cover various phases of compiler like lexical analysis, parsing, syntax analysis, intermediate code generation and code optimization. Students will learn about parsing techniques like LL, LR parsing and will implement a basic compiler. The course includes both theoretical and practical sessions to help students understand and implement different phases of a compiler.

Uploaded by

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

CS8602 - Compiler Design

The document outlines the course plan for Compiler Design for the third year students. It includes 5 units - Introduction to Compilers, Syntax Analysis, Intermediate Code Generation, Run-time Environment and Code Generation. The course will cover various phases of compiler like lexical analysis, parsing, syntax analysis, intermediate code generation and code optimization. Students will learn about parsing techniques like LL, LR parsing and will implement a basic compiler. The course includes both theoretical and practical sessions to help students understand and implement different phases of a compiler.

Uploaded by

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

COURSE PLAN

Department of Computer Science and Engineering


2021 - 2022 (Even Semester)

Year : III Course Code : CS8602


Faculty Name : Dr.R.Ramya & Mrs.R.Indhuja Course Name : Compiler Design
Course code (as
: C313 Regulation : R2017
per NBA)

Objectives:
To enable the students
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 front-end of the compiler.
5. To learn to implement code generator.

Prerequisite :

 CS8501 – Theory of Computation

Text Books:
Alfred V Aho, Monica S. Lam, Ravi Sethi and Jeffrey D Ullman, “Compilers –
T1
Principles, Techniques and Tools”, 2nd Edition, Pearson Education, 2009

References:
Randy Allen, Ken Kennedy, “Optimizing Compilers for Modern Architectures: A
R1
Dependence-based Approach”, Morgan Kaufmann Publishers, 2002.
Steven S. Muchnick, “Advanced Compiler Design and Implementation, “Morgan
R2
Kaufmann Publishers – Elsevier Science, India, Indian Reprint 2003.

Web Resources :
WR1 https://www.guru99.com/compiler-design-phases-of-compiler.html
WR2 https://www.geeksforgeeks.org/three-address-code-compiler/

Video Lectures : (NPTEL or any other video lectures)


NP1 https://www.youtube.com/watch?v=tCUJ6N3NC08
NP2 https://www.youtube.com/watch?v=-pDf9VVQk18
NP3 https://www.youtube.com/watch?v=td7BVrhaGVk

Activities:
A1 – Bingo on Keywords
A2 – Criss Cross Quiz
A3 – Word Search
A4 – Padlet activity

F.4/ Rev.2 Page 1 of 5


Book Number

No. of periods
Teaching Aid
Reference

Numbers

Cumulative
S.No. Teaching Outline

Page
Topic name

Periods
No. of
Pre- Assessment Test and Scope, Importance and
1. Introduction about the Forms 1 1 Application
subject
UNIT I - INTRODUCTION TOCOMPILERS (9/12)
The Structure of a compiler BB Lecture on phases of
2. T1 1-5 1 2
WR1 compiler
Lecture on Lexical analysis
3. Lexical Analysis T1 5-12 BB 1 3
phase
109- Discuss about tokens,
4. Role of Lexical Analyzer T1 BB 1 4
115 lexeme and pattern
Input Buffering, Lecture on buffering
115-
5. Specification of Tokens & T1 PPT 2 6 techniques and
136
Recognition of Tokens representation of tokens
LEX Tool and YAAC Tool 140- DEMO Discuss on lexical and
6. T1 1 7 syntax tool
145
Finite Automata–Regular 147- Solve the problems on
7. T1 BB 2 9
Expressions to Automata 156 finite automata
173- BB Solve the problems on
8. Minimizing DFA T1 1 10
187 A1 DFA
UNIT II – SYNTAX ANALYSIS (12/12)
Role of the Parser – 191- Lecture on syntax analyzer
9. T1 BB 1 11
Grammar & Error Handling 196 and error handling methods
Context Free Grammars & 197- Lecture on CFG and solve
10. T1 BB 1 12
Writing of Grammar 217 the problems on CFG
Top Down Parsing 217- Solve the problems on top
11. T1 BB 1 13
221 down parsing
Predictive Parser -LL(1) 222- Solve the problems on
12. T1 BB 1 14
Parser 233 LL(1) parsing
Bottom Up Parsing - Shift 233- Solve the problems on shift
13. T1 BB 2 16
Reduce Parser 241 reduce parser
LR Parser - LR(0) Item-
241- Construction of SLR
14. Construction of SLR Parsing T1 BB 2 18
259 parsing table
Table
Most Powerful LR Parsers –
259- Construction of LALR
15. LR(1) item - T1 BB 2 20
278 parsing table
Introduction to LALR Parser
Error Handling and
278- Dicsuss on error handling
16. Recovery in Syntax T1 BB 1 21
285 techniques of parser
Analyzer
287- Lecture on parser
17. YACC T1 Demo 1 22
297 construction tool
UNIT III – INTERMEDIATE CODE GENERATION (8/12)
18. Syntax directed Definitions T1 303- BB 1 23 Discuss about syntax

F.4/ Rev.2 Page 2 of 5


309 directed definitions
Discuss about syntax
Evaluation Orders for 309-
19. T1 PPT 1 24 directed translation
Syntax Directed Definitions 318
schemes
Intermediate Languages: 318- Lecture on intermediate
20. T1 PPT 1 25
Syntax Tree 323 code
363- BB Implementation of three
21. Three Address Code T1 1 26
370 WR2 address code
370- Discuss the concept of
22. Types and Declarations T1 378 BB 1 27 declarations and
procedures
378- Lecture on translation of
23. Translation of Expressions T1 PPT 2 29
386 expressions
386- BB
24. Type checking T1 1 30 Discuss on type conversion
399 A2
UNIT IV - RUN-TIME ENVIRONMENT AND CODE GENERATION (8/12)
427- Lecture on storage
25. Storage Organization T1 BB 1 31
430 organization
430- Lecture on storage
26. Storage Allocation of space T1 PPT 2 33
440 allocation space
Access to Non-local Data on 441- Discuss on stack and static
27. T1 PPT 2 35
the Stack 452 allocation
452- Lecture on the concept of
28. Heap Management T1 PPT 1 36
463 heap allocation
505- Discuss the issues in the
29. Issues in Code Generation T1 BB 1 37
512 design of code generator
Design of a simple Code 542- PPT Lecture on code generator
30. T1 1 38
Generator 549 A3 algorithm
UNIT V - CODE OPTIMIZATION (8/12)
Principal sources of 583- Discuss about the concept
31. T1 BB 1 39
Optimization 596 of optimization techniques
525-
32. Basic Blocks T1 PPT 1 40 Lecture on basic blocks
532
Optimization of basic
Discuss on optimization,
blocks, DAG representation
33. T1 533- PPT 2 42 DAG and algorithm for
of Basic Blocks-Algorithm,
542 basic blocks construction
Applications
549- Lecture on peephole
34. Peephole Optimization T1 PPT 1 43
552 optimization
Global data flow analysis-
BB Lecture on the concept of
35. Points, paths, Reaching Notes 2 45
NP1-3 data flow analysis
Definitions
Efficient Data Flow BB Explain the efficient data
36. Notes 1 46
Algorithms A4 flow methods
37. CLR Parser Notes BB 1 47 Content beyond syllabus
Overall Review 1 48 Overall review

F.4/ Rev.2 Page 3 of 5


LIST OF EXPERIMENTS: Total: 30 Hours

1 Introduction to Structure and File Concepts, Pre assessment


2 Implementation of symbol table using C
Develop a lexical analyzer to recognize a few patterns in C. (Ex. identifiers,
3
constants, comments, operators etc.)
4 Usage of LEX tool
5 Implement a Lexical Analyzer using Lex Tool
6 Usage of YACC tool
7 Implement an Arithmetic Calculator using LEX and YACC
8 Generate three address code for a simple program using LEX and YACC.
9 Implement simple code optimization techniques -Constant folding
10 Implement simple code optimization techniques - Strength reduction
11 Implement simple code optimization techniques - Algebraic transformation
Implement front-end of the compiler for which source program is given as
12
input and three address code is produced as output.
Implement back-end of the compiler for which the three address code is given as
13
input and the 8086 assembly language code is produced as output.

Number of hours Allotted: 75


Number of hours Needed: 77 (45 Lecture hours + 30 Lab hours + 1 hour Preassessment &
Introduction + 1 hour overall review)

Portions for Cycle Test:


Cycle Test Syllabus
I Unit I & Unit II
II Unit III & 50% of Unit IV
III 50% of Unit IV & Unit V

Assignment Topics:

Tentative Date of
Sl.No. Topic K Level CO Mapped
Submission

Converting Regular Expression to DFA


1 K3 CO1 March 2022
and minimization of DFA

Solve the Problems in Parsers, Three


2 K3 CO2, CO3 April 2022
address code

3 50% of Unit IV and Unit V K3 CO4, CO5 May 2022

F.4/ Rev.2 Page 4 of 5


Rubrics for Assignment Assessment:
Category Marks
allotted
Submission Submission Submission Submission
Submission
Submission with 1 day with 2 days with 3 days with 4 days
on date-5 5
on time delay-4 delay-3 delay-2 delay-1 Mark
Marks
Marks Marks Marks
All questions
Some are wrong -
All Most Few
Questions Students are
Questions Questions Questions
Correct are expected to
are are are answered 10
Answers answered resubmit their
answered – answered - correctly – 4
correctly – 6 assignment
10 Marks 8 Marks Marks
Marks with correct
answers
Report Excellent - 5 Very Good - Good - 3 Satisfactory
Poor - 1 Mark 5
preparation Marks 4 Marks Marks – 2 Marks
Total Marks 20

COURSE OUTCOMES (COs):


On successful completion of this course, the students will be able to:
CO. No. CO Statements Knowledge Level
Outline the different phases of compiler and to understand the
CO1
knowledge of LEX tool & YAAC tool K2 - UNDERSTAND
CO2 Design Top-down and Bottom-up parsers K3 - APPLY
CO3 Construct intermediate code representation K3 - APPLY
Explain different storage organization and Design a simple code
CO4 K2 - UNDERSTAND
generator
CO5 Apply Code optimization techniques for data flow analysis K3 - APPLY

PROGRAMME SPECIFIC OUTCOMES (PSOs):


CO - PO MAPPING :

Course CO. POs PSOs


Code No.
1 2 3 4 5 6 7 8 9 10 11 12 1 2
CO1 M L - - - - - - - - - L M L
CO2 M M M - - - - - L - - L M M
CS8602

CO3 M M M - - - - - M - - M M M
CO4 M M M - - - - - L - - L M L
CO5 M M L - - - - - L - - L M L
H - High, M - Moderate, L - Low

Faculty In-charge Subject Expert Chairperson


Name: Dr.R.Ramya & Name: Dr.A.Meenakshi Names: Dr.M.Indra Devi
Mrs.R.Indhuja Mr.B.Muthukrishna Vinayagam

Head of the Department

F.4/ Rev.2 Page 5 of 5

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy