Contents

List of Figures

List of Tables

List of Algorithms

Preface

Acknowledgements

Chapter 1 Introduction

1.1 Languages

1.2 Translation Process

1.3 Translation Schemes

1.4 Theoretical Viewpoint

1.5 Phases of a Compiler

1.6 A More Detailed Look at Phases of a Compiler

1.7 A Real-life Compiler – gcc

1.8 What Do We Mean by “Meaning”?

Looking Forward

Historical Notes

Exercises

Web Resources

Glossary

Chapter 2 A Simple Translator

2.1 A Simple Language

2.2 Compiler for Simple

2.3 A Virtual Machine for Simple

Looking Forward

Exercises

Web Resources

Glossary

Chapter 3 Lexical Analyzer

3.1 Scanner

3.2 Symbol Tables and a Scanner

3.3 Compiler Writing Tools

3.4 Error Handling in a Scanner

Exercises

Web Resources

Glossary

Chapter 4 Syntax Analyzer

4.1 Top-down and Bottom-up Parsing

4.2 Top-down Parsing

4.3 Bottom-up Parsing

4.4 Yacc – A Parser Generator

4.5 Other Parser Generators

4.6 Grammar for miniC

4.7 Symbol Table and Parser

4.8 Real-life – GCC: GNU Compiler Collection

Exercises

Web Resources

Further reading

Glossary

Chapter 5 Syntax-directed Translation

5.1 Implicit Stacking in RDP

5.2 Synchronized Semantic Stacks

5.3 Action Symbols

5.4 Attribute Grammars

5.5 Symbol Table Handling

5.6 Intermediate Representation Output for miniC

Exercises

Web Resources

Further Reading

Glossary

Chapter 6 Type Checking

6.1 Data Types and Type Checking

6.2 Type Expressions and Type Constructors

6.3 Type Equivalence

6.4 Type Names, Declarations and Recursive Types

6.5 Type Inference

6.6 Type Conversion and Coercion

6.7 Overloading of Operators and Functions

6.8 Example: Type Checking in an Interpreter

Exercises

Web Resources

Further Reading

Glossary

Chapter 7 Run-Time Environment

7.1 Run-Time Storage Allocation

7.2 Operating System

7.3 Libraries

7.4 System Environmental Variables

7.5 Invocation Command-line Parameters

Exercises

Web Resources

Further Reading

Glossary

Chapter 8 Intermediate Code

8.1 Building a Parse Tree

8.2 Polish Notation

8.3 N-tuple Notation

8.4 Abstract Syntax Tree

8.5 Abstract or Virtual Machine Code

8.6 Threaded Code

8.7 SECD and WAM

8.8 Grammar and IR Generation for miniC

8.9 Real-life: Intermediate Codes of GNU gcc

Exercises

Further Reading

Glossary

Chapter 9 Code Generation and Machine-dependent Optimization

9.1 Our Concerns in Code Generation

9.2 The Target Language

9.3 Data Structures

9.4 Control Constructs

9.5 Procedures and Function Calls

9.6 The Target Operating Environment

9.7 Code Optimization

9.8 Machine-dependent Optimization

9.9 Converting the 4-tuple and RPN into Assembly Code

Exercises

Further Reading

Glossary

Chapter 10 Code Optimization

10.1 Basic Blocks

10.2 Value Numbering Scheme

10.3 Peep-hole Optimization

10.4 Structural Optimization

10.5 Global Data-flow Analysis

10.6 Super-optimizers

10.7 Epilogue

Exercises

Further Reading

Glossary

Chapter 11 Overview of Processing of Some Languages

11.1 Java

11.2 Perl

11.3 PROLOG

11.4 FORTH

Exercises

Web Resources

Chapter 12 Project: Compiler for a miniC

12.1 MiniC Language

12.2 Architecture of miniC Compiler

12.3 MiniC Grammar for yacc

12.4 Target Language

12.5 Symbol Table

12.6 Scanner

12.7 Parser

12.8 Code Generation

12.9 Testing

12.10 Use of gdb to Debug the FPU Operations

12.11 Difference Between AT&T and Intel Assembly Syntax

Exercises

Further Reading and Web Resources

Appendix A Formal Languages and Automata

A.1 Essential Mathematical Background

A.2 Formal Language Theory Review

A.3 Grammars

A.4 Regular Languages, Regular Expressions and Finite-state Machine

A.5 Context-free Languages, CFG and Push-down Automata

Exercises

Glossary

Appendix B Assemblers and Macro Processors

B.1 Assembly Languages

B.2 Assemblers

B.3 Macro Processors

Exercises

Appendix C Linkers and Loaders

C.1 Linkers

C.2 A Typical Linking Loader

C.3 In Linux World

C.4 Loaders

Appendix D Worked-out Problems

D.1 Problems for Chapter 4: Parsers

D.2 Problems for Chapter 5: Syntax-directed Translation

D.3 Problems for Chapter 6: Type Checking

D.4 Problems for Chapter 7: Run-Time Environment

Bibliography

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.222.185