SPPU · Final Year Computer Engineering · 2019 Course (Revised)
Compiler Design
410641 · Semester VII · 3 credits · In-semester 30 + end-semester 70
Unit 1: Introduction to Compiler Design
7 hoursThe translation process; compilers vs interpreters and assemblers; linkers and loaders; types of compilers; the phases, cousins and grouping of phases; front end and back end; pass structure.
Marks: 15 in the in-semester exam
- Language processors: compilers, interpreters, assemblers, linkers and loaders
- Phases of a compiler
- Front end, back end and passes
Unit 2: Lexical Analyzer
7 hoursRole of the lexical analyser, input buffering, specifying and recognising tokens; Lex and Flex; finite automata from regular expressions; designing a lexical-analyser generator; DFA optimisation.
Marks: 15 in the in-semester exam
- Role of the lexical analyser and input buffering
- Specifying and recognising tokens
- Lex and Flex
- Regular expressions to automata for lexers
- Optimising the lexer DFA
Unit 3: Parsing Theory
8 hoursTop-down and bottom-up parsing, operator-precedence parsing, LR parsers, ambiguous grammars, parser generators (YACC/Bison); syntax-directed definitions, syntax trees, S- and L-attributed definitions, translation schemes.
Marks: 17–18 in the end-semester exam
- Top-down parsing: recursive descent and LL(1)
- Bottom-up parsing and shift-reduce
- Operator-precedence parsing
- LR parsers: SLR, CLR and LALR
- Parser generators: YACC and Bison
- Syntax-directed definitions and translation schemes
- S-attributed and L-attributed definitions
Unit 4: Error Recovery & Intermediate Code Generation
7 hoursError detection and recovery, ad-hoc and systematic methods; intermediate forms; syntax-directed translation into intermediate code.
Marks: 17–18 in the end-semester exam
- Error detection and recovery in compilers
- Intermediate code: syntax trees, postfix and three-address code
- Translating to three-address code
- Backpatching
Unit 5: Run-Time Memory Management & Symbol Tables
7 hoursSource language issues, storage organisation and allocation strategies, access to non-local names, parameter passing, dynamic storage allocation; symbol tables: purpose, entries, implementation (lists, hash tables, BSTs) and nested scopes.
Marks: 17–18 in the end-semester exam
- Run-time storage organisation and activation records
- Storage allocation strategies
- Access to non-local names and parameter passing
- Dynamic storage allocation
- Symbol tables: entries, implementation and scopes
Unit 6: Code Optimization & Code Generation
8 hoursGlobal data-flow analysis; common subexpression elimination, loop-invariant code motion, strength reduction; code generator design, the target machine, basic blocks and flow graphs, next-use, register allocation, DAGs, peephole optimisation, dynamic-programming code generation.
Marks: 17–18 in the end-semester exam
- Basic blocks and flow graphs
- Data-flow analysis
- Machine-independent optimisations
- Code generator design and the target machine
- Register allocation and assignment
- DAG representation of basic blocks
- Peephole optimisation
Unit contents are summarised from the official SPPU syllabus . AiCanCode.org is not affiliated with Savitribai Phule Pune University.