Some exercises in the dragon book second edition.
- 1 Introduction
- 1.1 Language Processors
- 1.2 The Structure of a Compiler
- 1.3 The Evolution of Programming Languages
- 1.4 The Science of Building a Compiler
- 1.5 Applications of Compiler Technology
- 1.6 Programming Language Basics
- 2 A Simple Syntax-Directed Translator
- 2.1 Introduction
- 2.2 Syntax Definition
- 2.3 Syntax-Directed Translation
- 2.4 Parsing
- 2.5 A Translator for Simple Expression
- 2.6 Lexical Analysis
- 2.7 Symbol Tables
- 2.8 Intermediate Code Generation
- 3 Lexical Analysis
- 4 Syntax Analysis
- 5 Syntax-Directed Translation
- 6 Intermediate-Code Generation
- 6.1 Variants of Syntax Trees
- 6.2 Three-Address Code
- 6.3 Types and Declarations
- 6.4 Translation of Expressions
- 6.5 Type Checking
- 6.6 Control Flow
- 6.7 Backpatching
- 6.8 Switch-Statements
- 6.9 Intermediate Code for Procedures
- 7 Run-Time Environments
- 7.1 Storage Organization
- 7.2 Stack Allocation of Space
- 7.3 Access to Nonlocal Data on the Stack
- 7.4 Heap Management
- 7.5 Introduction to Garbage Collection
- 7.6 Introduction to Trace-Based Collection
- 7.7 Short-Pause Garbage Collection
- 7.8 Advanced Topics in Garbage Collection
- 8 Code Generation
- 8.1 Issues in the Design of a Code Generator
- 8.2 The Target Language
- 8.3 Addresses in the Target Code
- 8.4 Basic Blocks and Flow Graphs
- 8.5 Optimization of Basic Blocks
- 8.6 A Simple Code Generator
- 8.7 Peephole Optimization
- 8.8 Register Allocation and Assignment
- 8.9 Instruction Selection by Tree Rewriting
- 8.10 Optimal Code Generation for Expressions
- 8.11 Dynamic Programming Code-Generation
- 9 Machine-Independent Optimizations
- 10 Instruction-Level Parallelism
- 10.1 Processor Architectures
- 10.2 Code-Scheduling Constraints
- 10.3 Basic-Block Scheduling
- 10.4 Global Code Scheduling
- 10.5 Software Pipelining
- 11 Optimizing for Parallelism and Locality
- 11.1 Basic Concepts
- 11.2 Matrix Multiply: An In-Depth Example
- 11.3 Iteration Spaces
- 11.4 Affine Array Indexes
- 11.5 Data Reuse
- 11.6 Array Data-Dependence Analysis
- 11.7 Finding Synchronization-Free Parallelism
- 11.8 Synchronization Between Parallel Loops
- 11.9 Pipelining
- 11.10 Locality Optimizations
- 11.11 Other Uses of Affine Transforms
- 12 Interprocedural Analysis
- 12.1 Basic Concepts
- 12.2 Why Interprocedural Analysis?
- 12.3 A Logical Representation of Data Flow
- 12.4 A Simple Pointer-Analysis Algorithm
- 12.5 Context-Insensitive Interprocedural Analysis
- 12.6 Context-Sensitive Pointer Analysis
- 12.7 Datalog Implementation by BDD's