To understand the theory and practice of compiler implementation. To learn finite
state machines and lexical scanning. To learn context free grammars, compiler
parsing techniques, construction of abstract syntax ... Code optimization: principle
sources of optimization, Scope of Optimization, local ... 3 Kenneth C.Louden.
III Year B.Tech. IT
I - Semester
IT301
L 3
T 1
P To - 4
C 4
THEORY OF COMPUTATION AND COMPILER DESIGN
Objective of the Course : Provide the foundation for understanding the theory and practice of compilers. Learn programming language translation and compiler design concepts; language recognition, symbol table management, semantic analysis and code generation. To understand the theory and practice of compiler implementation. To learn finite state machines and lexical scanning. To learn context free grammars, compiler parsing techniques, construction of abstract syntax trees, symbol tables, intermediate machine representations and actual code generation. UNIT – I Finite automata:Strings,alphabets,and languages, Finite state systems, Basic definitions,non- deterministic finite automata, deterministic finite automata,Finite automata with e-moves, regular expressions. Context free grammars and Languages : Context free grammars,parse trees.(textbook-2) UNIT – II Overview of compilation:Phases of Compilation – Lexical Analysis, pass and Phases of translation, interpretation, bootstrapping, data structures in compilation – LEX lexical analyzer generator. (textbook-1) Top down Parsing: Backtracking, LL (1), recursive descent parsing, Predictive parsing, Pre-processing steps required for predictive parsing. UNIT – III Bottom up parsing: Shift Reduce parsing, LR and LALR parsing,, handling ambiguous grammar, YACC – automatic parser generator. Semantic analysis: Intermediate forms of source Programs – abstract syntax tree, polish notation and three address codes. Attributed grammars, Syntax directed translation, Conversion of popular Programming languages language Constructs into Intermediate code forms, Type checker. (textbook1) UNIT – IV Code optimization: principle sources of optimization, Scope of Optimization, local optimization, loop optimization, frequency reduction, folding, copy propagation. Data flow analysis: Basic blocks, Flow graph, data flow equation, global optimization, data flow analysis for structured Programs.(textbook-1). UNIT – V Object code generation : Issues in the design of a code generator, Object code forms, peephole optimization,DAG representation of basic blocks, generating code from DAG’s, register allocation and assignment, generic code generation algorithms, DAG for register allocation. (text book-1) TEXT BOOKS : 1. A.V. Aho . J.D.Ullman,Ravi Sethi, “Compilers Principles, techniques, and tools”, 2nd ed., pearson Education, 2003. (units 2,3,4,5) 2. JohnE.Hopocroft,Jeffery D.Ullman “Introduction to automata theory, Languages, and computation” 2nd ed., Narosa Publications, 2003 (unit 1). REFERENCE BOOKS : 1. A.V. Aho . J.D.Ullman “Principles of compiler design”, 1st ed., Pearson Education, 2003. 2
John R. Levine, Tony Mason, Doug Brown, “lex &yacc”, 1st ed., O’reilly, 2004.
3
Kenneth C.Louden. “Complier construction : Principles and practice”, 3rd ed., course Technologies, 2007.