Compiler Design

Learning Outcomes: 
After learning the course the students should be able to:
• Understand the basic concepts and application of Compiler Design
• Understand various Code optimization Techniques and Error Recovery mechanisms.
• Understand and Implement a Parser
• Apply their basic knowledge Data Structure to design Symbol Table, Lexical Analyzer, Intermediate Code Generation, Parser (Top-Down and Bottom-up Design) and will able to understand strength of Grammar and Programming Language.
Syllabus: 
Unit NoTopics
1

Introduction:

 Overview of the Translation Process, A Simple Compiler, Difference between interpreter, assembler and compiler. Overview and use of linker and loader, types of Compiler, Analysis of the Source Program, The Phases of a Compiler, Cousins of the Compiler, The Grouping of Phases, Lexical Analysis, Hard Coding and Automatic Generation Lexical Analyzers, Front-end and Back-end of compiler, pass structure 

2

Lexical Analyzer:

 Introduction to Lexical Analyzer, Input Buffering, Specification of Tokens, Recognition of Tokens, A Language for Specifying Lexical Analyzers, Finite Automata From a Regular Expression, Design of a Lexical Analyzer Generator, Optimization of DFA 

3

Parsing Theory:

 Top Down and Bottom up Parsing Algorithms, Top-Down Parsing, Bottom-Up Parsing, Operator-Precedence Parsing, LR Parsers, Using Ambiguous Grammars, Parser Generators, Automatic Generation of Parsers. Syntax-Directed Definitions, Construction of Syntax Trees, Bottom-Up Evaluation of S-Attributed Definitions, L-Attributed Definitions, syntax directed definitions and translation schemes 

4

Error Recovery:

Error Detection & Recovery, Ad-Hoc and Systematic Methods 

5

Intermediate Code Generation:

Different Intermediate Forms-Abstract Syntax tree ,Polish Notation, 3 address code ,Implementation of 3 address code-Quadruple, Triples and Indirect triples, Syntax Directed Translation Mechanisms And Attributed Mechanisms And Attributed Definition

6

Code Optimization:

Need of Code Optimization, Classification of Optimization, A Few Selected Optimizations –Compile Time Evaluation, Command Sub Expression Removal, Variable Propagation, Code Motion, Strength Reduction, Dead Code Elimination, Loop Optimization, Global Data Flow analysis

7

Code Generation:

Issues in the Design of a Code Generator, The Target Machine, Run-Time Storage Management, Basic Blocks and Flow Graphs, Next-Use Information, A Simple Code Generator, The DAG Representation of Basic Blocks, Peephole Optimization

8

Run Time Memory Management:

Source Language Issues, Storage Organization, Storage-Allocation Strategies, and Access to Non local Names, Parameter Passing, Symbol Tables, and Language Facilities for Dynamic Storage Allocation, Dynamic Storage Allocation Techniques

Text Books: 
Name : 
Compilers: Principles, Techniques and Tools
Author: 
By Aho, Lam, Sethi
Ullman,
Publication: 
Pearson, 2014
Edition: 
Second Edition
Reference Books: 
Name: 
Compilers: Principles, Techniques and Tools
Author: 
By Aho, Sethi,
Ullman
Publication: 
Addison-Wesley,1986
Name: 
Compiler Design in C
Author: 
By Allen I. Holub
Publication: 
Prentice-Hall/Pearson
Name: 
Advanced Compiler Design and Implementation
Author: 
By Muchnick
Morgan
Kaufmann
Publication: 
1998
Syllabus PDF: 
AttachmentSize
PDF icon COMPILER DESIGN.pdf208.27 KB
branch: 
CBA
BDA
MA
Course: 
2018
Stream: 
B.Tech