- Table_of_ContentsPrefaceAbstractTable of Contents Introduction/1_-_Language_Design,_History,_and_DocumentationF 1.1 - Intended Applications . . . . . . . . . . . . . . . . . 1F 1.2 - Design Goals . . . . . . . . . . . . . . . . . . . . . 2F 1.3 - Language Overview . . . . . . . . . . . . . . . . . . . 4F 1.4 - Language Syntax (BNF) . . . . . . . . . . . . . . . . . 10F 1.5 - Development History . . . . . . . . . . . . . . . . . . 22F 1.6 - Phased LLL/BBN Development . . . . . . . . . . . . . . 24z2_-_Textual_ElementsF 2.1 - Character Set . . . . . . . . . . . . . . . . . . . . . 26F 2.2 - Source Text . . . . . . . . . . . . . . . . . . . . . . 28F Modules . . . . . . . . . . . . . . . . . . . . . . 28F Directives . . . . . . . . . . . . . . . . . . . . . 28F 2.3 - Identifiers - Names . . . . . . . . . . . . . . . . . . 29F 2.4 - Reserved Words . . . . . . . . . . . . . . . . . . . . 31F 2.5 - Predefined Identifiers . . . . . . . . . . . . . . . . 35F 2.6 - Literals . . . . . . . . . . . . . . . . . . . . . . . 36F Numeric Constants . . . . . . . . . . . . . . . . . 36F Integer . . . . . . . . . . . . . . . . . . . . 36F Real . . . . . . . . . . . . . . . . . . . . . . 38F Logical . . . . . . . . . . . . . . . . . . . . 39F Character Constants . . . . . . . . . . . . . . . . 40F Single Character . . . . . . . . . . . . . . . . 40ΠStrings . . . . . . . . . . . . . . . . . . . . 40 2.10 - Chapter Summary . . . . . . . . . . . . . . . . . . . . 53 3_-_TypesF 3.1 - Concept of Type . . . . . . . . . . . . . . . . . . . . 55F 3.2 - Identical, Compatible, and Strong Typing . . . . . . . 57F 3.3 - Basic types . . . . . . . . . . . . . . . . . . . . . . 59F Integer . . . . . . . . . . . . . . . . . . . . . . 59F Real . . . . . . . . . . . . . . . . . . . . . . . . 60F Logical . . . . . . . . . . . . . . . . . . . . . . 60F Char . . . . . . . . . . . . . . . . . . . . . . . . 61F Boolean . . . . . . . . . . . . . . . . . . . . . . 62F 3.4 - Discrete Types . . . . . . . . . . . . . . . . . . . . 64F Range . . . . . . . . . . . . . . . . . . . . . . . 64F Enumeration . . . . . . . . . . . . . . . . . . . . 67F 3.5 - Control Types . . . . . . . . . . . . . . . . . . . . . 68F Interlock . . . . . . . . . . . . . . . . . . . . . 68F 3.6 - Aggregate Types . . . . . . . . . . . . . . . . . . . . 69F Array . . . . . . . . . . . . . . . . . . . . . . . 69F Structure . . . . . . . . . . . . . . . . . . . . . 72F 3.7 - Routines as Types . . . . . . . . . . . . . . . . . . . 75F Procedure . . . . . . . . . . . . . . . . . . . . . 75F Function . . . . . . . . . . . . . . . . . . . . . . 76F 3.8 - Other Types . . . . . . . . . . . . . . . . . . . . . . 77F Pointer . . . . . . . . . . . . . . . . . . . . . . 77F General . . . . . . . . . . . . . . . . . . . . . . 794_-_Data_DeclarationsF 4.1 - Simple and Aggregate Data Declarations . . . . . . . . 81F 4.2 - Types, Constants, and Variables . . . . . . . . . . . . 82F 4.3 - Simple Type Declaration . . . . . . . . . . . . . . . . 83F Initial Value . . . . . . . . . . . . . . . . . . . 83F 4.4 - Simple Constant Declaration . . . . . . . . . . . . . . 85F 4.5 - Simple Variable Declaration . . . . . . . . . . . . . . 89F Initial Value . . . . . . . . . . . . . . . . . . . 89F Volatile . . . . . . . . . . . . . . . . . . . . . . 92F Storage Class . . . . . . . . . . . . . . . . . . . 93F Dynamic . . . . . . . . . . . . . . . . . . . . 94F Static . . . . . . . . . . . . . . . . . . . . . 94F Location . . . . . . . . . . . . . . . . . . . . 95F Segment . . . . . . . . . . . . . . . . . . . . 95F Register . . . . . . . . . . . . . . . . . . . . 96F 4.6 - Constraints on Component Types . . . . . . . . . . . . 98F Size . . . . . . . . . . . . . . . . . . . . . . . . 98G Range . . . . . . . . . . . . . . . . . . . . . . . 100G Unsigned Integers . . . . . . . . . . . . . . . . . 102G Pointer, Procedure, and Function Representation . . 103G 4.7 - Array Type Declaration . . . . . . . . . . . . . . . . 104G Packing . . . . . . . . . . . . . . . . . . . . . . 105G 4.8 - Array Constant Declarations . . . . . . . . . . . . . . 107B String Constants . . . . . . . . . . . . . . . . . .G 4.9 - Array Variables . . . . . . . . . . . . . . . . . . . . 109G Initial Value . . . . . . . . . . . . . . . . . . . 109G Volatile Arrays . . . . . . . . . . . . . . . . . . 110G Storage Class . . . . . . . . . . . . . . . . . . . 110G Dynamic . . . . . . . . . . . . . . . . . . . . 111G Static . . . . . . . . . . . . . . . . . . . . . 111G Location . . . . . . . . . . . . . . . . . . . . 111G Segment . . . . . . . . . . . . . . . . . . . . 111G 4.10 - Flexible Arrays . . . . . . . . . . . . . . . . . . . . 112B Allocation . . . . . . . . . . . . . . . . . . . . .B Formal Parameters . . . . . . . . . . . . . . . . .G 4.11 - Structure Type Declaration . . . . . . . . . . . . . . 114G Variable Specification Fields . . . . . . . . . . . 114G Initial Values . . . . . . . . . . . . . . . . . 115G Volatile Fields and Structures . . . . . . . . . . . 117G Field and Structure Storage Class . . . . . . . . . 118G Dynamic . . . . . . . . . . . . . . . . . . . . 119G Static . . . . . . . . . . . . . . . . . . . . . 119G Location . . . . . . . . . . . . . . . . . . . . 120G Segment . . . . . . . . . . . . . . . . . . . . 120G Structure Access . . . . . . . . . . . . . . . . . . 121G Readonly . . . . . . . . . . . . . . . . . . . . 121G Fill Fields . . . . . . . . . . . . . . . . . . . . 122G Packing . . . . . . . . . . . . . . . . . . . . . . 123G 4.12 - Structure Constants . . . . . . . . . . . . . . . . . . 125G 4.13 - Structure Variables . . . . . . . . . . . . . . . . . . 126G Initial Value . . . . . . . . . . . . . . . . . . . 127G 4.14 - Structure Variants . . . . . . . . . . . . . . . . . . 129G 4.15 - Pointer Declaration and Memory Allocation . . . . . . . 133G Type Declaration . . . . . . . . . . . . . . . . . . 133G Memory Allocation . . . . . . . . . . . . . . . . . 134G 4.16 - Chapter Summary . . . . . . . . . . . . . . . . . . . . 1375_-_ExpressionsG 5.1 - Primary Expressions . . . . . . . . . . . . . . . . . . 140G Identifier . . . . . . . . . . . . . . . . . . . . . 140G Predefined Literals . . . . . . . . . . . . . . . . 141G Enumerated Literals . . . . . . . . . . . . . . . . 141G Constants . . . . . . . . . . . . . . . . . . . . . 142G 5.2 - Operator Expressions . . . . . . . . . . . . . . . . . 143G Infix, Prefix, Postfix . . . . . . . . . . . . . . . 143G Operator Precedence Table . . . . . . . . . . . . . 144G 5.3 - Operators . . . . . . . . . . . . . . . . . . . . . . . 148G Arithmetic . . . . . . . . . . . . . . . . . . . . . 148G Equality . . . . . . . . . . . . . . . . . . . . . . 149G Ordering . . . . . . . . . . . . . . . . . . . . . . 150G Boolean . . . . . . . . . . . . . . . . . . . . . . 151G Logical . . . . . . . . . . . . . . . . . . . . . . 152G Shift . . . . . . . . . . . . . . . . . . . . . . . 153G Pointer Reference . . . . . . . . . . . . . . . . . 153G 5.4 - Aggregate Expressions . . . . . . . . . . . . . . . . . 155G Arrays . . . . . . . . . . . . . . . . . . . . . . . 155G Structures . . . . . . . . . . . . . . . . . . . . . 156G 5.5 - Aggregate Constructors . . . . . . . . . . . . . . . . 158G Type Constructor . . . . . . . . . . . . . . . . . . 158G Table Constructor . . . . . . . . . . . . . . . . . 161G Allocate . . . . . . . . . . . . . . . . . . . . . . 162G Flexible Array Allocation . . . . . . . . . . . . . 164G Allocating Constants . . . . . . . . . . . . . . . . 164G Link-Time Allocate . . . . . . . . . . . . . . . . . 165G 5.6 - Conditional Expressions . . . . . . . . . . . . . . . . 166G 5.7 - Expression Evaluation and Optimization . . . . . . . . 168G Evaluation . . . . . . . . . . . . . . . . . . . . . 168G Optimization . . . . . . . . . . . . . . . . . . . . 168G Explicit . . . . . . . . . . . . . . . . . . . . . . 170G Volatile . . . . . . . . . . . . . . . . . . . . . . 170G Checking and Exception Relationship . . . . . . . . 1716_-_Basic_StatementsG 6.1 - Statement Formats . . . . . . . . . . . . . . . . . . . 173G Simple . . . . . . . . . . . . . . . . . . . . . . . 173G Block Structured . . . . . . . . . . . . . . . . . . 173G Block Labeling . . . . . . . . . . . . . . . . . . . 174G 6.2 - Assignment . . . . . . . . . . . . . . . . . . . . . . 177G "Becomes" Assignment . . . . . . . . . . . . . . . . 177G "Is Transformed By" Assignment . . . . . . . . . . . 180B Aggregate assignment . . . . . . . . . . . . . . . .B Routine assignment . . . . . . . . . . . . . . . . .B String constant assignment . . . . . . . . . . . . .G 6.3 - Iteration Statements . . . . . . . . . . . . . . . . . 183G While . . . . . . . . . . . . . . . . . . . . . . . 183G Repeat . . . . . . . . . . . . . . . . . . . . . . . 184G For . . . . . . . . . . . . . . . . . . . . . . . . 185G For/to . . . . . . . . . . . . . . . . . . . . . 187G For/then . . . . . . . . . . . . . . . . . . . . 189G For/in - discrete type . . . . . . . . . . . . . 192B For/in - sets . . . . . . . . . . . . . . . . .G 6.4 - Loop and Break Statements . . . . . . . . . . . . . . . 194G 6.5 - Flow Control Statements . . . . . . . . . . . . . . . . 198G If/orif/otherwise/endif . . . . . . . . . . . . . . 198G Select Statement . . . . . . . . . . . . . . . . . . 201G Upon Statement . . . . . . . . . . . . . . . . . . . 202G 6.6 - Blocks and Declarations . . . . . . . . . . . . . . . . 206G 6.7 - Chapter Summary . . . . . . . . . . . . . . . . . . . . 207'7_-_Routines_-_Procedures_and_FunctionsG 7.1 - Declarations . . . . . . . . . . . . . . . . . . . . . 209G 7.2 - Routines . . . . . . . . . . . . . . . . . . . . . . . 210G Routine Exit . . . . . . . . . . . . . . . . . . . . 210G Routine Body . . . . . . . . . . . . . . . . . . . . 212G Routine Interface . . . . . . . . . . . . . . . . . 212G Forward Routine Interface . . . . . . . . . . . . . 213G 7.3 - Procedures . . . . . . . . . . . . . . . . . . . . . . 215G 7.4 - Functions . . . . . . . . . . . . . . . . . . . . . . . 216G Returns Clause . . . . . . . . . . . . . . . . . . . 216G Initial Value . . . . . . . . . . . . . . . . . . . 217G Storage . . . . . . . . . . . . . . . . . . . . . . 217G 7.5 - Formal Parameters . . . . . . . . . . . . . . . . . . . 219G Volatile . . . . . . . . . . . . . . . . . . . . . . 221G Storage . . . . . . . . . . . . . . . . . . . . . . 222G Initial Values . . . . . . . . . . . . . . . . . . . 224G Reference Mode (** Phase 1 **) . . . . . . . . . . . 225G Ref/Value/Input . . . . . . . . . . . . . . . . 225B Reference Mode (** Phase 2 **) . . . . . . . . . . .B in/out/inout - data direction . . . . . . . . .B ref/val - reference mode . . . . . . . . .G Default Reference Mode . . . . . . . . . . . . . . . 226G 7.6 - Linkages . . . . . . . . . . . . . . . . . . . . . . . 228G Inline . . . . . . . . . . . . . . . . . . . . . . . 228G Fortran Routines . . . . . . . . . . . . . . . . . . 230G Interrupt Procedures . . . . . . . . . . . . . . . . 231G AST Procedures . . . . . . . . . . . . . . . . . . . 233G 7.7 - Routines as Data Types . . . . . . . . . . . . . . . . 234G 7.8 - Extended Formal Parameters . . . . . . . . . . . . . . 239G Flexible arrays . . . . . . . . . . . . . . . . . . 239G Routines . . . . . . . . . . . . . . . . . . . . . . 242G General . . . . . . . . . . . . . . . . . . . . . . 242G 7.9 - Predefined Functions and Procedures . . . . . . . . . . 244G Functions . . . . . . . . . . . . . . . . . . . . . 244G Max/Min . . . . . . . . . . . . . . . . . . . . 244G Succ/Pred . . . . . . . . . . . . . . . . . . . 245G Abs . . . . . . . . . . . . . . . . . . . . . . 246G Truncate, Round, Floor, and Ceiling . . . . . . 246G Low and High . . . . . . . . . . . . . . . . . . 247G Sizeof . . . . . . . . . . . . . . . . . . . . . 248G Predefined Procedures . . . . . . . . . . . . . . . 248G Swap . . . . . . . . . . . . . . . . . . . . . . 248G Free . . . . . . . . . . . . . . . . . . . . . . 249,8_-_Types,_Conversion,_Scope,_and_Visibility 8.1 - Aspects of Types Types Subtypes - range? Attributes - size, volatile, initially, flexiness? starting, finishing, allocation type: Other - Storage class, allocation invocation Derived types Different" hidden, readonly 8.2 - Type Checking rules assignment reference effects of packing 8.3 - Coercion size and range constants flexible arrays# 8.4 - Explicit type conversion integer/char integer/real integer/logical logical/char 8.5 - Scope Blocks# Dynamic versus static Exceptions Block labels Check control Upon viaducts Flexible arrays) 8.6 - Force - type checking override% 8.7 - General - Formal Parameter 8.8 - Visibility readonly hidden#9_-_Interlocks_and_Critical_RegionsG 9.1 - Interlocks . . . . . . . . . . . . . . . . . . . . . . 302G 9.2 - Interlock Type Declaration . . . . . . . . . . . . . . 303G Initial Value . . . . . . . . . . . . . . . . . . . 303G 9.3 - Interlock Variable Declaration . . . . . . . . . . . . 304G Initial Value . . . . . . . . . . . . . . . . . . . 304G Volatile . . . . . . . . . . . . . . . . . . . . . . 305G Storage Class . . . . . . . . . . . . . . . . . . . 305G 9.4 - Critical Regions . . . . . . . . . . . . . . . . . . . 307B Region Statement . . . . . . . . . . . . . . . . . .G 9.5 - Retry and the Otherwise Clause . . . . . . . . . . . . 310G Otherwise . . . . . . . . . . . . . . . . . . . . . 310G Retry . . . . . . . . . . . . . . . . . . . . . . . 311G 9.6 - Region Exits . . . . . . . . . . . . . . . . . . . . . 314G 9.7 - Interlocked Information Exchange . . . . . . . . . . . 316G Semaphore Example . . . . . . . . . . . . . . . . . 316G Synchronization Example . . . . . . . . . . . . . . 318B Data Exchange Example . . . . . . . . . . . . . . .G 9.8 - Interlock Assignment . . . . . . . . . . . . . . . . . 322G 9.9 - Regions within Interrupt Procedures . . . . . . . . . . 324G 9.10 - Implementations (PDP-11 and VAX) . . . . . . . . . . . 32510_-_Extended_Data_Types 10.1 - Declarations. 10.2 - Allocation and Deallocation clauses Type consistency! Storage class usage) 10.3 - Starting and Finishing clauses Actual procedures 10.4 - Access control readonly hidden Initial values 10.5 - Type compatibility& 10.6 - Structures as encapsulation 10.7 - Examples Semaphore Mailbox511_-_Modules_-_Encapsulation_and_Separate_Compilation 11.1 - Module structure Main versus Normal Nested Modules 11.2 - Module body 11.3 - Access and visibility Export/to Import/from% Use module - Import all! Hidden and readonly 11.4 - Separate Compilation" 11.5 - Synopses and Timestamps 11.6 - Order of compilation! 11.7 - Relationship to Linker12_-_Exception_Handling! 12.1 - Exception Declaration 12.2 - Scope 12.3 - Guard blocks Catch Case and default 12.4 - Raising Exceptions Raise Reraise Finishing clause 12.5 - Nested Guard blocks# 12.6 - Exceptions at Top-level! 12.7 - Predefined exceptions- 12.8 - Relationship to debugging options3 12.9 - Exceptions from Asynchronous procedures Interrupts ASTs' 12.10 - Exceptions from shared code3 12.11 - Exceptions from within critical regions&13_-_Other_Statements_and_Declarations 13.1 - Assertions Assert' check and debug options 13.2 - Assembly level code code/encode3 machine dependence (PDP-11 example)# access to variables( stack and register usage 13.3 - Checking control$ Check on / Check off+ Scoping of checking control/14_-_Compiler_Directives_and_Compiler_Variables 14.1 - Directive Syntax 14.2 - Compiler variables+ Booleans, strings, integers+ declaration - %set, %define- Predefined Compiler variables# 14.3 - Conditional Compilation. %if, %orif, %otherwise, %endif 14.4 - Listing Control %page %list 14.5 - %include. relationship to use and Import 14.6 - Memory segments! %section - Psects Segments0 14.7 - Compiler variables in Object Modules$ 14.8 - Relationship to Checking0 14.9 - Setting variables on Invocation Line7 ***** SPECIAL PHASE 1 APPENDIX *****A *********************************************************,***_Language_changes_from_Phase_1_to_Phase_2! Special Character set Section 2.2 Range+ Sections 3.5, . . . . . Formal Parameters+ Sections 6.5, . . . . .A ********************************************************* Appendices%Appendix A : Bibliographic References$Appendix B : Compiler Error Messages Appendix C : Ascii Character Set