Fr. 160.00

Compiler Construction Using Java, Javacc, and Yacc

English · Hardback

Shipping usually within 1 to 3 weeks (not available at short notice)

Description

Read more

Informationen zum Autor 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. Klappentext 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(TM), 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: Strong coverage of formal languages, including context-sensitive and unrestricted languages as well as regular and context-free languages A clear exposition of compiler design and implementation theory Numerous well-defined projects, using source language with six levels of complexity A complete teaching support software package that evaluates compiler projects for correctness, run time, and size of code, and runs on multiple platforms Immediate feedback for students on their projects Compiler Construction Using Java(TM), JavaCC, and Yacc provides substantial support for each project, many of which are incremental enhancements of previous projects. The goals at each new level are challenging but achievable and can be reached in several different ways, for example, by writing a compiler or interpreter by hand, with JavaCC, or with Yacc. Zusammenfassung * Strong coverage of formal languages. The target languages (one is stack-oriented like Java's bytecode; the other is register oriented) are very easy to learn but are sufficiently powerful to support advanced compiler projects * Provides numerous, well-defined projects along with test cases. Inhaltsverzeichnis 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

List of contents

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 Context-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 110
 
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 Parses 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 Co

Report

"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." (Ulitzer, 5 December 2011)

Customer reviews

No reviews have been written for this item yet. Write the first review and be helpful to other users when they decide on a purchase.

Write a review

Thumbs up or thumbs down? Write your own review.

For messages to CeDe.ch please use the contact form.

The input fields marked * are obligatory

By submitting this form you agree to our data privacy statement.