BAMU · Final Year B.E. Computer Science and Engineering · CBCS (2019)
Principles of Compiler Design
CSE402 · Semester VII · 4 credits · CT 20 + theory 80
Unit 1: Introduction to Compilers
6 hoursCompilers and translators, the structure of a compiler, bootstrapping, compiler-construction tools and programming-language basics.
Examined in the 80-mark end-semester paper
- Language processors: compilers, interpreters, assemblers, linkers and loaders
- Phases of a compiler
- Bootstrapping and compiler-construction tools
Unit 2: Lexical Analysis
6 hoursRole of the lexical analyser, input buffering, specification and recognition of tokens, finite automata and the design of a lexical-analyser generator.
Examined in the 80-mark end-semester paper
- Role of the lexical analyser and input buffering
- Specifying and recognising tokens
- Regular expressions to automata for lexers
- Lex and Flex
Unit 3: Syntax Analysis
8 hoursRole of the parser; shift-reduce and top-down parsing; predictive parsing with FIRST and FOLLOW and its table; LR parsers, the canonical LR(0) collection and LALR; YACC and error handling with YACC.
Examined in the 80-mark end-semester paper
- Bottom-up parsing and shift-reduce
- Top-down parsing: recursive descent and LL(1)
- FIRST and FOLLOW sets and predictive parsing tables
- LR parsers: SLR, CLR and LALR
- Parser generators: YACC and Bison
Unit 4: Syntax-Directed Translation
8 hoursSyntax-directed definitions, syntax trees, S- and L-attributed definitions, top-down and bottom-up evaluation of attributes; type systems, a simple type checker, type equivalence and conversions.
Examined in the 80-mark end-semester paper
- Syntax-directed definitions and translation schemes
- S-attributed and L-attributed definitions
- Type checking
- Type equivalence and type conversions
Unit 5: Intermediate Code Generation, Symbol Table, Error Detection and Recovery
6 hoursPostfix notation, syntax trees and three-address code as quadruples, triples and indirect triples; symbol-table contents, data structures and scope; lexical, syntactic and semantic errors.
Examined in the 80-mark end-semester paper
- Intermediate code: syntax trees, postfix and three-address code
- Quadruples, triples and indirect triples
- Symbol tables: entries, implementation and scopes
- Error detection and recovery in compilers
Unit 6: Code Optimisation
6 hoursSources of optimisation; basic blocks, flow graphs and loop optimisation (code motion, induction variables, unrolling, jamming, constant folding); DAGs; global data-flow analysis; a simple code generator, register allocation and peephole optimisation.
Examined in the 80-mark end-semester paper
- Basic blocks and flow graphs
- Loop optimisation: code motion, induction variables, unrolling and jamming
- DAG representation of basic blocks
- Data-flow analysis
- Code generator design and the target machine
- Register allocation and assignment
- Peephole optimisation
Unit contents are summarised from the official BAMU syllabus . AiCanCode.org is not affiliated with Dr. Babasaheb Ambedkar Marathwada University (BAMU).