Compiler Syllabus
Compiler Syllabus
N H
1 Compiler Design 3 0 0 3 0 36 PE
CST-350
PRE-REQUISITE Must have basic knowledge of data structure and theory of computation.
a. Course Description
This course focuses mainly on the design of compilers and optimization techniques. This will provide deeper
insights into the more advanced semantics aspects of programming languages, code generation, machine
independent optimizations, dynamic memory allocation, types and their inferences, object orientation.
b. Course Objectives
Provide student with an understanding of the fundamental concepts of compiler design as well as the skills
required to create compilers for different perspectives that one could experience in a career in computer science.
Provide the practical exposure to aspects of theoretical computer science including Languages, Grammars, and
Machines.
To apply the optimization techniques to have a better code for code generation.
c. Course Outcomes
CO1 Understand the context and use of a compiler.
CO2 Understanding application of finite state machine and Syntax Analyzing using different types of parsing
techniques.
CO3 Understand the implementation of back end include intermediate code generation, run time environment,
code generation and register allocation
CO4 Understanding and analyzing the program to minimize the code by using code optimization techniques
CO5 Understand compilation techniques needed to obtain high performance on modern computer architectures
d. Syllabus
Unit-1 Introduction to Compiler and Syntax Analysis Contact Hours: 15
Introduction Phases of compilation and overview. Lexical Analysis (scanner): Regular languages, finite
automata, regular expressions, relating regular expressions and finite automata, scanner
generator (lex, flex).
Syntax Analysis Context-free languages and grammars, push-down automata, LL(1) grammars and top-down
(Parsers) and Top- parsing Recursive Descent and LL(1).
Down Parsing
Bottom-Up Parsing Shift Reduce Parser , LR(O), SLR(1), LR(1), CLR grammars, Operator Precedence Parser,
Construction of table of Operator Precedence, ambiguity and LR parsing, LALR(1) parser
generator (yacc, bison)
Unit-2 Syntax Directed Translation Contact Hours: 15
Semantic Analysis Attribute grammars, syntax directed definition, evaluation and flow of attribute in a syntax
tree.
Symbol Table Basic structure, symbol attributes and management. Run-time environment: Procedure
activation, parameter passing, value return, memory allocation, scope.
Intermediate Code
Generation Translation of different language features, different types of intermediate forms.
Architecture dependent
code improvement Instruction scheduling (for pipeline), loop optimization (for cache memory) etc. Register
allocation and target code generation.
Advanced topics
Type systems, data abstraction, compilation of Object-Oriented features and non-imperative
programming languages.
e. Textbooks
T1. ‘Compilers: Principles, Techniques and Tools’ by Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman, Low
Price Edition, Pearson Education
f. Reference Books
R1. Compiler Construction by Thomas W. Parsons. New York: Computer Science Press
R2. “Modern Compiler Implementation in C”, Andrew N. Appel, Cambridge University Press
Marks 40 60
Total Marks 100
Internal Evaluation Component
g. CO-PO Mapping
Course
PO PO1
Outcom PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO9 PO10 PO12 PSO1 PSO2 PSO3
8 1
e
CO1
CO2
CO3
CO4
COn