Introduction to Compiler Design / by Torben Ægidius Mogensen
Resource type: Ressourcentyp: Buch (Online)Book (Online)Language: English Series: Undergraduate Topics in Computer Science | SpringerLink BücherPublisher: London : Springer-Verlag London Limited, 2011Description: Online-Ressource (XXI, 204p, digital)ISBN:- 9780857298294
- 005.13
- 005.453
- QA76.7-76.73 QA76.76.C65
- QA76.76.C65
Contents:
Summary: Torben Ægidius MogensenSummary: This textbook is intended for an introductory course on Compiler Design, suitable for use in an undergraduate programme in computer science or related fields. Introduction to Compiler Design presents techniques for making realistic, though non-optimizing compilers for simple programming languages using methods that are close to those used in 'real' compilers, albeit slightly simplified in places for presentation purposes. All phases required for translating a high-level language to machine language is covered, including lexing, parsing, intermediate-code generation, machine-code generation and register allocation. Interpretation is covered briefly. Aiming to be neutral with respect to implementation languages, algorithms are presented in pseudo-code rather than in any specific programming language, and suggestions for implementation in several different language flavors are in many cases given. The techniques are illustrated with examples and exercises. The author has taught Compiler Design at the University of Copenhagen for over a decade, and the book is based on material used in the undergraduate Compiler Design course there.PPN: PPN: 1651003181Package identifier: Produktsigel: ZDB-2-SCS
Introduction to Compiler Design; Preface; The Phases of a Compiler; Interpreters; Why Learn About Compilers?; The Structure of This Book; To the Lecturer; Acknowledgements; Contents; List of Figures; Chapter 1: Lexical Analysis; 1.1 Regular Expressions; Precedence Rules; 1.1.1 Shorthands; 1.1.2 Examples; 1.2 Nondeterministic Finite Automata; 1.3 Converting a Regular Expression to an NFA; 1.3.1 Optimisations; 1.4 Deterministic Finite Automata; 1.5 Converting an NFA to a DFA; 1.5.1 Solving Set Equations; 1.5.2 The Subset Construction; 1.6 Size Versus Speed; 1.7 Minimisation of DFAs
1.7.1 Example1.7.2 Dead States; 1.8 Lexers and Lexer Generators; Splitting the Input Stream; Lexical Errors; 1.8.1 Lexer Generators; 1.9 Properties of Regular Languages; 1.9.1 Relative Expressive Power; 1.9.2 Limits to Expressive Power; 1.9.3 Closure Properties; 1.10 Further Reading; 1.11 Exercises; References; Chapter 2: Syntax Analysis; 2.1 Context-Free Grammars; 2.1.1 How to Write Context Free Grammars; 2.2 Derivation; 2.2.1 Syntax Trees and Ambiguity; 2.3 Operator Precedence; 2.3.1 Rewriting Ambiguous Expression Grammars; 2.4 Other Sources of Ambiguity; 2.5 Syntax Analysis
2.6 Predictive Parsing2.7 Nullable and FIRST; 2.8 Predictive Parsing Revisited; 2.9 FOLLOW; 2.10 A Larger Example; 2.11 LL(1) Parsing; 2.11.1 Recursive Descent; 2.11.2 Table-Driven LL(1) Parsing; 2.11.3 Conflicts; 2.12 Rewriting a Grammar for LL(1) Parsing; 2.12.1 Eliminating Left-Recursion; Indirect Left-Recursion; 2.12.2 Left-Factorisation; 2.12.3 Construction of LL(1) Parsers Summarized; 2.13 SLR Parsing; 2.14 Constructing SLR Parse Tables; 2.14.1 Conflicts in SLR Parse-Tables; 2.15 Using Precedence Rules in LR Parse Tables; 2.16 Using LR-Parser Generators; 2.16.1 Declarations and Actions
2.16.2 Abstract Syntax2.16.3 Conflict Handling in Parser Generators; 2.17 Properties of Context-Free Languages; 2.18 Further Reading; 2.19 Exercises; References; Chapter 3: Scopes and Symbol Tables; 3.1 Symbol Tables; 3.1.1 Implementation of Symbol Tables; 3.1.2 Simple Persistent Symbol Tables; 3.1.3 A Simple Imperative Symbol Table; 3.1.4 Efficiency Issues; 3.1.5 Shared or Separate Name Spaces; 3.2 Further Reading; 3.3 Exercises; References; Chapter 4: Interpretation; 4.1 The Structure of an Interpreter; 4.2 A Small Example Language; 4.3 An Interpreter for the Example Language
4.3.1 Evaluating Expressions4.3.2 Interpreting Function Calls; 4.3.3 Interpreting a Program; 4.4 Advantages and Disadvantages of Interpretation; 4.5 Further Reading; 4.6 Exercises; References; Chapter 5: Type Checking; 5.1 The Design Space of Types; 5.2 Attributes; 5.3 Environments for Type Checking; 5.4 Type Checking Expressions; 5.5 Type Checking of Function Declarations; 5.6 Type Checking a Program; 5.7 Advanced Type Checking; Assignments; Data Structures; Overloading; Type Conversion; Polymorphism/Generic Types; Implicit Types; 5.8 Further Reading; 5.9 Exercises; References
Chapter 6: Intermediate-Code Generation
No physical items for this record