Every identifier occurring in a program must be introduced by a declaration, unless it is a predeclared identifier. Declarations also specify certain permanent properties of an object, such as whether it is a constant, a type, a variable, or a procedure. The identifier is then used to refer to the associated object.
The scope of an object x extends textually from the point of its declaration to the end of the block (module, procedure, or record) to which the declaration belongs and hence to which the object is local. It excludes the scopes of equally named objects which are declared in nested blocks. The scope rules are:
An identifier declared in a module block may be followed by an export mark ("*" or "-") in its declaration to indicate that it is exported. An identifier x exported by a module M may be used in other modules, if they import M (see section Modules). The identifier is then denoted as M.x in these modules and is called a qualified identifier. Identifiers marked with "-" in their declaration are read-only in importing modules.
Qualident = [ident "."]ident.
IdentDef = ident [" * " | " - "].
The following identifiers are predeclared; their meaning is defined in the indicated sections:
ABS | (Predeclared procedures) | LEN | (Predeclared procedures) |
ASH | (Predeclared procedures) | LONG | (Predeclared procedures) |
BOOLEAN | (Basic types) | LONGINT | (Basic types) |
CAP | (Predeclared procedures) | LONGREAL | (Basic types) |
CHAR | (Basic types) | MAX | (Predeclared procedures) |
CHR | (Predeclared procedures) | MIN | (Predeclared procedures) |
COPY | (Predeclared procedures) | NEW | (Predeclared procedures) |
DEC | (Predeclared procedures) | ODD | (Predeclared procedures) |
ENTIER | (Predeclared procedures) | ORD | (Predeclared procedures) |
EXCL | (Predeclared procedures) | REAL | (Basic types) |
FALSE | (Basic types) | SET | (Basic types) |
HALT | (Predeclared procedures) | SHORT | (Predeclared procedures) |
INC | (Predeclared procedures) | SHORTINT | (Basic types) |
INCL | (Predeclared procedures) | SIZE | (Predeclared procedures) |
INTEGER | (Basic types) | TRUE | (Basic types) |