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

Compiler Design

This document outlines the course details for a Compiler Design course, including the objectives to study compiler components and design principles. It lists 5 modules that cover topics such as lexical analysis, parsing, syntax analysis, code generation, and optimization. The course will span 42 hours over these modules to provide an introduction to compiler construction.

Uploaded by

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

Compiler Design

This document outlines the course details for a Compiler Design course, including the objectives to study compiler components and design principles. It lists 5 modules that cover topics such as lexical analysis, parsing, syntax analysis, code generation, and optimization. The course will span 42 hours over these modules to provide an introduction to compiler construction.

Uploaded by

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

Course Handout ()

Subject Name/Code : Compiler Design(BTCS-T-PC-020) Branch/Sem/Batch :


Name of Faculty : Chittaranjan Mohapatra , Ranjit Kumar Behera , Chandan Patra
Scope & Objective -:

The objective of this course is to study the components of compiler and the principles involved in design of compilers for modern
computer languages.

Pre-Requisite -:

Detailed Syllabus:
Module# CO Topics Hours
Overview of Compiler, Introduction to Lexical Analysis, Regular
Language, Regular Expression (RE), Regular Definitions, Finite
Module-1 CO1 State Automata (DFA, NFA), RE to DFA conversion, Transition 9
Diagram (TD), Lexical Analyzer (LA), LA Implementation from
TD, LEX tool as LA Generator, LEX examples.
Context Free Grammar (CFG), Ambiguity in CFG, Ambiguity
removal, Elimination of Left Recursion, Elimination of non-
determinism, Introduction to Parser, Top-Down Parsing, LL(1),
Module-2 CO2 Bottom-Up parsing, Construction of LR(0), SLR(1) parsing 9
table, Construction of CLR(1), LALR(1) parsing table, Conflicts
in LR, SLR, CLR, LALR parsing, LR parsing algorithm with
example.
Operator Precedence Parser, Error Reporting and Recovery,
Module-3 CO3 Syntax Directed Translation (SDT), S-attribute SDT, S-attribute 8
SDT examples, YACC, Symbol Table.
Intermediate Code Generation, Type of Intermediate Code,
Intermediate code for various programming construct, Run-
Time Environment, Run-Time Support, parameter passing
Module-4 CO4 8
methods, Activation Record, Variable storage and offset
computation, Accessing Global Variable & allocation of
Activation Record.
Scope (Static, dynamic), Machine Code Generation, Different
Schemes of Code Generation, Code Optimization, peephole
optimization (Redundant Instruction Elimination, Flow of
Module-5 CO5 8
control optimization, Eliminating unreachable codes ), Local
Optimization, Control Flow Graph, DAG, Local common sub
expression elimination (Value Numbering in Basic Blocks).
Total 42 Hours

# Topic Module Chapter Course Coverage No of Classes

Introduction to Translator, Compiler,


1 1 TRUE 1
Interpreter, Language Processors
2 Phases of Compiler 1 TRUE 1
3 Example on Phases of Compiler 1 TRUE 1
Role of Lexical Analyzer, Tokens, Patterns,
4 3.1 TRUE 1
lexeme, Lexical Errors
Specifications of Tokens (NFA,DFA, Reg. ex,
5 3.3 TRUE 1
Reg. Def))
6 Recognition of Token (Transition Diagrams) 3.4 TRUE 1
7 Lex Tool and Programming 3.5 TRUE 1
Regular Expression to DFA Functions and
8 3.9 TRUE 1
syntax tree
9 Regular Expression to DFA Algorithm 3.9 TRUE 1
10 Role of a Parser, Error Recovery Strategies 4.1 TRUE 1
Context free grammars, Parse trees and
11 4.2 TRUE 1
derivations, Ambiguous grammar
Eliminating Ambiguty, Left recursion, Left
12 4.3 TRUE 1
Factoring
Types of Parsing, Recursive Descent
13 4.4 TRUE 1
Parsing Algorithm
14 First() 4.4 TRUE 1
15 Follow(), LL(1) Grammar 4.4 TRUE 1
16 Predictive Parsing Table Construction 4.4 TRUE 1
17 Non recursive Predtive Parsing Algorthm 4.4 TRUE 1
Bottm Up Parsing: Reductions and Handle
18 4.5 TRUE 1
Pruning, shift reduces Parsing Algorithm
19 LR Pasrer : CLOSURE() 4.6 TRUE 1
20 LR Pasrer: GOTO() 4.6 TRUE 1
21 LR Parsing Algorithm 4.6 TRUE 1
22 SLR Parsing Table 4.6 TRUE 1
23 CLR Parser: LR(1) iterms 4.7 TRUE 1
24 CLR Parser Prasing Table 4.7 TRUE 1
25 LALR Parsing Table 4.7 TRUE 1
Operator precedence parser(Leading,
26 NIL TRUE 1
Trailing)
27 Operator precedence parser Table NIL TRUE 1
28 Syntax Directed Definitions (SDD) 5.1 TRUE 1
Inherited and Synthesized Attributes,
29 5.1 TRUE 1
Dependency graphs,
30 Evaluation orders for SDD, Semantic rules 5.2 TRUE 1
31 Symbol Table NIL TRUE 1
32 DAG for expressions 6.1 TRUE 1
33 Three address codes 6.2 TRUE 1
Types and declarations, Translation of
34 6.3, 6.4 TRUE 1
Expressions
35 Short Circuit Code 6.6.2 TRUE 1
36 Back Patching, 6.7 TRUE 1
Basic blocks and flow graphs, DAG of Basic
37 8.4,8.5 TRUE 1
Blocks
38 Peephole Optimization 8.7 TRUE 1
39 Run-Time Environment 7 FALSE 1
40 Code Generation 8.1,8.2,8.3 FALSE 1
41 Principal Sources of Optimization 9.1 FALSE 1

Total no. of classes :

Text Book
A. V. Aho, M. S. Lam, R. Sethi, and J. D. Ullman, Compilers: Principles, Techniques and Tools, 2nd Edition, Pearson Education,
2009, ,, ,

Reference Book
K. D. Cooper and L. Torczon, Engineering a Compiler, 2nd Edition, Morgan Kaufmann, 2011, ,, ,
A. I. Holub, Compiler Design in C, 2nd Edition, Prentice Hall of India, 2002, ,, ,
Online Reference Material(s):

1. https://nptel.ac.in/courses/128/106/128106009/: from IIT Madras


2. https://nptel.ac.in/courses/106/105/106105190/: by Prof. S. Chattopadhyay, IIT Kharagpur
3. https://nptel.ac.in/courses/106/104/106104123/: by Prof. S. K. Aggarwal, IIT Kanpur
4. https://nptel.ac.in/courses/106/108/106108113/: by Prof. Y. N. Srikanth, IISc Bangalore
5. https://nptel.ac.in/courses/106/104/106104072/: by Prof. S. K. Aggarwal, IIT Kanpur

Course Outcome:
CO1 Identify phases of a compiler, process of designing lexical analyzer, and apply LEX tool.
CO2 Construct parsing tables and implement parser using BISON tool.
CO3 Understand use of symbol table and design SDT as semantic analyzer for a language.
CO4 Generate intermediate code using lexical analyzer, parser and semantic analyzer.
Translate intermediate code to machine code, handle run-time environment, and apply code
CO5
optimization techniques.

Program Outcomes Relevent to the Course:


Engineering knowledge: Apply the knowledge of mathematics, science, engineering fundamentals,
PO1
and an engineering specialization to the solution of complex engineering problems
Problem analysis: Identify, formulate, review research literature, and analyze complex engineering
PO2 problems reaching substantiated conclusions using first principles of mathematics, natural
sciences, and engineering sciences.
Design/development of solutions: Design solutions for complex engineering problems and design
PO3 system components or processes that meet the specified needs with appropriate consideration for
the public health and safety, and the cultural, societal, and environmental considerations.
Conduct investigations of complex problems: Use research-based knowledge and research methods
PO4 including design of experiments, analysis and interpretation of data, and synthesis of the
information to provide valid conclusions.
Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
PO5 engineering and IT tools including prediction and modeling to complex engineering activities with
an understanding of the limitations.
The engineer and society: Apply reasoning informed by the contextual knowledge to assess
PO6 societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to the
professional engineering practice.
Environment and sustainability: Understand the impact of the professional engineering solutions in
PO7 societal and environmental contexts, and demonstrate the knowledge of, and need for sustainable
development.
Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms of
PO8
the engineering practice.
Individual and team work: Function effectively as an individual, and as a member or leader in
PO9
diverse teams, and in multidisciplinary settings.
Communication: Communicate effectively on complex engineering activities with the engineering
PO10 community and with society at large, such as, being able to comprehend and write effective reports
and design documentation, make effective presentations, and give and receive clear instructions.
Project management and finance: Demonstrate knowledge and understanding of the engineering
PO11 and management principles and apply these to one’s own work, as a member and leader in a team,
to manage projects and in multidisciplinary environments.
Life-long learning: Recognize the need for, and have the preparation and ability to engage in
PO12
independent and life-long learning in the broadest context of technological change.

Mapping of CO's to PO's: (1: Low, 2: Medium, 3: High)


PO1 PO2 PO3 PO4 PO5
CO1 3 3 2 2 2
CO2 3 3 2 2 2
CO3 3 2 2 2
CO4 3 3 2 2
CO5 3 3 2 2

You might also like