| |
| |
| Preface | |
| |
| |
| Acknowledgments | |
| |
| |
| |
| Introduction | |
| |
| |
| |
| The Concept of a Trustworthy Compiler | |
| |
| |
| |
| Kinds of Compilers | |
| |
| |
| |
| Evolution of Java Compilers | |
| |
| |
| |
| Compilation for .NET | |
| |
| |
| |
| Phases of Compilation | |
| |
| |
| |
| Overview of Compiler Development Principles and Technologies | |
| |
| |
| |
| History of Compiler Development in the U.S.S.R. and in Russia | |
| |
| |
| Exercises to Chapter 1 | |
| |
| |
| |
| Theoretical Foundations and Principles of Trustworthy Compilers | |
| |
| |
| |
| The Trustworthy Computing (TWC) Initiative | |
| |
| |
| |
| TWC and Trustworthy Compilers | |
| |
| |
| |
| Verified Compilers | |
| |
| |
| |
| Spec#: Microsoft's Approach to Verifying Compilers | |
| |
| |
| |
| Perspectives of Verified and Verifying Compilation | |
| |
| |
| Exercises to Chapter 2 | |
| |
| |
| |
| Lexical Analysis and Its Trustworthiness Principles | |
| |
| |
| |
| Token Classes | |
| |
| |
| |
| The Output of the Lexical Analyzer | |
| |
| |
| |
| Processing White Spaces, Comments, and New Lines | |
| |
| |
| |
| Theoretical Models of Lexical Analysis | |
| |
| |
| |
| Lexical Errors, Error Diagnostics, and Recovery | |
| |
| |
| |
| Processing Identifiers and Keywords | |
| |
| |
| |
| The Architecture of a Lexical Analyzer and the Principles of Its Implementation | |
| |
| |
| |
| The Lexical Analyzer Generator Lex | |
| |
| |
| |
| Lexical Analyzer Generation in ANTLR | |
| |
| |
| Exercises to Chapter 3 | |
| |
| |
| |
| Parsing and Trustworthy Methods of Syntax Error Recovery | |
| |
| |
| |
| Basic Concepts and Principles of Parsing | |
| |
| |
| |
| Recursive Descent and Simple Lookahead Mechanism | |
| |
| |
| |
| Overview of Error Recovery in Parsing: Error Recovery for Recursive Descent | |
| |
| |
| |
| LR(1) and LALR(1) Parsing | |
| |
| |
| |
| Error Recovery in LR Parsing | |
| |
| |
| |
| The Yacc Parser Generator | |
| |
| |
| |
| The Bison Parser Generator: Generalized LR Parsing | |
| |
| |
| |
| The Yacc++, JavaCC, SableCC, ANTLR, and CoCo/R Object-Oriented Parser Generators | |
| |
| |
| Exercises to Chapter 4 | |
| |
| |
| |
| Semantic Analysis and Typing: Efficient and Trustworthy Techniques | |
| |
| |
| |
| Basic Concepts and Principles of Semantic Analysis | |
| |
| |
| |
| Formal Model of Semantic Analysis: Attributed Grammars | |
| |
| |
| |
| Definition Systems with Forward References and the Algorithm of Their One-Pass Analysis | |
| |
| |
| |
| Commonly Used Semantic Attributes for Program Constructs | |
| |
| |
| |
| Design Flaws of the Semantic Attribute Evaluation and Our Efficient Methods to Speed It Up | |
| |
| |
| |
| Lookup-Traditional and Novel Techniques | |
| |
| |
| |
| Typing and Type-Checking: Basic Concepts | |
| |
| |
| |
| Representing Types at Compile Time | |
| |
| |
| |
| Efficient Method and Algorithm to Represent and Handle Types with Structural Identity | |
| |
| |
| |
| Type Identity and Type Compatibility | |
| |
| |
| |
| Type-Checking, Typing Error Diagnostics, and Recovery | |
| |
| |
| |
| Code Trustworthiness Checks During Semantic Analysis | |
| |
| |
| |
| Checks for Context Restrictions in Semantic Analysis | |
| |
| |
| |
| Intermediate Code Generation-Principles and Architectural Models | |
| |
| |
| |
| Postfix (Reverse Polish) Notation | |
| |
| |
| |
| PCC Trees | |
| |
| |
| |
| Triples | |
| |
| |
| |
| Summary of the Chapter | |
| |
| |
| Exercises to Chapter 5 | |
| |
| |
| |
| Trustworthy Optimizations | |
| |
| |
| |
| Basic Concepts and Trustworthiness of Optimizations | |
| |
| |
| |
| Optimizations as Mixed Computations | |
| |
| |
| |
| Overview of the Most Common Kinds of Optimizations | |
| |
| |
| |
| Control Flow and Data Flow Dependencies | |
| |
| |
| |
| Static Single Assignment (SSA) | |
| |
| |
| |
| Data Structures Constructed and Used by the Optimizer | |
| |
| |
| |
| Optimization in Sun Studio Compilers | |
| |
| |
| |
| Optimizations of the Java Bytecode | |
| |
| |
| |
| Optimizations of the .NET Common Intermediate Language (CIL) Code | |
| |
| |
| |
| Optimizations during JIT Compilation | |
| |
| |
| Exercises to Chapter 6 | |
| |
| |
| |
| Code Generation and Runtime Data Representation | |
| |
| |
| |
| Target Platforms for Code Generation | |
| |
| |
| |
| Overview of Code Generation Tasks and Goals | |
| |
| |
| |
| Specifics of Code Generation for .NET | |
| |
| |
| |
| Specifics of Code Generation for SPARC Architecture | |
| |
| |
| |
| Representing Types and Addressing Variables | |
| |
| |
| |
| Representing Procedures, Functions, and Methods | |
| |
| |
| |
| Principles of SPARC Architecture | |
| |
| |
| |
| Example of Code Generation for SPARC Architecture | |
| |
| |
| |
| Generation of Debugging Information | |
| |
| |
| |
| Code Generation for Declarations (Definitions), Expressions, and Statements | |
| |
| |
| Exercises to Chapter 7 | |
| |
| |
| |
| Runtime, JIT, and AOT Compilation | |
| |
| |
| |
| The Tasks of the Runtime | |
| |
| |
| |
| The Relationship of the Runtime and the Operating System (OS) | |
| |
| |
| |
| JIT Compilation | |
| |
| |
| |
| The Architecture of FJIT-JIT Compiler for SSCLI/Rotor | |
| |
| |
| |
| The Architecture of Optimizing JIT Compiler for SSCLI/Rotor | |
| |
| |
| |
| AOT Compilation | |
| |
| |
| Exercises to Chapter 8 | |
| |
| |
| |
| Graph Grammars and Graph Compilers | |
| |
| |
| |
| Basic Concepts of Graph Grammars and Graph Compilers | |
| |
| |
| |
| Categorical Approach to Graph Transformations | |
| |
| |
| |
| Reserved Graph Grammars (RGGs) | |
| |
| |
| |
| Layered Graph Grammars | |
| |
| |
| |
| Meta-Modeling Approach to Graph Grammars and Diameta Editor | |
| |
| |
| |
| Hypergraph Approach to Graph Grammars in Diagen | |
| |
| |
| |
| Graph Compiler Generation Tools | |
| |
| |
| Exercises to Chapter 9 | |
| |
| |
| |
| Microsoft Phoenix, Phoenix-Targeted Tools, and Our Phoenix Projects | |
| |
| |
| |
| History of Phoenix and of Our Phoenix Projects | |
| |
| |
| |
| Overview of Phoenix Architecture | |
| |
| |
| |
| Phoenix-Based Tools, Passes, Phases, and Plug-Ins | |
| |
| |
| |
| Phoenix Primitives: Strings and Names | |
| |
| |
| |
| Phoenix Intermediate Representation (IR) | |
| |
| |
| |
| Phoenix Symbol System | |
| |
| |
| |
| Phoenix Type System | |
| |
| |
| |
| Data Flow Analysis, Control Flow Analysis, Graphs, and Static Single Assignment (SSA) in Phoenix | |
| |
| |
| |
| Overview of Other Phoenix Features | |
| |
| |
| |
| Example of a Phoenix-Based Plug-In | |
| |
| |
| |
| Phoenix-Fete-A Compiler Front-End Development Toolkit and Environment Targeted to Phoenix | |
| |
| |
| |
| Architectural Specifics of Phoenix-FETE | |
| |
| |
| |
| The Input Grammar Meta-Language | |
| |
| |
| |
| The Current Status of the Implementation | |
| |
| |
| Exercises to Chapter 10 | |
| |
| |
| Conclusions | |
| |
| |
| References | |
| |
| |
| Index | |