Compiler Construction

Compiler Construction



1. Introduction

1. Introduction
 1. Definition of Compiler, Aspects of compilation.
 2. The structure of Compiler.
 3. Phases of Compiler – Lexical Analysis,Syntax Analysis, Semantic Analysis, Intermediate Code generation, code optimization, code generation.
 4. Error Handling
 5. Introduction to one pass & Multipass compilers, cross compiler, Bootstrapping.
MCQ Link1

MCQ Link2

MCQ Link3

2. Lexical Analysis(Scanner)

2. Lexical Analysis(Scanner)
 1. Review of Finite automata as a lexical analyzer
 2. Applications of Regular Expressions and Finite Automata ( lexical analyzer, searching using RE), Input buffering, Recognition of tokens
 3. LEX: A Lexical analyzer generator (Simple Lex Program) 
MCQ Link1
MCQ Link2

3. Syntax Analysis(Parser)

3. Syntax Analysis(Parser)
 1. Definition, Types of Parsers
 2. Top-Down Parser –
 i) Top-Down Parsing with Backtracking: Method & Problems
 ii) Drawbacks of Top-Down parsing with backtracking
 iii) Elimination of Left Recursion(direct & indirect)
 iv) Need for Left Factoring & examples
 3. Recursive Descent Parsing : Definition   :Implementation of Recursive Descent Parser Using Recursive Procedures
 4. Predictive [LL(1)]Parser(Definition, Model) 
 i) Implementation of Predictive Parser[LL(1)]
 ii) FIRST & FOLLOW
 iii) Construction of LL(1) Parsing Table
 iv) Parsing of a String using LL(1) Table
 5. Bottom-Up Parsers
 6. Operator Precedence Parser -Basic Concepts
 i) perator Precedence Relations form Associativity & Precedence
 ii) Operator Precedence Grammar
 iii) Algorithm for LEADING & TRAILING(with ex.)
 iv) Algorithm for Operator Precedence Parsing (with ex.)
 v) Precedence Functions
 7. Shift Reduce Parser
 i) Reduction, Handle, Handle Pruning
 ii) Stack Implementation of Shift Reduce Parser ( with examples)
 8. LR Parser
 i) Model
 ii) 3.8.2Types [SLR(1), Canonical LR, LALR] Method & examples.
 9. YACC (from Book 3) –program sections, simple YACC program for expression evaluation
MCQ Link1

MCQ Link2

MCQ Link3

MCQ Link4

MCQ Link5

MCQ Link6

MCQ Link7

4. Syntax Directed Definition

4. Syntax Directed Definition
 1. Syntax Directed Definitions(SDD)
 i) Inherited & Synthesized Attributes
 ii) Evaluating an SDD at the nodes of a Parse Tree, Example
 2. Evaluation Orders for SDD’s
 i) Dependency Graph
 ii) Ordering the Evaluation of Attributes
 iii) S-Attributed Definition
 iv) L-Attributed Definition
 3. Application of SDT  
 i) Construction of syntax trees
 ii) The Structure of a Type
 4. Translation Schemes 
 i) Definition, Postfix Translation Scheme
MCQ Link1

MCQ Link2

5. Memory Allocation

5. Memory Allocation
 1. Memory allocation – static and dynamic memory allocation
 2. Memory allocation in block structure languages, Array allocation and access.
MCQ Link1
MCQ Link2

6. Code Generation and Optimization

6. Code Generation and Optimization
 1. Compilation of expression –
 i) Concepts of operand descriptors and register descriptors with example.
 ii) Intermediate code for expressions – postfix notations
 iii) triples and quadruples, expression trees.
 2. Code Optimization – Optimizing transformations – compile time evaluation, elimination of common sub expressions, dead code elimination, frequency reduction, strength reduction
 3. Three address code  
 i) DAG for Three address code
 ii) The Value-number method for constructing DAG’s.
 4. Definition of basic block, Basic blocks And flow graphs 
 5. Directed acyclic graph (DAG) representation of basic block
 6. Issues in design of code generator
MCQ Link1

MCQ Link2