Compiler Design (PCC-CS501)
9 units: · L-T-P 3L/week.
Detailed syllabus
Unit 1 (3 hours)
Introduction to Compiling Compilers, Analysis of the source program, The phases of the compiler, Cousins of the compiler
Unit 2 (6 hours)
Lexical Analysis The role of the lexical analyzer, Tokens, Patterns, 6 Lexemes, Input buffering, Specifications of a token, Recognition of a tokens, Finite automata, From a regular expression to an NFA, From a regular expression to NFA, From a regular expression to DFA, Design of a lexical analyzer generator (Lex).
Unit 3 (9 hours)
Syntax Analysis The role of a parser, Context free grammars, Writing a grammar, Top down Parsing, Nonrecursive Predictive parsing (LL), Bottom up parsing, Handles, Viable prefixes, Operator precedence parsing, LR parsers (SLR, LALR), Parser generators (YACC). Error Recovery strategies for different parsing techniques.
Unit 4 (5 hours)
Syntax directed translation Syntax director definitions, Construction of syntax trees, Bottom-up evaluation of S attributed definitions, L attributed definitions, Bottom-up evaluation of inherited attributes.
Unit 5 (4 hours)
Type checking Type systems, Specification of a simple type checker, Equivalence of type expressions, Type conversions
Unit 6 (5 hours)
Run time environments Source language issues (Activation trees, Control stack, scope of declaration, Binding of names), Storage organization (Subdivision of run-time memory, Activation records), Storage allocation strategies, Parameter passing (call by value, call by reference, copy restore, call by name), Symbol tables, dynamic storage allocation techniques
Unit 7 (4 hours)
Intermediate code generation Intermediate languages, Graphical representation, Three- address code, Implementation of three address statements (Quadruples, Triples, Indirect triples).
Unit 8 (5 hours)
Code optimization Introduction, Basic blocks & flow graphs, Transformation of basic blocks, Dag representation of basic blocks, The principle sources of optimization, Loops in flow graph, Peephole optimization.
Unit 9 (4 hours)
Code generations Issues in the design of code generator, a simple code generator, Register allocation & assignment
Source: official document