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 &amp Multipass compilers, cross compiler, Bootstrapping.
CLICK1

CLICK2

CLICK3
CLICK4

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) 

3. Syntax Analysis(Parser)

3. Syntax Analysis(Parser)
 1. Definition, Types of Parsers
 2. Top-Down Parser –
 i) Top-Down Parsing with Backtracking: Method &amp Problems
 ii) Drawbacks of Top-Down parsing with backtracking
 iii) Elimination of Left Recursion(direct &amp indirect)
 iv) Need for Left Factoring &amp 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 &amp 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 &amp Precedence
 ii) Operator Precedence Grammar
 iii) Algorithm for LEADING &amp 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 &amp examples.
 9. YACC (from Book 3) –program sections, simple YACC program for expression evaluation

4. Syntax Directed Definition

4. Syntax Directed Definition
 1. Syntax Directed Definitions(SDD)
 i) Inherited &amp 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

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.

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