Book description
Pearson’s flagship title Compilers: Principles, Techniques and Tools, known to professors, students, and developers worldwide as the "Dragon Book," is available in a new edition to reflect the current state of compilation. This book provides the foundation for understanding the theory and practice of compilers.
Revised and updated with new chapters on Programming Language Semantics and Undefined Behaviour Semantics, the title addresses modern issues in compiler design. However, the authors, recognizing that few readers will ever go on to construct a compiler, retain their focus on the broader set of problems faced in software design and software development.
Table of contents
- Cover
- About Pearson
- Title Page
- Contents
- Preface
- About the Authors
- Chapter 1: Introduction
- Chapter 2: A Simple Syntax-Directed Translator
-
Chapter 3: Lexical Analysis
- 3.1 The Role of the Lexical Analyzer
- 3.2 Input Buffering
- 3.3 Specification of Tokens
- 3.4 Recognition of Tokens
- 3.5 The Lexical-Analyzer Generator Lex
- 3.6 Finite Automata
- 3.7 From Regular Expressions to Automata
- 3.8 Design of a Lexical-Analyzer Generator
-
3.9 Optimization of DFA-Based Pattern Matchers
- 3.9.1 Important States of an NFA
- 3.9.2 Functions Computed From the Syntax Tree
- 3.9.3 Computing nullable, firstpos, and lastpos
- 3.9.4 Computing followpos
- 3.9.5 Converting a Regular Expression Directly to a DFA
- 3.9.6 Minimizing the Number of States of a DFA
- 3.9.7 State Minimization in Lexical Analyzers
- 3.9.8 Trading Time for Space in DFA Simulation
- 3.10 Summary of Chapter 3
- 3.11 References for Chapter 3
- Chapter 4: Syntax Analysis
- Chapter 5: Syntax-Directed Translation
- Chapter 6: Intermediate-Code Generation
-
Chapter 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
- 7.9 Summary of Chapter 7
- 7.10 References for Chapter 7
-
Chapter 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
- 8.12 Summary of Chapter 8
- 8.13 References for Chapter 8
-
Chapter 9: Machine-Independent Optimizations
- 9.1 The Principal Sources of Optimization
- 9.2 Introduction to Data-Flow Analysis
- 9.3 Foundations of Data-Flow Analysis
-
9.4 Constant Propagation
- 9.4.1 Data-Flow Values for the Constant-Propagation Framework
- 9.4.2 The Meet for the Constant-Propagation Framework
- 9.4.3 Transfer Functions for the Constant-Propagation Framework
- 9.4.4 Monotonicity of the Constant-Propagation Framework
- 9.4.5 Nondistributivity of the Constant-Propagation Framework
- 9.4.6 Interpretation of the Results
- 9.5 Partial-Redundancy Elimination
- 9.6 Loops in Flow Graphs
- 9.7 Region-Based Analysis
- 9.8 Symbolic Analysis
- 9.9 Summary of Chapter 9
- 9.10 References for Chapter 9
-
Chapter 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
- 10.5.1 Introduction
- 10.5.2 Software Pipelining of Loops
- 10.5.3 Register Allocation and Code Generation
- 10.5.4 Do-Across Loops
- 10.5.5 Goals and Constraints of Software Pipelining
- 10.5.6 A Software-Pipelining Algorithm
- 10.5.7 Scheduling Acyclic Data-Dependence Graphs
- 10.5.8 Scheduling Cyclic Dependence Graphs
- 10.5.9 Improvements to the Pipelining Algorithms
- 10.5.10 Modular Variable Expansion
- 10.5.11 Conditional Statements
- 10.5.12 Hardware Support for Software Pipelining
- 10.6 Summary of Chapter 10
- 10.7 References for Chapter 10
-
Chapter 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.9.1 What is Pipelining?
- 11.9.2 Successive Over-Relaxation (SOR): An Example
- 11.9.3 Fully Permutable Loops
- 11.9.4 Pipelining Fully Permutable Loops
- 11.9.5 General Theory
- 11.9.6 Time-Partition Constraints
- 11.9.7 Solving Time-Partition Constraints by Farkas’ Lemma
- 11.9.8 Code Transformations
- 11.9.9 Parallelism With Minimum Synchronization
- 11.10 Locality Optimizations
- 11.11 Other Uses of Affine Transforms
- 11.12 Summary of Chapter 11
- 11.13 References for Chapter 11
-
Chapter 12: Programming Language Semantics
- 12.1 Introduction
- 12.2 The Need for Specifying Programming Language Semantics
- 12.3 Formally Specifying Evaluation Rules through Inference Rules
- 12.4 Specifying Programming Language Semantics
-
12.5 Evaluation Judgment Rules for Simple Operations
- 12.5.1 Evaluation Judgment Rules for Constants
- 12.5.2 Evaluation Judgment Rules for Variables
- 12.5.3 Evaluation Judgment Rule for the Assignment Operator
- 12.5.4 Evaluation Judgment Rule for Binary Operations
- 12.5.5 Evaluation Judgment Rule for the Sequencing Operator
- 12.5.6 Evaluation Judgment Rule for the Block Operator
- 12.6 Evaluation Judgment Rules for Control Flow
- 12.7 Evaluation Judgment Rules for Variable Declarations
- 12.8 Summary of Chapter 12
- 12.9 References for Chapter 12
-
Chapter 13: Undefined Behaviour Semantics
- 13.1 Introduction
- 13.2 Implications of UB Semantics for Compiler Optimization
- 13.3 Undefined Behaviour in IR
- 13.4 Considerations during the Design of IR Semantics
- 13.5 Poison Values: A Weaker Semantics for Errors
- 13.6 Semantics for the Poison Value
-
13.7 LLVM Semantics for the Poison Value
- 13.7.1 Division by Poison
- 13.7.2 Branch on Poison
- 13.7.3 Storing Poison to Memory
- 13.7.4 Loading-from and Storing-to Poison Pointer
- 13.7.5 Hoisting Transformations in LLVM
- 13.7.6 Compiler Analyses May Guarantee Poison-Free Values
- 13.7.7 Immediate UB in Source vs. Deferred UB in IR
- 13.7.8 Freeze Opcode
- 13.8 Summary of Chapter 13
- 13.9 References for Chapter 13
- Index
- Chapter 14: Interprocedural Analysis
- Appendix A: A Complete Front End
- Appendix B: Finding Linearly Independent Solutions
- Copyright
Product information
- Title: Compilers: Principles, Techniques, and Tools, Updated 2nd Edition by Pearson
- Author(s):
- Release date: December 2023
- Publisher(s): Pearson India
- ISBN: 9789357054881
You might also like
book
Code: The Hidden Language of Computer Hardware and Software, 2nd Edition
Computers are everywhere --- most obviously in our laptops and smartphones, but also our cars, televisions, …
book
Engineering a Compiler, 2nd Edition
This entirely revised second edition of Engineering a Compiler is full of technical updates and new …
book
Computer Architecture, 5th Edition
Computer Architecture: A Quantitative Approach, Fifth Edition, explores the ways that software and technology in the …
book
Programming: Principles and Practice Using C++, 3rd Edition
An Introduction to Programming by the Inventor of C++ Programming: Principles and Practice Using C++, Third …