CHF77.00
Download est disponible immédiatement
Broad in scope, involving theory, the application of that theory, and programming technology, compiler construction is a moving target, with constant advances in compiler technology taking place. Today, a renewed focus on do-it-yourself programming makes a quality textbook on compilers, that both students and instructors will enjoy using, of even more vital importance. This book covers every topic essential to learning compilers from the ground up and is accompanied by a powerful and flexible software package for evaluating projects, as well as several tutorials, well-defined projects, and test cases.
Auteur
ANTHONY J. DOS REIS is Associate Professor of Computer Science at the State University of New York at New Paltz. Before becoming a professor, Dr. Dos Reis worked at IBM as a systems programmer, creating IBM operating systems and compilers. His teaching interests include computer engineering, program translation, Java, and formal languages.
Texte du rabat
A student-friendly, course-friendly guide to compiler theory, applications, and programming technology Compiler construction is a tricky subject, involving theory, the application of that theory, and programming technology. Virtually every day, advances in computer technology propel advances in compiler technology. Compiler Construction Using Java™, JavaCC, and Yacc covers every topic essential to learning compilers from the ground up and is accompanied by a powerful and flexible software package for evaluating projects as well as several tutorials, well-defined projects, and test cases. While the coverage of JavaCC is entirely optional, this book provides the only comprehensive introduction to the topic currently available. Far easier to read and understand than any other compiler guide, this book sets a new standard for learning this invaluable skill. It provides:
Contenu
Preface xv
Chapter 1 Strings, Languages, and Compilers 1
1.1 Introduction 1
1.2 Basic Language Concepts 1
1.3 Basic Compiler Concepts 3
1.4 Basic Set Theory 4
1.5 Null String 6
1.6 Concatenation 7
1.7 Exponent Notation 7
1.8 Star Operator 8
1.9 Concatenation of Sets of Strings 9
1.10 Plus Operator 11
1.11 Question Mark Operator 11
1.12 Shorthand Notation for a Set Containing a Single String 12
1.13 Operator Precedence 12
1.14 Regular Expressions 13
1.15 Limitations of Regular Expressions 15
Problems 16
Chapter 2 Context-Free Grammars, Part 1 19
2.1 Introduction 19
2.2 What is a Context-Free Grammar? 20
2.3 Derivations Using a Context-Free Grammar 21
2.4 Language Defined by a Context-Free Grammar 23
2.5 Different Ways of Representing Contet-Free Grammars 25
2.6 Some Simple Grammars 26
2.7 Techniques for Generating Languages with Context-Free Grammars 29
2.8 Regular and Right Linear Grammars 35
2.9 Counting with Regular Grammars 37
2.0 Grammars for Lists 39
2.10 An Important Language that is Not Context Free 44
Problems 45
Chapter 3 Context-Free Grammars, Part 2 49
3.1 Introduction 49
3.2 Parse Trees 49
3.3 Leftmost and Rightmost Derivations 51
3.4 Substitution 52
3.5 Ambiguous Grammars 54
3.6 Determining Nullable Nonterminals 59
3.7 Eliminating Lambda Productions 60
3.8 Eliminating Unit Productions 64
3.9 Eliminating Useless Nonterminals 66
3.10 Recursion Conversions 71
3.11 Adding the Null String to a Language 76
Problems 77
Chapter 4 Context-Free Grammars, Part 3 83
4.1 Introduction 83
4.2 Grammars for Arithmetic Expressions 83
4.3 Specifying Associativity and Precedence in Grammars 90
4.4 Backus-Naur Form 92
4.5 Syntax Diagrams 94
4.6 Abstract Syntax Trees and Three-Address Code 96
4.7 Noncontracting Grammars 97
4.8 Essentially Noncontracting Grammars 97
4.9 Converting a Context-Free Grammar to an Essentially Noncontracting Grammar 98
4.10 Pumping Property of Context-Free Languages 101
Problems 104
Chapter 5 Chomsky's Hierarchy 107
5.1 Introduction 107
5.2 Context-Sensitive Productions 107
5.3 Context-Sensitive Grammars no
5.4 Unrestricted Grammars 111
Problems 112
Chapter 6 Top-Down Parsing 115
6.1 Introduction 115
6.2 Top-Down Construction of a Parse Tree 115
6.3 Parses that Fail 117
6.4 A Bad Grammar for Top-Down Parsing 118
6.5 Deterministic Parsers 119
6.6 A Parser that Uses a Stack 120
6.7 Table Representation of a Stack Parser 124
6.8 Handling Productions with Nonleading Terminal 126
6.9 Writing a Stack Parser in Java 127
Problems 134
Chapter 7 LL(1) Grammars 137
7.1 Introduction 137
7.2 FIRST Set of the Right Side of a Production 137
7.3 Determining Operation Sequences 140
7.4 Determining Selection Sets of Lambda Productions 142
7.5 Whatever-Follows-Left-Follows-Rightmost Rule 145
7.6 Selection Sets for Productions with Nullable Right Sides 147
7.7 Selection Sets Containing End-of-Input Symbol 149
7.8 A Stack Parser for a Grammar with Lambda Productions 152
7.9 Converting a Non-LL( 1) Grammar to an LL( 1) Grammar 153
7.10 Parsing with an Ambiguous Grammar 160
7.11 Computing FIRST and FOLLOW Sets 163
Problems 165
Chapter 8 Table-Driven Stack Parser 171
8.1 Introduction 171 8.2 Unifying the Operatio...