Skip to main content

Trustworthy Compilers

Trustworthy Compilers

Vladimir O. Safonov

ISBN: 978-0-470-50095-8

Mar 2010

295 pages

In Stock



This unique guide book explains and teaches the concept of trustworthy compilers based on 50+ years of worldwide experience in the area of compilers, and on the author’s own 30+ years of expertise in development and teaching compilers. It covers the key topics related to compiler development as well as compiling methods not thoroughly covered in other books. The book also reveals many state-of-the-art compiler development tools and personal experience of their use in research projects by the author and his team. Software engineers of commercial companies and undergraduate/graduate students will benefit from this guide.


1. Introduction.

1.1. The Concept of a Trustworthy Compiler.

1.2. Kinds of Compilers.

1.3. Evolution of Java Compilers.

1.4. Compilation for .NET.

1.5. Phases of Compilation.

1.6. Overview of Compiler Development Principles and Technologies.

1.7. History of Compiler Development in the U.S.S.R. and in Russia.

Exercises to Chapter 1.

2. Theoretical Foundations and Principles of Trustworthy Compilers.

2.1. The Trustworthy Computing (TWC) Initiative.

2.2. TWC and Trustworthy Compilers.

2.3. Verified Compilers.

2.4. Spec#: Microsoft’s Approach to Verifying Compilers.

2.5. Perspectives of Verified and Verifying Compilation.

Exercises to Chapter 2.

3. Lexical Analysis and Its Trustworthiness Principles.

3.1. Token Classes.

3.2. The Output of the Lexical Analyzer.

3.3. Processing White Spaces, Comments, and New Lines.

3.4. Theoretical Models of Lexical Analysis.

3.5. Lexical Errors, Error Diagnostics, and Recovery.

3.6. Processing Identifiers and Keywords.

3.7. The Architecture of a Lexical Analyzer and the Principles of Its Implementation.

3.8. The Lexical Analyzer Generator Lex.

3.9. Lexical Analyzer Generation in ANTLR.

Exercises to Chapter 3.

4. Parsing and Trustworthy Methods of Syntax Error Recovery.

4.1. Basic Concepts and Principles of Parsing.

4.2. Recursive Descent and Simple Lookahead Mechanism.

4.3. Overview of Error Recovery in Parsing: Error Recovery for Recursive Descent.

4.4. LR(1) and LALR(1) Parsing.

4.5. Error Recovery in LR Parsing.

4.6. The Yacc Parser Generator.

4.7. The Bison Parser Generator: Generalized LR Parsing.

4.8. The Yacc++, JavaCC, SableCC, ANTLR, and CoCo/R Object-Oriented Parser Generators.

Exercises to Chapter 4.

5. Semantic Analysis and Typing: Efficient and Trustworthy Techniques.

5.1. Basic Concepts and Principles of Semantic Analysis.

5.2. Formal Model of Semantic Analysis: Attributed Grammars.

5.3. Definition Systems with Forward References and the Algorithm of Their One-Pass Analysis.

5.4. Commonly Used Semantic Attributes for Program Constructs.

5.5. Design Flaws of the Semantic Attribute Evaluation and Our Efficient Methods to Speed It Up.

5.6. Lookup—Traditional and Novel Techniques.

5.7. Typing and Type-Checking: Basic Concepts.

5.8. Representing Types at Compile Time.

5.9. Efficient Method and Algorithm to Represent and Handle Types with Structural Identity.

5.10. Type Identity and Type Compatibility.

5.11. Type-Checking, Typing Error Diagnostics, and Recovery.

5.12. Code Trustworthiness Checks During Semantic Analysis.

5.13. Checks for Context Restrictions in Semantic Analysis.

5.14. Intermediate Code Generation—Principles and Architectural Models.

5.15. Postfix (Reverse Polish) Notation.

5.16. PCC Trees.

5.17. Triples.

5.18. Summary of the Chapter.

Exercises to Chapter 5.

6. Trustworthy Optimizations.

6.1. Basic Concepts and Trustworthiness of Optimizations.

6.2. Optimizations as Mixed Computations.

6.3. Overview of the Most Common Kinds of Optimizations.

6.4. Control Flow and Data Flow Dependencies.

6.5. Static Single Assignment (SSA).

6.6. Data Structures Constructed and Used by the Optimizer.

6.7. Optimization in Sun Studio Compilers.

6.8. Optimizations of the Java Bytecode.

6.9. Optimizations of the .NET Common Intermediate Language (CIL) Code.

6.10. Optimizations during JIT Compilation.

Exercises to Chapter 6.

7. Code Generation and Runtime Data Representation.

7.1. Target Platforms for Code Generation.

7.2. Overview of Code Generation Tasks and Goals.

7.3. Specifics of Code Generation for .NET.

7.4. Specifics of Code Generation for SPARC Architecture.

7.5. Representing Types and Addressing Variables.

7.6. Representing Procedures, Functions, and Methods.

7.7. Principles of SPARC Architecture.

7.8. Example of Code Generation for SPARC Architecture.

7.9. Generation of Debugging Information.

7.10. Code Generation for Declarations (Definitions), Expressions, and Statements.

Exercises to Chapter 7.

8. Runtime, JIT, and AOT Compilation.

8.1. The Tasks of the Runtime.

8.2. The Relationship of the Runtime and the Operating System (OS).

8.3. JIT Compilation.

8.4. The Architecture of FJIT––JIT Compiler for SSCLI/Rotor.

8.5. The Architecture of Optimizing JIT Compiler for SSCLI/Rotor.

8.6. AOT Compilation.

Exercises to Chapter 8.

9. Graph Grammars and Graph Compilers.

9.1. Basic Concepts of Graph Grammars and Graph Compilers.

9.2. Categorical Approach to Graph Transformations.

9.3. Reserved Graph Grammars (RGGs).

9.4. Layered Graph Grammars.

9.5. Meta-Modeling Approach to Graph Grammars and Diameta Editor.

9.6. Hypergraph Approach to Graph Grammars in Diagen.

9.7. Graph Compiler Generation Tools.

Exercises to Chapter 9.

10. Microsoft Phoenix, Phoenix-Targeted Tools, and Our Phoenix Projects.

10.1. History of Phoenix and of Our Phoenix Projects.

10.2. Overview of Phoenix Architecture.

10.3. Phoenix-Based Tools, Passes, Phases, and Plug-Ins.

10.4. Phoenix Primitives: Strings and Names.

10.5. Phoenix Intermediate Representation (IR).

10.6. Phoenix Symbol System.

10.7. Phoenix Type System.

10.8. Data Flow Analysis, Control Flow Analysis, Graphs, and Static Single Assignment (SSA) in Phoenix.

10.9. Overview of Other Phoenix Features.

10.10. Example of a Phoenix-Based Plug-In.

10.11. Phoenix-Fete—A Compiler Front-End Development Toolkit and Environment Targeted to Phoenix.

Exercises to Chapter 10.




""Overall, however, it is an excellent addition to a computer scientist's bookshelf, and complements the classics in compiler design."" (Computing Reviews, 22 November 2011)