CONTENTS
PREFACE = xiii
PART 1 CONCEPTS
CHAPTER 1 The Study of Programming Languages = 3
1-1 Why study programming languages? = 3
1-2 A brief history = 6
1-3 What makes a good language? = 7
1-4 References and suggestions for further reading = 13
1-5 Problems = 13
CHAPTER 2 Programming Language Processors = 14
2-1 The structure and operation of a computer = 14
2-2 Hardware and firmware computers = 19
2-3 Translators and software-simulated computers = 20
2-4 Syntax, semantics, and virtual computers = 25
2-5 Hierarchies of computers = 28
2-6 Binding and Binding time = 30
2-7 References and suggestions for further reading = 35
2-8 Problems = 36
CHAPTER 3 Elementary Data Types = 38
3-1 Data objects, variables, and constants = 38
3-2 Data types = 43
3-3 Specification of elementary data types = 44
3-4 Implementation of elementary data types = 48
3-5 Declarations = 50
3-6 Type checking and type conversion = 53
3-7 Assignment and initialization = 57
3-8 Numeric data types = 60
3-9 Enumerations = 66
3-10 Booleans = 68
3-11 Characters = 69
3-12 References and suggestions for further reading = 70
3-13 Problems = 70
CHAPTER 4 Structured Data Types = 73
4-1 Structured data objects and data types = 73
4-2 Specification of data structure types = 74
4-3 Implementation of data structure types = 76
4-4 Declarations and type checking for data structures = 81
4-5 Vectors and arrays = 83
4-6 Records = 89
4-7 Character strings = 98
4-8 Variable-size data structures = 102
4-9 Pointers and programmer-constructed data objects = 104
4-10 Sets = 108
4-11 Files and input-output = 111
4-12 References and suggestions for further reading = 118
4-13 Problems = 118
CHAPTER 5 Subprograms and Programmer-Defined Data Types = 124
5-1 Evolution of the data type concepts = 125
5-2 Abstraction, encapsulation, and information hiding = 126
5-3 Subprograms = 128
5-4 Type definitions = 137
5-5 Abstract data types = 142
5-6 References and suggestions for further reading = 147
5-7 Problems = 147
CHAPTER 6 Sequence Control = 149
6-1 Implicit and explicit sequence control = 149
6-2 Sequence control within expressions = 150
6-3 Sequence control between statements = 162
6-4 Subprogram Sequence control : Simple CALL-RETURN = 175
6-5 Recursive subprograms = 183
6-6 Exceptions and exception handlers = 185
6-7 Coroutines = 191
6-8 Scheduled subprograms = 194
6-9 Tasks and concurrent execution = 196
6-10 Data structures and sequence control = 206
6-11 References and suggestions for further reading = 209
6-12 Problems = 210
CHAPTER 7 Data Control = 215
7-1 Names and referencing environments = 216
7-2 Static and dynamic scope = 222
7-3 Block structure = 225
7-4 Local data and local referencing environments = 227
7-5 Shared data : Explicit common environments = 234
7-6 Shared data : Dynamic scope = 238
7-7 Shared data : Static scope and block structure = 241
7-8 Shared data : parameters and parameter transmission = 251
7-9 Tasks and shared data = 272
7-10 References and suggestions for further reading = 275
7-11 Problems = 276
CHAPTER 8 Storage Management = 280
8-1 Major run-time elements requiring storage = 281
8-2 Programmer-and system-controlled storage management = 283
8-3 Storage management phases = 284
8-4 Static storage management = 286
8-5 Stack-based storage management = 285
8-6 Heap storage management : Fixed-size elements = 290
8-7 Heap storage management : Variable-size elements = 297
8-8 References and suggestions for further reading = 300
8-9 Problems = 301
CHAPTER 9 Syntax and Translation = 303
9-1 General syntacitic criteria = 304
9-2 Syntactic elements of a language = 309
9-3 Stages in translation = 314
9-4 Formal definition of syntax = 321
9-5 References and suggestions for further reading = 327
9-6 Problems = 328
CHAPTER 10 Operating and Programming Environments = 330
10-1 Batch-processing environments = 330
10-2 Interactive environments = 332
10-3 Embedded system environments = 333
10-4 Programming environments = 334
10-5 References and suggestions for further reading = 338
CHAPTER 11 Theoretical Models = 339
11-1 Problems in syntax and translation = 340
11-2 Problems in semantics = 345
11-3 Conclusion = 353
11-4 References and suggestions for further reading = 353
PART 2 LANGUAGES
CHAPTER 12 FORTRAN 77 = 357
12-1 Brief overview of the language = 358
12-2 An annotated example : Summation of a vector = 359
12-3 Data types = 361
12-4 Subprograms = 368
12-5 Sequence control = 369
12-6 Data control = 372
12-7 Operating and programming environment = 374
12-8 Syntax and translation = 374
12-9 Structure of a FORTRAN virtual computer = 375
12-10 References and suggestions for further reading = 377
12-11 Problems = 377
CHAPTER 13 COBOL = 378
13-1 Brief overview of the language = 379
13-2 An annotated example : Summing a list of prices = 381
13-3 Data types = 386
13-4 Subprograms = 394
13-5 Sequence control = 394
13-6 Data control = 397
13-7 Operating and programming environment = 398
13-8 Syntax and translation = 398
13-9 Structure of a COBOL virtual computer = 400
13-10 References and suggestions for further reading = 400
13-11 Problems = 400
CHAPTER 14 PL/1 = 402
14-1 Brief overview of the language = 403
14-2 An annotated example : Summation of a vector = 405
14-3 Data types = 407
14-4 Subprograms and programmer-defined data types = 414
14-5 Sequence control = 415
14-6 Data control = 418
14-7 Operating and programming environment = 421
14-8 Syntax and translation = 421
14-9 Structure of a COBOL virtual computer = 423
14-10 References and suggestions for further reading = 424
14-11 Problems = 425
CHAPTER 15 Pascal = 426
15-1 Brief overview of the language = 427
15-2 An annotated example : Summation of a vector = 428
15-3 Data types = 431
15-4 Subprograms and type definitions = 440
15-5 Sequence control = 442
15-6 Data control = 446
15-7 Operating and programming environment = 448
15-8 Syntax and translation = 449
15-9 Structure of a Pascal virtual computer = 452
15-10 References and suggestions for further reading = 453
15-11 Problems = 454
CHAPTER 16 Ada = 457
16-1 Brief overview of the language = 458
16-2 An annotated example : A package for vector processing = 460
16-3 Data types = 464
16-4 Subprograms, type definitions, and packages = 475
16-5 Sequence control = 482
16-6 Data control = 487
16-7 Operating and programming environment = 491
16-8 Syntax and translation = 493
16-9 Structure of a Ada virtual computer = 493
16-10 References and suggestions for further reading = 495
16-11 Problems = 495
CHATPER 17 LISP = 497
17-1 Brief overview of the language = 498
17-2 An annotated example : Building a list of atoms = 499
17-3 Data types = 502
17-4 Subprograms = 510
17-5 Sequence control = 514
17-6 Data control = 516
17-7 Operating and programming environment = 520
17-8 Syntax and translation = 521
17-9 Structure of a LISP virtual computer = 522
17-10 Special topics = 523
17-11 References and suggestions for further reading = 524
17-12 Problems = 525
CHAPTER 18 SNOBOL4 = 528
18-1 Brief overview of the language = 529
18-2 An annotated example : Reversing a string of elements = 530
18-3 Data types = 533
18-4 Subprograms and programmer-defined data types = 545
18-5 Sequence control = 547
18-6 Data control = 549
18-7 Operating and programming environment = 551
18-8 Syntax and translation = 552
18-9 Structure of a SNOBOL4 virtual computer = 553
18-10 References and suggestions for further reading = 555
18-11 Problems = 556
CHAPTER 19 APL = 558
19-1 Brief overview of the language = 559
19-2 An annotated example terminal session : A program to compute the first N primes = 561
19-3 Data types = 564
19-4 Subprograms = 569
19-5 Sequence control = 570
19-6 Data control = 573
19-7 Operating and programming environment = 575
19-8 Syntax and translation = 578
19-9 Structure of a APL virtual computer = 579
19-10 References and suggestions for further reading = 582
19-11 Problems = 582
REFERENCES = 583
INDEX = 593