Check nearby libraries
Buy this book
Last edited by AMillarBot
January 14, 2011 | History
This edition doesn't have a description yet. Can you add one?
Check nearby libraries
Buy this book
Edition | Availability |
---|---|
1
Programming Language Pragmatics
March 27, 2009, Morgan Kaufmann
Paperback
- 3 edition
0123745144 9780123745149
|
aaaa
Libraries near you:
WorldCat
|
Book Details
Table of Contents
I.
Foundations
Page 3
1.
Introduction
Page 5
1.1.
The Art of Language Design
Page 7
1.2.
The Programming Language Spectrum
Page 10
1.3.
Why Study Programming Languages?
Page 14
1.4.
Compilation and Interpretation
Page 16
1.5.
Programming Environments
Page 24
1.6.
An Overview of Compilation
Page 25
1.6.1.
Lexical and Syntax Analysis
Page 27
1.6.2.
Semantic Analysis and Intermediate Code Generation
Page 29
1.6.3.
Target Code Generation
Page 33
1.6.4.
Code Improvement
Page 33
1.7.
Summary and Concluding Remarks
Page 35
1.8.
Exercises
Page 36
1.9.
Explorations
Page 37
1.10.
Bibliographic Notes
Page 39
2.
Programming Language Syntax
Page 41
2.1.
Specifying Syntax
Page 42
2.1.1.
Tokens and Regular Expressions
Page 43
2.1.2.
Context-Free Grammars
Page 46
2.1.3.
Derivations and Parse Trees
Page 48
2.2.
Scanning
Page 51
2.2.1.
Generating a Finite Automaton
Page 55
2.2.2.
Scanner Code
Page 60
2.2.3.
Table-Driven Scanning
Page 63
2.2.4.
Lexical Errors
Page 63
2.2.5.
Pragmas
Page 65
2.3.
Parsing
Page 67
2.3.1.
Recursive Descent
Page 70
2.3.2.
Table-Driven Top-Down Parsing
Page 76
2.3.3.
Bottom-Up Parsing
Page 87
2.3.4.
Syntax Errors
Page 99
2.4.
Theoretical Foundations
Page 100
2.4.1.
Finite Automata
2.4.2.
Push-Down Automata
2.4.3.
Grammar and Language Classes
2.5.
Summary and Concluding Remarks
Page 101
2.6.
Exercises
Page 102
2.7.
Explorations
Page 108
2.8.
Bibliographic Notes
Page 109
3.
Names, Scopes, and Bindings
Page 111
3.1.
The Notion of Binding Time
Page 112
3.2.
Object Lifetime and Storage Management
Page 114
3.2.1.
Static Allocation
Page 115
3.2.2.
Stack-Based Allocation
Page 117
3.2.3.
Heap-Based Allocation
Page 118
3.2.4.
Garbage Collection
Page 120
3.3.
Scope Rules
Page 121
3.3.1.
Static Scoping
Page 123
3.3.2.
Nested Subroutines
Page 124
3.3.3.
Declaration Order
Page 127
3.3.4.
Modules
Page 132
3.3.5.
Module Types and Classes
Page 136
3.3.6.
Dynamic Scoping
Page 139
3.4.
Implementing Scope
Page 143
3.4.1.
Symbol Tables
3.4.2.
Association Lists and Central Reference Tables
3.5.
The Meaning of Names Within a Scope
Page 144
3.5.1.
Aliases
Page 144
3.5.2.
Overloading
Page 146
3.5.3.
Polymorphism and Related Concepts
Page 148
3.6.
The Binding of Referencing Environments
Page 151
3.6.1.
Subroutine Closures
Page 153
3.6.2.
First-Class Values and Unlimited Extent
Page 154
3.6.3.
Object Closures
Page 157
3.7.
Macro Expansion
Page 159
3.8.
Separate Compilation
Page 161
3.8.1.
Separate Compilation in C
3.8.2.
Packages and Automatic Header Inference
3.8.3.
Module Hierarchies
3.9.
Summary and Concluding Remarks
Page 162
3.10.
Exercises
Page 163
3.11.
Explorations
Page 171
3.12.
Bibliographic Notes
Page 172
4.
Semantic Analysis
Page 175
4.1.
The Role of the Semantic Analyzer
Page 176
4.2.
Attribute Grammars
Page 180
4.3.
Evaluating Attributes
Page 182
4.4.
Action Routines
Page 191
4.5.
Space Management for Attributes
Page 196
4.5.1.
Bottom-Up Evaluation
4.5.2.
Top-Down Evaluation
4.6.
Decorating a Syntax Tree
Page 197
4.7.
Summary and Concluding Remarks
Page 204
4.8.
Exercises
Page 205
4.9.
Explorations
Page 209
4.10.
Bibliographic Notes
Page 210
5.
Target Machine Architecture
Page 213
5.1.
The Memory Hierarchy
5.2.
Data Representation
5.2.1.
Integer Arithmetic
5.2.2.
Floating-Point Arithmetic
5.3.
Instruction Set Architecture
5.3.1.
Addressing Modes
5.3.2.
Conditions and Branches
5.4.
Architecture and Implementation
5.4.1.
Microprogramming
5.4.2.
Microprocessors
5.4.3.
RISC
5.4.4.
Multithreading and Multicore
5.4.5.
Two Example Architectures: The x86 and MIPS
5.5.
Compiling for Modern Processors
5.5.1.
Keeping the Pipeline Full
5.5.2.
Register Allocation
5.6.
Summary and Concluding Remarks
5.7.
Exercises
5.8.
Explorations
5.9.
Bibliographic Notes
II.
Core Issues in Language Design
Page 217
6.
Control Flow
Page 219
6.1.
Expression Evaluation
Page 220
6.1.1.
Precedence and Associativity
Page 222
6.1.2.
Assignments
Page 224
6.1.3.
Initialization
Page 233
6.1.4.
Ordering Within Expressions
Page 235
6.1.5.
Short-Circuit Evaluation
Page 238
6.2.
Structured and Unstructured Flow
Page 241
6.2.1.
Structured Alternatives to goto
Page 242
6.2.2.
Continuations
Page 245
6.3.
Sequencing
Page 246
6.4.
Selection
Page 247
6.4.1.
Short-Circuited Conditions
Page 248
6.4.2.
Case/Switch Statements
Page 251
6.5.
Iteration
Page 256
6.5.1.
Enumeration-Controlled Loops
Page 256
6.5.2.
Combination Loops
Page 261
6.5.3.
Iterators
Page 262
6.5.4.
Generators in Icon
Page 268
6.5.5.
Logically Controlled Loops
Page 268
6.6.
Recursion
Page 270
6.6.1.
Iteration and Recursion
Page 271
6.6.2.
Applicative- and Normal-Order Evaluation
Page 275
6.7.
Nondeterminacy
Page 277
6.8.
Summary and Concluding Remarks
Page 278
6.9.
Exercises
Page 279
6.10.
Explorations
Page 285
6.11.
Bibliographic Notes
Page 287
7.
Data Types
Page 289
7.1.
Type Systems
Page 290
7.1.1.
Type Checking
Page 291
7.1.2.
Polymorphism
Page 291
7.1.3.
The Meaning of “Type”
Page 293
7.1.4.
Classification of Types
Page 294
7.1.5.
Orthogonality
Page 301
7.2.
Type Checking
Page 303
7.2.1.
Type Equivalence
Page 303
7.2.2.
Type Compatibility
Page 310
7.2.3.
Type Inference
Page 314
7.2.4.
The ML Type System
Page 316
7.3.
Records (Structures) and Variants (Unions)
Page 317
7.3.1.
Syntax and Operations
Page 318
7.3.2.
Memory Layout and Its Impact
Page 319
7.3.3.
With Statements
Page 323
7.3.4.
Variant Records (Unions)
Page 324
7.4.
Arrays
Page 325
7.4.1.
Syntax and Operations
Page 326
7.4.2.
Dimensions, Bounds, and Allocation
Page 330
7.4.3.
Memory Layout
Page 335
7.5.
Strings
Page 342
7.6.
Sets
Page 344
7.7.
Pointers and Recursive Types
Page 345
7.7.1.
Syntax and Operations
Page 346
7.7.2.
Dangling References
Page 356
7.7.3.
Garbage Collection
Page 357
7.8.
Lists
Page 364
7.9.
Files and Input/Output
Page 367
7.9.1.
Interactive I/O
7.9.2.
File-Based I/O
7.9.3.
Text I/O
7.10.
Equality Testing and Assignment
Page 368
7.11.
Summary and Concluding Remarks
Page 371
7.12.
Exercises
Page 373
7.13.
Explorations
Page 379
7.14.
Bibliographic Notes
Page 380
8.
Subroutines and Control Abstraction
Page 383
8.1.
Review of Stack Layout
Page 384
8.2.
Calling Sequences
Page 386
8.2.1.
Displays
Page 389
8.2.2.
Case Studies: C on the MIPS; Pascal on the x86
Page 389
8.2.3.
Register Windows
Page 390
8.2.4.
In-Line Expansion
Page 391
8.3.
Parameter Passing
Page 393
8.3.1.
Parameter Modes
Page 394
8.3.2.
Call by Name
Page 402
8.3.3.
Special Purpose Parameters
Page 403
8.3.4.
Function Returns
Page 408
8.4.
Generic Subroutines and Modules
Page 410
8.4.1.
Implementation Options
Page 412
8.4.2.
Generic Parameter Constraints
Page 414
8.4.3.
Implicit Instantiation
Page 416
8.4.4.
Generics in C++, Java, and C#
Page 417
8.5.
Exception Handling
Page 418
8.5.1.
Defining Exceptions
Page 421
8.5.2.
Exception Propagation
Page 423
8.5.3.
Implementation of Exceptions
Page 425
8.6.
Coroutines
Page 428
8.6.1.
Stack Allocation
Page 430
8.6.2.
Transfer
Page 432
8.6.3.
Implementation of Iterators
Page 433
8.6.4.
Discrete Event Simulation
Page 433
8.7.
Events
Page 434
8.7.1.
Sequential Handlers
Page 434
8.7.2.
Thread-Based Handlers
Page 436
8.8.
Summary and Concluding Remarks
Page 438
8.9.
Exercises
Page 439
8.10.
Explorations
Page 446
8.11.
Bibliographic Notes
Page 447
9.
Data Abstraction and Object Orientation
Page 449
9.1.
Object-Oriented Programming
Page 451
9.2.
Encapsulation and Inheritance
Page 460
9.2.1.
Modules
Page 460
9.2.2.
Classes
Page 463
9.2.3.
Nesting (Inner Classes)
Page 465
9.2.4.
Type Extensions
Page 466
9.2.5.
Extending without Inheritance
Page 468
9.3.
Initialization and Finalization
Page 469
9.3.1.
Choosing a Constructor
Page 470
9.3.2.
References and Values
Page 472
9.3.3.
Execution Order
Page 475
9.3.4.
Garbage Collection
Page 477
9.4.
Dynamic Method Binding
Page 478
9.4.1.
Virtual and Nonvirtual Methods
Page 480
9.4.2.
Abstract Classes
Page 482
9.4.3.
Member Lookup
Page 482
9.4.4.
Polymorphism
Page 486
9.4.5.
Object Closures
Page 489
9.5.
Multiple Inheritance
Page 491
9.5.1.
Semantic Ambiguities
9.5.2.
Replicated Inheritance
9.5.3.
Shared Inheritance
9.5.4.
Mix-In Inheritance
9.6.
Object-Oriented Programming Revisited
Page 492
9.6.1.
The Object Model of Smalltalk
Page 493
9.7.
Summary and Concluding Remarks
Page 494
9.8.
Exercises
Page 495
9.9.
Explorations
Page 498
9.10.
Bibliographic Notes
Page 499
III.
Alternative Programming Models
Page 503
10.
Functional Languages
Page 505
10.1.
Historical Origins
Page 506
10.2.
Functional Programming Concepts
Page 507
10.3.
A Review/Overview of Scheme
Page 509
10.3.1.
Bindings
Page 512
10.3.2.
Lists and Numbers
Page 513
10.3.3.
Equality Testing and Searching
Page 514
10.3.4.
Control Flow and Assignment
Page 515
10.3.5.
Programs as Lists
Page 517
10.3.6.
Extended Example: DFA Simulation
Page 519
10.4.
Evaluation Order Revisited
Page 521
10.4.1.
Strictness and Lazy Evaluation
Page 523
10.4.2.
I/O: Streams and Monads
Page 525
10.5.
Higher-Order Functions
Page 530
10.6.
Theoretical Foundations
Page 534
10.6.1.
Lambda Calculus
10.6.2.
Control Flow
10.6.3.
Structures
10.7.
Functional Programming in Perspective
Page 534
10.8.
Summary and Concluding Remarks
Page 537
10.9.
Exercises
Page 538
10.10.
Explorations
Page 542
10.11.
Bibliographic Notes
Page 543
11.
Logic Languages
Page 545
11.1.
Logic Programming Concepts
Page 546
11.2.
Prolog
Page 547
11.2.1.
Resolution and Unification
Page 549
11.2.2.
Lists
Page 550
11.2.3.
Arithmetic
Page 551
11.2.4.
Search/Execution Order
Page 552
11.2.5.
Extended Example: Tic-Tac-Toe
Page 554
11.2.6.
Imperative Control Flow
Page 557
11.2.7.
Database Manipulation
Page 561
11.3.
Theoretical Foundations
Page 566
11.3.1.
Clausal Form
11.3.2.
Limitations
11.3.3.
Skolemization
11.4.
Logic Programming in Perspective
Page 566
11.4.1.
Parts of Logic Not Covered
Page 566
11.4.2.
Execution Order
Page 567
11.4.3.
Negation and the “Closed World” Assumption
Page 568
11.5.
Summary and Concluding Remarks
Page 570
11.6.
Exercises
Page 571
11.7.
Explorations
Page 573
11.8.
Bibliographic Notes
Page 573
12.
Concurrency
Page 575
12.1.
Background and Motivation
Page 576
12.1.1.
The Case for Multithreaded Programs
Page 579
12.1.2.
Multiprocessor Architecture
Page 581
12.2.
Concurrent Programming Fundamentals
Page 586
12.2.1.
Communication and Synchronization
Page 587
12.2.2.
Languages and Libraries
Page 588
12.2.3.
Thread Creation Syntax
Page 589
12.2.4.
Implementation of Threads
Page 598
12.3.
Implementing Synchronization
Page 603
12.3.1.
Busy-Wait Synchronization
Page 604
12.3.2.
Nonblocking Algorithms
Page 607
12.3.3.
Memory Consistency Models
Page 610
12.3.4.
Scheduler Implementation
Page 613
12.3.5.
Semaphores
Page 617
12.4.
Language-Level Mechanisms
Page 619
12.4.1.
Monitors
Page 619
12.4.2.
Conditional Critical Regions
Page 624
12.4.3.
Synchronization in Java
Page 626
12.4.4.
Transactional Memory
Page 629
12.4.5.
Implicit Synchronization
Page 633
12.5.
Message Passing
Page 637
12.5.1.
Naming Communication Partners
12.5.2.
Sending
12.5.3.
Receiving
12.5.4.
Remote Procedure Call
12.6.
Summary and Concluding Remarks
Page 638
12.7.
Exercises
Page 640
12.8.
Explorations
Page 645
12.9.
Bibliographic Notes
Page 647
13.
Scripting Languages
Page 649
13.1.
What Is a Scripting Language?
Page 650
13.1.1.
Common Characteristics
Page 652
13.2.
Problem Domains
Page 655
13.2.1.
Shell (Command) Languages
Page 655
13.2.2.
Text Processing and Report Generation
Page 663
13.2.3.
Mathematics and Statistics
Page 667
13.2.4.
“Glue” Languages and General Purpose Scripting
Page 668
13.2.5.
Extension Languages
Page 676
13.3.
Scripting the World Wide Web
Page 680
13.3.1.
CGI Scripts
Page 680
13.3.2.
Embedded Server-Side Scripts
Page 681
13.3.3.
Client-Side Scripts
Page 686
13.3.4.
Java Applets
Page 686
13.3.5.
XSLT
Page 689
13.4.
Innovative Features
Page 691
13.4.1.
Names and Scopes
Page 691
13.4.2.
String and Pattern Manipulation
Page 696
13.4.3.
Data Types
Page 704
13.4.4.
Object Orientation
Page 710
13.5.
Summary and Concluding Remarks
Page 717
13.6.
Exercises
Page 718
13.7.
Explorations
Page 723
13.8.
Bibliographic Notes
Page 724
IV.
A Closer Look at Implementation
Page 727
14.
Building a Runnable Program
Page 729
14.1.
Back-End Compiler Structure
Page 729
14.1.1.
A Plausible Set of Phases
Page 730
14.1.2.
Phases and Passes
Page 734
14.2.
Intermediate Forms
Page 734
14.2.1.
Diana
14.2.2.
The gcc IFs
14.2.3.
Stack-Based Intermediate Forms
Page 736
14.3.
Code Generation
Page 738
14.3.1.
An Attribute Grammar Example
Page 738
14.3.2.
Register Allocation
Page 741
14.4.
Address Space Organization
Page 744
14.5.
Assembly
Page 746
14.5.1.
Emitting Instructions
Page 748
14.5.2.
Assigning Addresses to Names
Page 749
14.6.
Linking
Page 750
14.6.1.
Relocation and Name Resolution
Page 751
14.6.2.
Type Checking
Page 751
14.7.
Dynamic Linking
Page 754
14.7.1.
Position-Independent Code
14.7.2.
Fully Dynamic (Lazy) Linking
14.8.
Summary and Concluding Remarks
Page 755
14.9.
Exercises
Page 756
14.10.
Explorations
Page 758
14.11.
Bibliographic Notes
Page 759
15.
Run-time Program Management
Page 761
15.1.
Virtual Machines
Page 764
15.1.1.
The Java Virtual Machine
Page 766
15.1.2.
The Common Language Infrastructure
Page 775
15.2.
Late Binding of Machine Code
Page 784
15.2.1.
Just-in-Time and Dynamic Compilation
Page 785
15.2.2.
Binary Translation
Page 791
15.2.3.
Binary Rewriting
Page 795
15.2.4.
Mobile Code and Sandboxing
Page 797
15.3.
Inspection/Introspection
Page 799
15.3.1.
Reflection
Page 799
15.3.2.
Symbolic Debugging
Page 806
15.3.3.
Performance Analysis
Page 809
15.4.
Summary and Concluding Remarks
Page 811
15.5.
Exercises
Page 812
15.6.
Explorations
Page 815
15.7.
Bibliographic Notes
Page 816
16.
Code Improvement
Page 817
16.1.
Phases of Code Improvement
16.2.
Peephole Optimization
16.3.
Redundancy Elimination in Basic Blocks
16.3.1.
A Running Example
16.3.2.
Value Numbering
16.4.
Global Redundancy and Data Flow Analysis
16.4.1.
SSA Form and Global Value Numbering
16.4.2.
Global Common Subexpression Elimination
16.5.
Loop Improvement I
16.5.1.
Loop Invariants
16.5.2.
Induction Variables
16.6.
Instruction Scheduling
16.7.
Loop Improvement II
16.7.1.
Loop Unrolling and Software Pipelining
16.7.2.
Loop Reordering
16.8.
Register Allocation
16.9.
Summary and Concluding Remarks
16.10.
Bibliographic Notes
A.
Programming Languages Mentioned
Page 819
B.
Language Design and Language Implementation
Page 831
C.
Numbered Examples
Page 835
Bibliography
Page 849
Index
Page 867
Edition Notes
Third Edition
The Physical Object
ID Numbers
Community Reviews (0)
Feedback?January 14, 2011 | Edited by AMillarBot | move edition notes from title to notes field (Third Edition) |
April 28, 2010 | Edited by Open Library Bot | Linked existing covers to the work. |
January 29, 2010 | Edited by WorkBot | add more information to works |
December 11, 2009 | Created by WorkBot | add works page |