Compiler Design
Compiler Design
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
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):
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.