, SYLLABUS
BCS-305 COMPILER DESIGN (3-1-0) Credit-04
Module-I (10 Lectures)
Introduction to Compiling:
Compilers, Analysis of the source programe, The phases of a compiler, Cousins of the compiler,
The grouping of phases, Compiler-construction tools
A Simple One-Pass Compiler:
Overview, Syntax definition, Syntax-directed translation, Parsing, A translator for simple
expressions, Lexical analysis, Incorporating a symbol table, Abstract stack machines, Putting the
techniques together
Lexical Analysis:
The role of the lexical analyzer, Input buffering, Specification of tokens, Recognition of tokens,
A language for specifying lexical analyzers, Finite automata, From a regular expression to an
NFA, Design of a lexical analyzer generator, Optimization of DFA-based pattern matchers
Module-II (15 Lectures)
Syntax Analysis:
ES . I N
KTU NOT
The role of the parser, Context-free grammars, Writing a grammar, Top-down parsing, Bottom-
up parsing, Operator-precedence parsing, LR parsers, Using ambiguous grammars, Parser
generators
Syntax-Directed Translation:
Syntax-directed definitions, Construction of syntax trees, Bottom-up evaluation of S-attributed
definitions, L-attributed definitions, Top-down translation, Bottom-up evaluation of inherited
attributes, Recursive evaluators, Space for attribute values at compile time, Assigning space at
compile time, Analysis of syntax-directed definitions
Module-III (6 Lectures)
Type Checking:
Type systems, Specification of a simple type checker, Equivalence of type expressions, Type
conversions, Overloading of functions and operators, Polymorphic functions, An algorithm for
unification
Run-Time Environments:
Source language issues, Storage organization, Storage-allocation strategies, Access to nonlocal
names, parameter passing, Symbol tables, Language facilities for dynamic storage allocation,
Dynamic storage allocation techniques, Storage allocation in Fortran
Downloaded from Ktunotes.in
,Module-IV (9 Lectures)
Intermediate Code Generation:
Intermediate languages, Declarations, Assignment statements, Boolean expressions, Case
statements, Back Patching, Procedure calls
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, Register
allocation and assignment, The dag representation of basic blocks, Peephole optimization,
Generating code from dags, Dynamic programming code-generation algorithm, Code-generator
generators
Code Optimization:
Introduction, The Principal sources of optimization, Optimization of basic blocks, Loops in flow
graphs, Introduction to global data-flow analysis, Iterative solution of data-flow equations, Code-
improving transformations, Dealing with aliases, Data-flow analysis of structured flow graphs,
Efficient data-flow algorithms, A tool for data-flow analysis, Estimation of types, Symbolic
debugging of optimized code.
Text Books:
ES . I N
NOT
1. Compilers Principles, Techniques, & Tools, by A.V.Aho, R.Sethi & J.D.Ullman, Pearson
Education
KTU
2. Principle of Compiler Design, A.V.Aho and J.D. Ullman, Addition – Wesley
of CSE - 2 -
Downloaded from Ktunotes.in
, LESSION PLAN
Course Code:BCS-303 COMPILER DESIGN(3-0-0)
6th Semester Lecture Classes: 40
Lecture-1
Overview of systems, why we study programming languages?, attributes of a
good language, classification of programming languages.
Ref: Principles of programming languages, Rabi Sethi
Lecture-2
Introduction to Compiler, Cousins of Compiler(Translator, assembler,
interpreter, loader, linker etc), Phases of Compilers.
Ref: Principle of Compiler Design, A.V.Aho, Rabi Sethi, J.D.Ullman
Lecture-3
Operation in each phases of a Compiler, lexical analyzer, syntax analyzer,
semantics analyzer, symbol table manager, error handler, intermediate code generator,
code optimizer, code generator.
Ref: Principle of Compiler Design, A.V.Aho, Rabi Sethi, J.D.Ullman
Lecture-4
S . I N
Compiler Construction Tools, Parser generators, Scanner generators, syntax
E
N O T
directed translation engines, automatic code generator, data flow engine.
KTU
Ref: Principle of Compiler Design, A.V.Aho, Rabi Sethi, J.D.Ullman
Lecture-5
Role of the lexical analyzer, issues in lexical analysis, tokens, patterns,
lexemes.
Ref: Principle of Compiler Design, A.V.Aho, Rabi Sethi, J.D.Ullman
Lecture-6
Lexical errors and error recovery actions, Input buffering.
Ref: Principle of Compiler Design, A.V.Aho, Rabi Sethi, J.D.Ullman
Lecture-7
Specification of tokens, Strings and languages, Finite automata, DFA, NFA.
Ref: Principle of Compiler Design, A.V.Aho, Rabi Sethi, J.D.Ullman
Automata Theory, KLP Mishra, N. Chandrasekharan
Automata Theory, AV Aho, JD Ullman
Lecture-8
Equivalence of NFA and DFA, Conversion of NFA to DFA.
Ref: Automata Theory, KLP Mishra, N. Chandrasekharan
Automata Theory, AV Aho, JD Ullman
Lecture-9
Minimizing states of DFA, Є-NFA,
Ref: Automata Theory, KLP Mishra, N. Chandrasekharan
Automata Theory, AV Aho, JD Ullman
Downloaded from Ktunotes.in
BCS-305 COMPILER DESIGN (3-1-0) Credit-04
Module-I (10 Lectures)
Introduction to Compiling:
Compilers, Analysis of the source programe, The phases of a compiler, Cousins of the compiler,
The grouping of phases, Compiler-construction tools
A Simple One-Pass Compiler:
Overview, Syntax definition, Syntax-directed translation, Parsing, A translator for simple
expressions, Lexical analysis, Incorporating a symbol table, Abstract stack machines, Putting the
techniques together
Lexical Analysis:
The role of the lexical analyzer, Input buffering, Specification of tokens, Recognition of tokens,
A language for specifying lexical analyzers, Finite automata, From a regular expression to an
NFA, Design of a lexical analyzer generator, Optimization of DFA-based pattern matchers
Module-II (15 Lectures)
Syntax Analysis:
ES . I N
KTU NOT
The role of the parser, Context-free grammars, Writing a grammar, Top-down parsing, Bottom-
up parsing, Operator-precedence parsing, LR parsers, Using ambiguous grammars, Parser
generators
Syntax-Directed Translation:
Syntax-directed definitions, Construction of syntax trees, Bottom-up evaluation of S-attributed
definitions, L-attributed definitions, Top-down translation, Bottom-up evaluation of inherited
attributes, Recursive evaluators, Space for attribute values at compile time, Assigning space at
compile time, Analysis of syntax-directed definitions
Module-III (6 Lectures)
Type Checking:
Type systems, Specification of a simple type checker, Equivalence of type expressions, Type
conversions, Overloading of functions and operators, Polymorphic functions, An algorithm for
unification
Run-Time Environments:
Source language issues, Storage organization, Storage-allocation strategies, Access to nonlocal
names, parameter passing, Symbol tables, Language facilities for dynamic storage allocation,
Dynamic storage allocation techniques, Storage allocation in Fortran
Downloaded from Ktunotes.in
,Module-IV (9 Lectures)
Intermediate Code Generation:
Intermediate languages, Declarations, Assignment statements, Boolean expressions, Case
statements, Back Patching, Procedure calls
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, Register
allocation and assignment, The dag representation of basic blocks, Peephole optimization,
Generating code from dags, Dynamic programming code-generation algorithm, Code-generator
generators
Code Optimization:
Introduction, The Principal sources of optimization, Optimization of basic blocks, Loops in flow
graphs, Introduction to global data-flow analysis, Iterative solution of data-flow equations, Code-
improving transformations, Dealing with aliases, Data-flow analysis of structured flow graphs,
Efficient data-flow algorithms, A tool for data-flow analysis, Estimation of types, Symbolic
debugging of optimized code.
Text Books:
ES . I N
NOT
1. Compilers Principles, Techniques, & Tools, by A.V.Aho, R.Sethi & J.D.Ullman, Pearson
Education
KTU
2. Principle of Compiler Design, A.V.Aho and J.D. Ullman, Addition – Wesley
of CSE - 2 -
Downloaded from Ktunotes.in
, LESSION PLAN
Course Code:BCS-303 COMPILER DESIGN(3-0-0)
6th Semester Lecture Classes: 40
Lecture-1
Overview of systems, why we study programming languages?, attributes of a
good language, classification of programming languages.
Ref: Principles of programming languages, Rabi Sethi
Lecture-2
Introduction to Compiler, Cousins of Compiler(Translator, assembler,
interpreter, loader, linker etc), Phases of Compilers.
Ref: Principle of Compiler Design, A.V.Aho, Rabi Sethi, J.D.Ullman
Lecture-3
Operation in each phases of a Compiler, lexical analyzer, syntax analyzer,
semantics analyzer, symbol table manager, error handler, intermediate code generator,
code optimizer, code generator.
Ref: Principle of Compiler Design, A.V.Aho, Rabi Sethi, J.D.Ullman
Lecture-4
S . I N
Compiler Construction Tools, Parser generators, Scanner generators, syntax
E
N O T
directed translation engines, automatic code generator, data flow engine.
KTU
Ref: Principle of Compiler Design, A.V.Aho, Rabi Sethi, J.D.Ullman
Lecture-5
Role of the lexical analyzer, issues in lexical analysis, tokens, patterns,
lexemes.
Ref: Principle of Compiler Design, A.V.Aho, Rabi Sethi, J.D.Ullman
Lecture-6
Lexical errors and error recovery actions, Input buffering.
Ref: Principle of Compiler Design, A.V.Aho, Rabi Sethi, J.D.Ullman
Lecture-7
Specification of tokens, Strings and languages, Finite automata, DFA, NFA.
Ref: Principle of Compiler Design, A.V.Aho, Rabi Sethi, J.D.Ullman
Automata Theory, KLP Mishra, N. Chandrasekharan
Automata Theory, AV Aho, JD Ullman
Lecture-8
Equivalence of NFA and DFA, Conversion of NFA to DFA.
Ref: Automata Theory, KLP Mishra, N. Chandrasekharan
Automata Theory, AV Aho, JD Ullman
Lecture-9
Minimizing states of DFA, Є-NFA,
Ref: Automata Theory, KLP Mishra, N. Chandrasekharan
Automata Theory, AV Aho, JD Ullman
Downloaded from Ktunotes.in