SUK · Third Year B.Tech. Computer Science and Engineering · NEP 2020
Compiler Construction
CSE3202 · Semester VI · 4 credits · ISE 10 + mid-semester 30 + ESE 60
3 lectures and 1 tutorial a week, 4 credits; term work is 10 to 12 tutorials across the syllabus.
Unit 1: Introduction
5 hoursCompilers, the phases of a compiler, compiler construction tools and the cousins of the compiler.
Examined in the 60-mark end-semester paper, and in the mid-semester exam if it is taught by then
- Language processors: compilers, interpreters, assemblers, linkers and loaders
- Phases of a compiler
- Bootstrapping and compiler-construction tools
Unit 2: Lexical Analysis
6 hoursThe role of the lexical analyser; input buffering; specifying and recognising tokens; finite automata; designing a lexical analyser generator.
Examined in the 60-mark end-semester paper, and in the mid-semester exam if it is taught by then
- 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
7 hoursThe role of the parser; writing context-free grammars; top-down parsing: recursive descent and predictive (LL) parsers; bottom-up parsing: operator precedence, LR, SLR and LALR parsers.
Examined in the 60-mark end-semester paper, and in the mid-semester exam if it is taught by then
- Top-down parsing: recursive descent and LL(1)
- FIRST and FOLLOW sets and predictive parsing tables
- Bottom-up parsing and shift-reduce
- Operator-precedence parsing
- LR parsers: SLR, CLR and LALR
Unit 4: Syntax-Directed Translation and Intermediate Code Generation
7 hoursSyntax-directed definitions; constructing syntax trees; S-attributed and L-attributed definitions; intermediate languages; assignment statements; backpatching.
Examined in the 60-mark end-semester paper, and in the mid-semester exam if it is taught by then
- Syntax-directed definitions and translation schemes
- S-attributed and L-attributed definitions
- Intermediate code: syntax trees, postfix and three-address code
- Translating to three-address code
- Backpatching
Unit 5: Code Optimisation
5 hoursThe principal sources of optimisation; optimising basic blocks; loops in flow graphs; peephole optimisation.
Examined in the 60-mark end-semester paper, and in the mid-semester exam if it is taught by then
- Machine-independent optimisations
- Loop optimisation: code motion, induction variables, unrolling and jamming
- Peephole optimisation
Unit 6: Code Generation
6 hoursIssues in the design of a code generator and the target machine; run-time storage management; basic blocks and flow graphs; next-use information and a simple code generator; register allocation; code generation from DAGs.
Examined in the 60-mark end-semester paper, and in the mid-semester exam if it is taught by then
- Code generator design and the target machine
- Run-time storage organisation and activation records
- Basic blocks and flow graphs
- Register allocation and assignment
- DAG representation of basic blocks
Unit contents are summarised from the official SUK syllabus . AiCanCode.org is not affiliated with Shivaji University, Kolhapur.