Publisher: McGraw-Hill, 1987, 796 pages

ISBN: 0-07-Y66616-4

Keywords: Programming

This book provides a practical approach to compiler implementation and shows how the different language features are handled and translated in the compilation process. Unlike most books in this area, *The Theory and Practice of Compiler Writing* thoroughly covers programming language design and error detection, and recovery techniques in compilation, enabling readers to get a firm grasp on compiler planning and programming. Traditional topics such as lexical analysis, syntactic analysis, symbol table handling, semantic analysis, code generation and code optimization are given balanced coverage.

This book is intended as a text for a one- or two-semester course in compiler design at the senior undergraduate or introductory graduate level. It can also be used as a self-study and reference book in compiler design. The reader should have at least one year of experience in programming a high-level language and an assembly language. In addition, a familiarity with elementary data structures and discrete mathematics is a definite asset.

**Introduction**- Programming Languages
- Translators
- Model of a C Compiler
**Notation and Concepts for Languages and Grammars**- Sets and Strings
- Basic Concepts of Set Theory
- Relations
- Strings
- Discussion of Grammars
- Classification of Grammars
- Context-Free Grammars and parsing
- Syntax Terminology
- A View of Parsing
- Reduced Grammars and Grammars with ε-Rules
- Extended BNF Notation
**Programming-Language Design**- Overview of the Problem
- Preliminary Considerations
- Sources of Ideas
- Goals and Design Philosophies of Programming Languages
- Human Communication
- Prevention and Detection of Errors
- Usability
- Programming Effectiveness
- Compilability
- Efficiency
- Machine Independence
- Simplicity
- Uniformity
- Orthogonality
- Generalization and Specialization
- Other Design Philosophies
- Detailed Design
- Microstructure
- Expression Structure
- Data Structure
- Control Structure
- Compile Structure
- I&O Structure
- Reduction of Size
- Pragmatics
- Comments on the Design of Ada
- Evaluation of Ada from a Language Design Viewpoint
*Usability and Program Effectiveness**Machine Independence and Portability**Efficiency**Modularity and Maintainability**Compilability and Compile Structre**Simplicty*- Ada Programming Support Environment
- Software Technology for Adaptable Reliable Systems (STARS)
**Scanners**- The Scanning Process
- An Elementary Scanner Design and Its Implementation
- Regular Grammars and Regular Expressions
- Finite-State Acceptors
- Deterministic Finite-State Acceptors
- Nondeterministric Finite-State Acceptors
- Nondeterministric Finite-State Acceptors with ε-Transitions
- Equivalence of regular Grammars and Finite-State Acceptors
- Equivalence of Regular Expressions and Finite-State Acceptors
- A Scanner Generator
**Compile-Time Error Handling**- Overview of Error Handling
- Error Detection
- The Nature of Syntax Errors
- How Errors Are Detected
- Where Errors Are Detected
- Error Reporting
- Error Recovery
- Ad Hoc Recovery Mechanism
- Syntax-Directed Recovery
- Secondary Error Recovery
- Context-Sensitive Recovery
- Error Repair
- Ad Hoc Repair
- Syntax-Directed Repair
- Context-Sensitive Repair
- Spelling Repair
**Top-Down P****arsing**- General Top-Down Parsing Strategies
- Brute-Force Approach
- Recursive-Descent Parsers
*Recursive-Descent Parsing Algorithm**Error Detection in Recursive-Descent Parsers*- Notions of Top-Down Parsing with Limited Backup
- Top-Down Parsing with Limited Backup
- Top-Down Parsing with No Backup
- Notions of Parsing with No Backup
- Simple
*LL*(1) Grammars *LL*(1) Grammars*LL*(1) Grammars without ε-Rules*LL*(1) Grammars with ε-Rules- Error Handling for
*LL*(1) Parsers **Bottom-Up Parsing**- Polish Expression and Their Compilation
- Polish Notation
- Conversion of Infix Expressions to Polish Notation
- Error Detection for Infix Expressions
- Operator Precedence Grammars
- Notions and Use of Operator Precedence Relations
- Formal Definition of Operator Precedence Relations
- Operator Precedence Parsing Algorithm
- Precedence Functions in Operator Precedence Parsers
- Error Detection in Operator Precedence Parsers
- Simple Precedence Grammars
- Notions and Use of Precedence Relations
- Formal Definition of Precedence Relations
- Parsing Algorithm for Simple Precedence Grammars
- Precedence Functions for Simple Precedence Parsers
- Error Detection for Simple Precedence Parsers
- Notions of Extended Precedence
*LR*Grammars- Concepts and Terminology
*LR*(0) Parsers*SLR*(1) Parsers- Cononical
*LR*(1) Parsers *LALR*(1) Parsers- Efficient Generation of Lookahead Sets for
*LALR*(1) Parsers - Representation and Optimization of
*LR*Parsers *Sparse-Matrix Representations**Optimizaation Transformations*- Error Detection and Recovery in
*LR*Parsers *Early Methods of Error Recovery**Application of Graham-Rhodes Method to*LR*Parsers**Other*LR*Error-Recovery Methods*- Comparison of Parsing Methods
**Symbol-Table-Handling Techniques**- Perspective and Motivation
- When to Construct and Interact with the Symbol Table
- Symbol-Table Contents
- Operations on Symbol Tables
- Symbol-Table Organizations for Non-Block-Structured Languages
- Unordered Symbol Tables
- Ordered Symbol Tables
- Tree-Structured Symbol Tables
- Hash Symbol Tables
- Symbol-Table Organization for Block-Structured Languages
- Block-Structured Language Concepts
- Stack Symbol Tables
- Stack-Implemented Tree-Structured Symbol Tables
- Stack-Implemented Has-Structured Symbol Tables
**Run-Time Storage Organization and Management**- Static Storage Allocation
- Dynamic Storage Allocation
- Activation Records
- Parameter Area
- Display Area
- Run-Time Address Calculation
- Handling Recursive Procedures
- Heap Storage Allocation
- Implicit Storage Requests
- Explicit Storage Requests
- Management of Fixed-Length Blocks
- Management of Variable-Length Blocks
*First-Fit Heap Storage-Management Strategy**Boundary-Tag Heap Storage-Management Strategy**Byddy-System Heap Storage-Management Strategy*- Free-as-you-Go Storage Release
- Garbage Collection
- Compaction
**Intermediate Forms of Source Programs**- Polish Notation
- N-tuple Notation
- Abstract Syntax Tree
- Threaded Code
- Abstract Machine Code
- Portability and Abstract Machines
- The P-Code Abstract Machine for PASCAL
**Semantic Analysis and Code Generation**- What Is Meant by Semantic Analysis
- Implicit Stacking in Recursive-Descent Compilation
- Semantic Stacks in Bottom-Up Compilation
- Action Symbols in Top-Down Compilation
- Attributed Translation
- Attributed Translation Grammar
*L*-Attributed Translation Grammar- Example Language Constructs
- Declarations
*Constant Type**Variable Declarations**Procedure Declarations*- Expressions
- Assignment Statements
- Control Statements
*Case-Selection Statement**Repeat-While Statement**For Loop Statement*- Procedure Calls and Returns
*Procedure Calls**Return Statement and Procedure Termination*- Input and Output Statements
*Input Statements**Output Statements*- Compiler Aids
**Code Optimization**- Introduction
- Basic Blocks
- Folding
- Redundant-Subexpression Elimination
- Optimization within Iterative Loops
- Loop Unrolling
- Frequency Reduction
- Strength Reduction
- Combining Loop-Optimization Techniques
- Global Optimization through Flowgraph Analysis
- Flowgraph Construction
- Flowgraph Analysis
*Flowgraph-Analysis Problems**Flow-Analysis Algorithms*- Applications to Program Optimization
- Implementation and Further Considerations
**Machine-Dependent Optimization**- Introduction to machine-Dependent Optimization
- Register-Allocation Optimization
- Register Allocation in Single-Register Machines
- Register Allocation in Multiregister Machines
- Machine Architecture and the Generation of real Code
- The PDP-11
- The VAX-11
- The MC68000
**Compiler-Compilers**- Introduction to Compiler-Compilers
- Example of Parser Generators
- YACC: A LALR(1) Parser Generator
- An Attributed LL(1) Parser Generator
- Machine-Independent Code Generation
- The Production-Quality Compiler-Compiler System
*Introduction**The Formalization of Instruction-Set Processors and TCOL**The Code-Generation Process: Its Phases and Organization*- The Table-Driven Generator of Graham and Glanville
*Introduction**The Target-Machine Description**The Code-Generation Process**Results and Extensions*- Other Code-Generation Systems
*Fraser's Knowledge-Based Code-Generator Generator**The Finite-State Approach of Donegan*

**Appendix: Algorithmic Notation**- Format Conventions
- Name of Algorithm
- Introductory Comment
- Steps
- Comments
- Statements and Control Structures
- Assignment Statement
- If Statement
- Case Statement
- Repeat Statement
- Go To and Exitloop Statements
- Exit Statement
- Variable Names
- Data Structures
- Arrays
- Dynamic Storage
- Arithmetic Operations and Expressions
- Strings and String Operations
- Relations and Relational Operators
- Logical Operations and Expressions
- Input and Output
- Subalgorithms
- Functions
- Procedures
- Parameters

A well researched and pretty complete book, but why must it be so boringly written?

## Comments

There are currently no comments

## New Comment