• Free Shipping Icon

    Free Shipping On Orders Over $59

    Free standard shipping on order over $59 to your home address. Marketplace purchases through third-party sellers are excluded from free shipping promotions.

List Price: $114.37

Rent Textbook

Select for Price
There was a problem. Please try again later.

New Textbook

We're Sorry
Sold Out

Used Textbook

We're Sorry
Sold Out

eTextbook

We're Sorry
Not Available

How Marketplace Works:

  • This item is offered by an independent seller and not shipped from our warehouse
  • Item details like edition and cover design may differ from our description; see seller's comments before ordering.
  • Sellers much confirm and ship within two business days; otherwise, the order will be cancelled and refunded.
  • Marketplace purchases cannot be returned to eCampus.com. Contact the seller directly for inquiries; if no response within two days, contact customer service.
  • Additional shipping costs apply to Marketplace purchases. Review shipping costs at checkout.

Summary

While focusing on the essential techniques common to all language paradigms, this book provides readers with the skills required for modern compiler construction. All the major programming types (imperative, object-oriented, functional, logic, and distributed) are covered. Practical emphasis is placed on implementation and optimization techniques, which includes tools for automating compiler design.

Table of Contents

Preface xiii
Introduction
1(51)
Why study compiler construction?
4(5)
Compiler construction is very successful
6(2)
Compiler construction has a wide applicability
8(1)
Compilers contain generally useful algorithms
8(1)
A simple traditional modular compiler/interpreter
9(13)
The abstract syntax tree
9(2)
Structure of the demo compiler
11(1)
The language for the demo compiler
12(1)
Lexical analysis for the demo compiler
13(1)
Syntax analysis for the demo compiler
14(5)
Context handling for the demo compiler
19(1)
Code generation for the demo compiler
19(2)
Interpretation for the demo compiler
21(1)
The structure of a more realistic compiler
22(3)
The structure
22(2)
Run-time systems
24(1)
Short-cuts
25(1)
Compiler architectures
25(4)
The width of the compiler
26(1)
Who's the boss?
27(2)
Properties of a good compiler
29(3)
Portability and retargetability
32(1)
Place and usefulness of optimizations
32(1)
A short history of compiler construction
33(1)
1945--1960: code generation
33(1)
1960--1975: parsing
33(1)
1975--present: code generation and code optimization; paradigms
34(1)
Grammars
34(6)
The form of a grammar
35(1)
The production process
35(2)
Extended forms of grammars
37(1)
Properties of grammars
38(1)
The grammar formalism
38(2)
Closure algorithms
40(5)
An iterative implementation of the closure algorithm
44(1)
The outline code used in this book
45(2)
Conclusion
47(5)
Summary
47(1)
Further reading
48(1)
Exercises
49(3)
From program text to abstract syntax tree
52(142)
From program text to tokens - the lexical structure
56(54)
Reading the program text
56(1)
Lexical versus syntactic analysis
57(1)
Regular expressions and regular descriptions
58(2)
Lexical analysis
60(1)
Creating a lexical analyzer by hand
61(7)
Creating a lexical analyzer automatically
68(18)
Transition table compression
86(7)
Error handling in lexical analyzers
93(1)
A traditional lexical analyzer generator - lex
94(2)
Lexical identification of tokens
96(2)
Symbol tables
98(5)
Macro processing and file inclusion
103(6)
Conclusion
109(1)
From tokens to syntax tree - the syntax
110(69)
Two classes of parsing methods
111(4)
Error detection and error recovery
115(2)
Creating a top-down parser manually
117(3)
Creating a top-down parser automatically
120(30)
Creating a bottom-up parser automatically
150(29)
Conclusion
179(15)
Summary
181(3)
Further reading
184(1)
Exercises
185(9)
Annotating the abstract syntax tree - the context
194(85)
Attribute grammars
195(43)
Dependency graphs
200(2)
Attribute evaluation
202(8)
Cycle handling
210(7)
Attribute allocation
217(1)
Multi-visit attribute grammars
218(11)
Summary of the types of attribute grammars
229(1)
L-attributed grammars
230(5)
S-attributed grammars
235(1)
Equivalence of L-attributed and S-attributed grammars
235(2)
Extended grammar notations and attribute grammars
237(1)
Conclusion
238(1)
Manual methods
238(31)
Threading the AST
239(6)
Symbolic interpretation
245(8)
Data-flow equations
253(7)
Interprocedural data-flow analysis
260(2)
Carrying the information upstream - live analysis
262(5)
Comparing symbolic interpretation and data-flow equations
267(2)
Conclusion
269(10)
Summary
269(4)
Further reading
273(1)
Exercises
274(5)
Processing the intermediate code
279(117)
Interpretation
281(9)
Recursive interpretation
281(4)
Iterative interpretation
285(5)
Code generation
290(85)
Avoiding code generation altogether
295(1)
The starting point
296(1)
Trivial code generation
297(5)
Simple code generation
302(18)
Code generation for basic blocks
320(17)
BURS code generation and dynamic programming
337(20)
Register allocation by graph coloring
357(6)
Supercompilation
363(1)
Evaluation of code generation techniques
364(1)
Debugging of code optimizers
365(1)
Preprocessing the intermediate code
366(5)
Postprocessing the target code
371(3)
Machine code generation
374(1)
Assemblers, linkers, and loaders
375(8)
Assembler design issues
378(3)
Linker design issues
381(2)
Conclusion
383(13)
Summary
383(6)
Further reading
389(1)
Exercises
389(7)
Memory management
396(42)
Data allocation with explicit deallocation
398(9)
Basic memory allocation
399(4)
Linked lists
403(1)
Extensible arrays
404(3)
Data allocation with implicit deallocation
407(24)
Basic garbage collection algorithms
407(2)
Preparing the ground
409(6)
Reference counting
415(5)
Mark and scan
420(5)
Two-space copying
425(3)
Compaction
428(1)
Generational garbage collection
429(2)
Conclusion
431(7)
Summary
431(3)
Further reading
434(1)
Exercises
435(3)
Imperative and object-oriented programs
438(100)
Context handling
440(20)
Identification
441(8)
Type checking
449(11)
Conclusion
460(1)
Source language data representation and handling
460(21)
Basic types
460(1)
Enumeration types
461(1)
Pointer types
461(4)
Record types
465(1)
Union types
466(1)
Array types
467(3)
Set types
470(1)
Routine types
471(1)
Object types
471(9)
Interface types
480(1)
Routines and their activation
481(20)
Activation records
482(3)
Routines
485(1)
Operations on routines
486(3)
Non-nested routines
489(2)
Nested routines
491(8)
Lambda lifting
499(1)
Iterators and coroutines
500(1)
Code generation for control flow statements
501(22)
Local flow of control
502(10)
Routine invocation
512(7)
Run-time error handling
519(4)
Code generation for modules
523(4)
Name generation
524(1)
Module initialization
524(1)
Code generation for generics
525(2)
Conclusion
527(11)
Summary
528(3)
Further reading
531(1)
Exercises
532(6)
Functional programs
538(58)
A short tour of Haskell
540(8)
Offside rule
540(1)
Lists
541(1)
List comprehension
542(1)
Pattern matching
543(1)
Polymorphic typing
543(1)
Referential transparency
544(1)
Higher-order functions
545(2)
Lazy evaluation
547(1)
Compiling functional languages
548(3)
The functional core
549(2)
Polymorphic type checking
551(2)
Polymorphic function application
551(2)
Desugaring
553(7)
The translation of lists
553(1)
The translation of pattern matching
553(4)
The translation of list comprehension
557(1)
The translation of nested functions
558(2)
Graph reduction
560(8)
Reduction order
564(2)
The reduction engine
566(2)
Code generation for functional core programs
568(7)
Avoiding the construction of some application spines
573(2)
Optimizing the functional core
575(12)
Strictness analysis
575(7)
Boxing analysis
582(1)
Tail calls
582(2)
Accumulator transformation
584(3)
Limitations
587(1)
Advanced graph manipulation
587(2)
Variable-length nodes
587(1)
Pointer tagging
588(1)
Aggregate node allocation
588(1)
Vector apply nodes
588(1)
Conclusion
589(7)
Summary
589(3)
Further reading
592(1)
Exercises
593(3)
Logic programs
596(60)
The logic programming model
598(3)
The building blocks
598(2)
The inference mechanism
600(1)
The general implementation model, interpreted
601(6)
The interpreter instructions
603(3)
Avoiding redundant goal lists
606(1)
Avoiding copying goal list tails
606(1)
Unification
607(8)
Unification of structures, lists, and sets
607(2)
The implementation of unification
609(3)
Unification of two unbound variables
612(2)
Conclusion
614(1)
The general implementation model, compiled
615(19)
List procedures
616(3)
Compiled clause search and unification
619(4)
Optimized clause selection in the WAM
623(5)
Implementing the `cut' mechanism
628(2)
Implementing the predicates assert and retract
630(4)
Compiled code for unification
634(22)
Unification instructions in the WAM
636(2)
Deriving a unification instruction by manual partial evaluation
638(1)
Unification of structures in the WAM
639(7)
An optimization: read/write mode
646(2)
Further unification optimizations in the WAM
648(2)
Conclusion
650(1)
Summary
650(3)
Further reading
653(1)
Exercises
653(3)
Parallel and distributed programs
656(43)
Parallel programming models
659(8)
Shared variables and monitors
659(2)
Message passing models
661(2)
Object-oriented languages
663(1)
The Linda Tuple space
664(1)
Data-parallel languages
665(2)
Processes and threads
667(1)
Shared variables
668(3)
Locks
669(1)
Monitors
669(2)
Message passing
671(3)
Locating the receiver
672(1)
Marshaling
672(1)
Type checking of messages
673(1)
Message selection
674(1)
Parallel object-oriented languages
674(4)
Object location
675(1)
Object migration
676(1)
Object replication
677(1)
Tuple space
678(6)
Avoiding the overhead of associative addressing
679(3)
Distributed implementations of the tuple space
682(2)
Automatic parallelization
684(9)
Exploiting parallelism automatically
685(1)
Data dependencies
686(2)
Loop transformations
688(2)
Automatic parallelization for distributed-memory machines
690(3)
Conclusion
693(6)
Summary
693(2)
Further reading
695(1)
Exercises
695(4)
Appendix A -- A simple object-oriented compiler/interpreter 699(10)
A.1 Syntax-determined classes and semantics-determining methods
699(2)
A.2 The simple object-oriented compiler
701(1)
A.3 Object-oriented parsing
702(6)
A.4 Evaluation
708(1)
Exercise
708(1)
Answers to exercises 709(11)
References 720(8)
Index 728

An electronic version of this book is available through VitalSource.

This book is viewable on PC, Mac, iPhone, iPad, iPod Touch, and most smartphones.

By purchasing, you will be able to view this book online, as well as download it, for the chosen number of days.

Digital License

You are licensing a digital product for a set duration. Durations are set forth in the product description, with "Lifetime" typically meaning five (5) years of online access and permanent download to a supported device. All licenses are non-transferable.

More details can be found here.

A downloadable version of this book is available through the eCampus Reader or compatible Adobe readers.

Applications are available on iOS, Android, PC, Mac, and Windows Mobile platforms.

Please view the compatibility matrix prior to purchase.