SGBAU · Third Year B.E. Computer Science and Engineering (Data Science) · NEP 2020
Compiler Design
5DS221PC · Semester V · 3 credits · IE 40 + ESE 60
Unit 1: Introduction to Compilers
6 hoursLanguage processors and the structure of a compiler; lexical analysis — the role of the lexical analyser, input buffering, specifying and recognising tokens, and the Lex generator.
Examined in the 60-mark end-semester paper
- Compilers, translators and interpreters
- Phases and structure of a compiler
- Role of the lexical analyser
- Input buffering
- Specification and recognition of tokens
- Lexical-analyser generators
Unit 2: Syntax Analysis
6 hoursThe role of the parser, context-free grammars, parse trees and derivations, ambiguity, eliminating left recursion and left factoring; recursive-descent and predictive parsing, FIRST and FOLLOW, LL(1) grammars, non-recursive predictive parsing and error recovery.
Examined in the 60-mark end-semester paper
- Role of the parser
- Top-down and predictive parsing
- FIRST and FOLLOW sets
- Error detection and recovery
- Derivation trees, sentential forms and ambiguity
Unit 3: Bottom-Up Parsing
6 hoursHandle pruning and shift-reduce parsing with a stack and its conflicts; LR parsing — LR(0) items and automaton, the LR algorithm and SLR tables; canonical LR(1) items and tables, and LALR tables.
Examined in the 60-mark end-semester paper
- Shift-reduce parsing
- LR(0) items and SLR parsing
- Canonical LR parsing
- LALR parsing
Unit 4: Syntax-Directed Translation
6 hoursSyntax-directed definitions, inherited and synthesised attributes, evaluation orders and dependency graphs, S-attributed and L-attributed definitions, building syntax trees, and syntax-directed translation schemes.
Examined in the 60-mark end-semester paper
- Syntax-directed definitions
- S-attributed and L-attributed definitions
Unit 5: Intermediate Code Generation
6 hoursVariants of syntax trees — DAGs — and three-address code; run-time environments: storage organisation, static versus dynamic allocation, stack allocation, activation trees and records, calling sequences, and the design goals of garbage collectors.
Examined in the 60-mark end-semester paper
- Intermediate code: postfix and syntax trees
- Three-address code: quadruples and triples
- DAG representation of basic blocks
- Run-time storage organisation and activation records
Unit 6: Code Generation
6 hoursIssues in code-generator design, the target language and addresses in target code, basic blocks and flow graphs, optimising basic blocks, peephole optimisation, and the principal sources of optimisation — global common subexpressions, copy propagation and dead-code elimination.
Examined in the 60-mark end-semester paper
- Issues in code generation
- Basic blocks and flow graphs
- Peephole optimisation
- Local and global optimisation
Unit contents are summarised from the official SGBAU syllabus . AiCanCode.org is not affiliated with Sant Gadge Baba Amravati University (SGBAU).