ISO Modula-2 Language Reference
Table Of Contents
00
00
00
0000000000000000000000
Introduction
The Lexis
Source Code Structure
Word Tokens
Identifiers
Keywords
Symbols and Operators
Required Symbols
Symbols with alternatives
Operators
Constant Literals
Whole Number Literals
Real Literals
String Literals
Separators
The Language
Programs, Program Modules, and Separate Modules
Programs and Compilation Modules
Program Modules
Definition Modules
Implementation Modules
Program Module and Separate Module Consistency
Module Initialization Order
Program Termination
Import Lists
Export Lists
Implicit Import and Export
Protected Modules
Definitions and Declarations
Identifiers
Qualified Identifiers
Definitions
Type Definitions
Procedure Headings
Declarations
Ordering of Procedure and Module Declarations
Constant Declarations
Type Declarations
Variable Declarations
Procedure Declarations
Local Module Declarations
Auxiliary Formal Model Definitions
Data Types
Type Denoters and Ordinal Type Denoters
Type Identifiers
New Types
Enumeration Types
Subrange Types
Set Types
Packedset Types
Pointer Types
Procedure Types
Formal Types
Array Types
Record Types
Storage Allocation
Expression and Assignment Compatibility
Expression Compatibility
Assignment Compatibility
Blocks
Proper Procedure Blocks
Function Procedure Blocks
Module Blocks
Static Module Initialization
Static Module Finalization
Dynamic Module Initialization
Dynamic Module Finalization
Block Bodies and Exception Handling
Statements
Statement Sequences
Empty Statements
Assignment Statements
Procedure Calls
Return Statements
Retry Statements
With Statements
If Statements
Case Statements
While Statements
Repeat Statements
Loop Statements
Exit Statements
For Statements
Well-formed Control Variables
Auxiliary Functions
Variable Designators
Indexed Designators
Selected Designators
Dereferenced Designators
Expressions
Ordinal Expressions
Infix Expressions and Operations
Prefix Expressions
Value Designators
Function Calls
Value Constructors
Constant Literals
Constant Expressions
Parameter Compatibility and Argument Binding
Actual Parameters
Parameter Matching
Parameter Compatibility
Argument Binding
Predefined Types, Standard Procedures and Standard Functions
Predefined Types
Standard Procedures
Standard Functions
The Environment and Auxiliary Formal Definitions
Environments
Operations on the Environment
Types
Unit Types
Other Type Functions
Values Associated with a Type
The Storage Model and Auxiliary Formal Definitions
The External Program State
The Store
Exceptions
Interrupt Handlers
Operations on Storage
Accessing the Procedure Denotation Component of the State
Program Initialization and Program Termination
Exception Handling
Interrupt Handlers
Accessing the Protection Component of the State
Coroutine and Continuations
System Modules
The Module SYSTEM
The Interface to SYSTEM
The Constants of SYSTEM
The Types of SYSTEM
The Functions of SYSTEM
Address Arithmetic Functions
Address Construction and Enquiry Functions
Packedset Functions
The Function CAST
The Function TSIZE
The Module COROUTINES
The Interface to COROUTINES
The Types of COROUTINES
The Procedures of COROUTINES
The Functions of COROUTINES
The Module EXCEPTIONS
The Interface to EXCEPTIONS
The Types of EXCEPTIONS
The Procedures of EXCEPTIONS
The Functions of EXCEPTIONS
The Module TERMINATION
The Interface to TERMINATION
The Functions of TERMINATION
The Module M2EXCEPTION
The Interface to M2EXCEPTION
The Types of M2EXCEPTION
The Functions of M2EXCEPTION
Language Exceptions
Messages Associated with Language Exceptions
Aggregation and Raising of Language Exceptions
Collected Modula-2 Concrete Syntax
Programs, Program Modules, and Separate Modules
Programs and Compilation Modules
Program Modules
Definition Modules
Implementation Modules
Import Lists
Export Lists
Protected Modules
Definitions and Declarations
Qualified Identifiers
Definitions
Type Definitions
Procedure Headings
Declarations
Constant Declarations
Type Declarations
Variable Declarations
Procedure Declarations
Local Module Declarations
Data Types
Type Denoters and Ordinal Type Denoters
Type Identifiers
New Types
Enumeration Types
Subrange Types
Set Types
Packedset Types
Pointer Types
Procedure Types
Array Types
Record Types
Blocks
Proper Procedure Blocks
Function Procedure Blocks
Module Blocks
Block Bodies and Exception Handling
Statements
Statement Sequences
Empty Statements
Assignment Statements
Procedure Calls
Return Statements
Retry Statements
With Statements
If Statements
Case Statements
While Statements
Repeat Statements
Loop Statements
Exit Statements
For Statements
Variable Designators
Entire Designators
Indexed Designators
Selected Designators
Dereferenced Designators
Expressions
Ordinal Expressions
Infix Expressions and Operations
Value Designators
Value Constructors
Constant Literals
Constant Expressions
Parameter Compatibility and Argument Binding
Actual Parameters