RTMNU · Third Year B.Tech Computer Science & Engineering (AI & ML) · NEP 2020
Principles of Compiler Design
BCSEAI&ML6T22 · Semester VI · 3 credits · College 30 + university 70
Unit 1: Introduction to Compiler
7 hoursCompilers, interpreters and assemblers; the phases of a compiler; compiler-construction tools (LEX and YACC); bootstrapping and cross compilers; error handling; top-down parsing, FIRST and FOLLOW and the LL(1) parser.
Examined in the 70-mark end-semester paper
- Compilers, translators and interpreters
- Phases and structure of a compiler
- Bootstrapping and compiler-construction tools
- Error detection and recovery
- Top-down and predictive parsing
- FIRST and FOLLOW sets
Unit 2: Syntax Analysis
8 hoursBottom-up parsing: shift-reduce and LR parsing with SLR, CLR and LALR; operator grammars; ambiguity; parser generators (yacc, bison).
Examined in the 70-mark end-semester paper
- Shift-reduce parsing
- LR(0) items and SLR parsing
- Canonical LR parsing
- LALR parsing
- Operator-precedence parsing
- Parser generators: YACC
Unit 3: Semantic Analysis & Symbol Table
7 hoursAttribute grammars, syntax-directed definitions, their evaluation and the flow of attributes in a syntax tree; syntax-directed translation; the structure, attributes and management of the symbol table; the run-time environment: procedure activation, parameter passing, value return and memory allocation.
Examined in the 70-mark end-semester paper
- Syntax-directed definitions
- S-attributed and L-attributed definitions
- Symbol tables and scope
- Run-time storage organisation and activation records
Unit 4: Intermediate Code Generation
7 hoursTranslating language features; types of intermediate forms; code improvement, control flow, basic blocks and flow graphs, data dependence; local, global and peephole optimisation.
Examined in the 70-mark end-semester paper
- Intermediate code: postfix and syntax trees
- Three-address code: quadruples and triples
- Basic blocks and flow graphs
- Data-flow analysis
- Local and global optimisation
- Peephole optimisation
Unit 5: Architecture-Dependent Code Improvement
7 hoursInstruction scheduling for pipelines; loop optimisation for the cache; register allocation and target-code generation; type systems and data abstraction; compiling object-oriented features and non-imperative languages.
Examined in the 70-mark end-semester paper
- Instruction scheduling for pipelines
- Loop optimisation
- Register allocation
- Issues in code generation
- Type checking and type conversion
- Compiling object-oriented and non-imperative languages
Unit contents are summarised from the official RTMNU syllabus . AiCanCode.org is not affiliated with Rashtrasant Tukadoji Maharaj Nagpur University (RTMNU).