Iso 10206
Iso 10206
ISO 10206:1990
This online copy of the Extended Pascal standard is provided only as an aid to standardization. In
the case of dierences between this online version and the printed version, the printed version takes
precedence.
Do not modify this document. Do not include this document in another software product. You may
print this document for personal use only. Do not sell this document.
Use this information only for good; never for evil. Do not expose to re. Do not operate heavy
equipment after reading, may cause drowsiness. Do not read under the in
uence of alcohol (although
there have been several unconrmed reports that alcohol actually improves the readability). The
standard is written in English. If you have trouble understanding a particular section, read it again
and again and again... Sit up straight. Eat your vegatables. Do not mumble.
c ISO/IEC 1991
ISO/IEC 10206:1990(E)
ii
ISO/IEC 10206:1990(E)
Acknowledgements
The eorts are acknowledged of all those who contributed to the work of WG2, and in particular:
Brian Wichmann
Convener
David Bustard Harris Hall John Reagan
Barry Byrne Carsten Hammer Paula Schwartz
Klaus Daessler Tony Hetherington Steven Siegfried
Norman Diamond Steve Hobbs Manfred Stadel
Bob Dietrich David Joslin Tom Turba
Ken Edwards Jim Miner Willem Wakker
The eorts are acknowledged of all those who contributed to the work of JPC, and in particular:
Thomas N. Turba Michael Patrick Hagerty John R. Reagan
Chairman X3J9 Chairman IEEE P770 Secretary
Steve Adamczyk Steven Hobbs David L. Presberg
Jerey Allen Albert A Homan William C. Price
Edward Barkmeyer Michael A. Houghtaling Bruce Ravenely
Beth Benoit Robert C. Hutchins David L. Reese
W. Ashby Boaz Rosa C. Hwang Mike Renfro
Jack Boudreaux Scott Jameson David C. Robbins
Jerry R. Brookshire Janis Johnson Richard H. Rosenbaum
A. Winsor Brown Jay K Joiner Lynne Rosenthal
Tom Bucken David T. Jones Thomas Rudkin
Thomas M. Burger David Joslin Steve Russell
David S. Cargo Mel Kanner Paula Schwartz
Joe Cointment Leslie Klein Evelyn Scott
Roger Cox Dennis A. Kodimer Wayne Sewell
Jean Danver Ronald E. Kole Steve Siegfried
Debra Deutsch Bill Kraynek Nancy Simmons
Bob Dietrich Robert G. Lange Dave Skinner
Jane Donaho Charles Linett Carol Sledgez
Kenneth K. Edwards David Lyman Barry Smith
John Flores Pat Mayekawa Peter Steinfeld
Victor A. Folwarczny Rainer F. McCown Michael C. Stinson
Dennis Foster Jim Miner Prescott K. Turner
Thomas Giventer Eugene N. Miya Robert Tuttle
Hellmut Golde Mark Molloy Richard C. Vile, Jr
David N. Gray Wes Munsil Larry B. Weber
Paul Gregory David Neal David Weil
Ann Grossman William Neuhauser Brian Wichmann x
Harris Hall Dennis Nicholson Thomas R. Wilcox
iii
ISO/IEC 10206:1990(E)
iv
ISO/IEC 10206:1990(E)
Introduction
This International Standard provides an unambiguous and machine independent denition of the
programming language Extended Pascal. Its purpose is to facilitate portability of Extended Pascal
programs for use on a wide variety of data processing systems.
Language history
The computer programming language Pascal was designed by Professor Niklaus Wirth to satisfy two
principal aims
a) to make available a language suitable for teaching programming as a systematic discipline
based on certain fundamental concepts clearly and naturally re
ected by the language;
b) to dene a language whose implementations could be reliable and ecient on then-available
computers.
However, it has become apparent that Pascal has attributes that go far beyond those original goals.
It is now being increasingly used commercially in the writing of system and application software.
With this increased use, there has been an increased demand for and availability of extensions to ISO
7185:1983, Programming languages - PASCAL. Programs using such extensions attain the benets
of the extended features at the cost of portability with standard Pascal and with other processors
supporting dierent sets of extensions. In the absence of a standard for an extended language,
these processors have become increasingly incompatible. This International Standard is primarily a
consequence of the growing commercial interest in Pascal and the need to promote the portability
of Pascal programs between data processing systems.
Project history
In 1977, a working group was formed within the British Standards Institution (BSI) to produce a
standard for the programming language Pascal. This group produced several working drafts, the
rst draft for public comment being widely published early in 1979. In 1978, BSI's proposal that
Pascal be added to ISO's programme of work was accepted, and the ISO Pascal Working Group (then
designated ISO/TC97/SC5/WG4) was formed in 1979. The Pascal standard was to be published
by BSI on behalf of ISO, and this British Standard referenced by the International Standard.
In the USA, in the fall of 1978, application was made to the IEEE Standards Board by the IEEE
Computer Society to authorize project 770 (Pascal). After approval, the rst meeting was held in
January 1979.
In December 1978, X3J9 convened as a result of a SPARC (Standards Planning and Requirements
Committee) resolution to form a US TAG (Technical Advisory Group) for the ISO Pascal
standardization eort initiated by the UK. These eorts were performed under X3 project 317.
In agreement with IEEE representatives, in February 1979, an X3 resolution combined the X3J9
and P770 committees into a single committee called the Joint X3J9/IEEE P770 Pascal Standards
Committee. (Throughout, the term JPC refers to this committee.) The rst meeting as JPC was
held in April 1979.
v
ISO/IEC 10206:1990(E)
The resolution to form JPC claried the dual function of the single joint committee to produce a
dpANS and a proposed IEEE Pascal standard, identical in content.
ANSI/IEEE770X3.97-1983, American National Standard Pascal Computer Programming Language,
was approved by the IEEE Standards Board on September 17, 1981, and by the American
National Standards Institute on December 16, 1982. British Standard BS6192, Specication for
Computer programming language Pascal, was published in 1982, and International Standard 7185
(incorporating BS6192 by reference) was approved by ISO on December 1, 1983. Dierences
between the ANSI and ISO standards are detailed in the Foreword of ANSI/IEEE770X3.97-
1983. (BS6192/ISO7185 was revised and corrected during 1988/89; it is expected that
ANSI/IEEE770X3.97-1983 will be replaced by the revised ISO 7185.)
Following the decision that the rst publication of a standard for the programming language Pascal
would not contain extensions to the language, JPC prepared a project proposal to SPARC for an
Extended Pascal Standard. When approved by X3 in November 1980, this proposal formed the
charter for Project 345.
JPC immediately formed the Extension Task Group to receive all proposals for extensions to the
Pascal language, developed the content of proposals so that they were in a form suitable for review
by JPC, fairly and equitably reviewed all proposals in light of published JPC policy, and provided
a liaison with the public in all matters concerning proposed extensions to the Pascal language.
X3 issued a press release on behalf of JPC in January 1980 to solicit extension proposals or
suggestions from the general public. At this time, JPC had already prepared a list of priority
extensions; public comment served to validate and supplement the priority list. Criteria for
evaluating extensions were established and included machine independence, upward compatibility,
conceptual integrity, rigorous denition, and existing practice as prime objectives. Extension
proposals submitted by the public and by the JPC membership were developed and rened. JPC
procedures guaranteed that proposals would be considered over at least two meetings, aording
adequate time for review of the technical merits of each proposal.
By June of 1983, twelve extensions had been designated by JPC as candidate extensions and were
published as a Candidate Extension Library. Ongoing work was described in Work in Progress,
published with the Candidate Extension Library. This eort served as an interim milestone and an
opportunity for the public to review the eort to date.
In 1984, BSI also started work on extensions to Pascal, with an initial aim of providing extensions in
a few areas only. In 1985, the ISO Pascal Working Group (then designated ISO/TC97/SC22/WG2,
now ISO/IEC JTC1/SC22/WG2) was reconvened after a long break to consider proposals from
both ANSI and BSI in an international forum. Thereafter WG2 met at regular intervals to reconcile
the national standardization activities in ANSI and BSI and to consider issues raised by the other
experts participating in WG2.
The Work in Progress, along with other proposals subsequently received, continued its development
until June 1986. The process of reconciling individual candidate extensions among themselves was
begun in September 1984 and continued until June 1986. During this phase, con
icts between
changes were resolved and each change was reconsidered. Working drafts of the full standard were
circulated within JPC and WG2 to incorporate changes from each meeting.
vi
ISO/IEC 10206:1990(E)
The candidate extensions were then integrated into a draft standard that was issued for public
review. The Public Comment Task Group (PCTG) was formed to respond to the public comments
and recommend changes to the draft. To promote a unied response on each comment issue, PCTG
included members from both WG2 and JPC. All responses and recommended changes required nal
approval by JPC and WG2. PCTG recommended several substantive changes that were subsequently
approved as changes to the draft. These changes were incorporated and a new draft was produced
for a second public review.
Project charter
The goal of JPC's Project 345 was to dene an implementable, internationally acceptable Extended
Pascal Standard.
This International Standard was to encompass those extensions found to be
a) compatible with ANSI/IEEE770X3.97-1983, American National Standard Programming
Language Pascal, and
b) benecial with respect to cost.
JPC's approved program of work included:
a) solicitation of proposals for extended language features;
b) the critical review of such proposals;
c) synthesis of those features found to be acceptable individually and which are mutually
consistent into a working draft proposed standard;
d) interface with all interested standards bodies, both domestic and international;
e) submission of the working draft to ISO/TC97/SC22/WG2;
f) synthesis and submission of a draft proposed ANS consistent with any international standard
developed;
g) review and correction of the dpANS in light of any comment received during Public Comment
and/or Trial Use periods.
Technical development
Extended Pascal incorporates the features from ANSI/IEEE770X3.97-1983 and the following new
features:
a) Modularity and Separate Compilation. Modularity provides for separately-compilable
program components, while maintaining type security.
|Each module exports one or more interfaces containing entities (values, types, schemata,
variables, procedures, and functions) from that module, thereby controlling visibility into
the module.
vii
ISO/IEC 10206:1990(E)
|A variable may be protected on export, so that an importer may use it but not alter its
value. A type may be restricted, so that its structure is not visible.
|The form of a module clearly separates its interfaces from its internal details.
|Any block may import one or more interfaces. Each interface may be used in whole or in
part.
|Entities may be accessed with or without interface-name qualication.
|Entities may be renamed on export or import.
|Initialization and nalization actions may be specied for each module.
|Modules provide a framework for implementation of libraries and non-Pascal program
components.
b) Schemata. A schema determines a collection of similar types. Types may be selected statically
or dynamically from schemata.
|Statically selected types are used as any other types are used.
|Dynamically selected types subsume all the functionality of, and provide functional
capability beyond, conformant arrays.
|The allocation procedure new may dynamically select the type (and thus the size) of the
allocated variable.
|A schematic formal-parameter adjusts to the bounds of its actual-parameters.
|The declaration of a local variable may dynamically select the type (and thus the size) of
the variable.
|The with-statement is extended to work with schemata.
|Formal schema discriminants can be used as variant selectors.
c) String Capabilities. The comprehensive string facilities unify xed-length strings and
character values with variable-length strings.
|All string and character values are compatible.
|The concatenation operator (+) combines all string and character values.
|Variable-length strings have programmer-specied maximum lengths.
|Strings may be compared using blank padding via the relational operators or using no
padding via the functions EQ, LT, GT, NE, LE, and GE.
|The functions length, index, substr, and trim provide information about, or
manipulate, strings.
|The substring-variable notation makes accessible, as a variable, a xed-length portion of
a string variable.
viii
ISO/IEC 10206:1990(E)
|The transfer procedures readstr and writestr process strings in the same manner that
read and write process textles.
|The procedure read has been extended to read strings from textles.
d) Binding of Variables.
|A variable may optionally be declared to be bindable. Bindable variables may be bound
to external entities (le storage, real-time clock, command lines, etc.). Only bindable
variables may be so bound.
|The procedures bind and unbind, together with the related type BindingType, provide
capabilities for connection and disconnection of bindable internal (le and non-le)
variables to external entities.
|The function binding returns current or default binding information.
e) Direct Access File Handling.
|The declaration of a direct-access le indicates an index by which individual le elements
may be accessed.
|The procedures SeekRead, SeekWrite, and SeekUpdate position the le.
|The functions position, LastPosition, and empty report the current position and size
of the le.
|The update le mode and its associated procedure update provide in-place modication.
f) File Extend Procedure. The procedure extend prepares an existing le for writing at its
end.
g) Constant Expressions. A constant expression may occur in any context needing a constant
value.
h) Structured Value Constructors. An expression may represent the value of an array, record,
or set in terms of its components. This is particularly valuable for dening structured constants.
i) Generalized Function Results. The result of a function may have any assignable type.
A function result variable may be specied, which is especially useful for functions returning
structures.
j) Initial Variable State. The initial state specier of a type can specify the value with which
variables are to be created.
k) Relaxation of Ordering of Declarations. There may be any number of declaration parts
(labels, constants, types, variables, procedures, and functions) in any order. The prohibition
of forward references in declarations is retained.
l) Type Inquiry. A variable or parameter may be declared to have the type of another
parameter or another variable.
ix
ISO/IEC 10206:1990(E)
x
ISO/IEC 10206:1990(E)
Technical reports
During the development of this International Standard, various proposals were considered but not
incorporated due to consideration of time and other factors. Selected proposals may be published
as Technical Reports.
xi
ISO/IEC 10206:1990(E)
xii
INTERNATIONAL STANDARD ISO/IEC 10206:1990(E)
1 Scope
1.1
This International Standard species the semantics and syntax of the computer programming
language Extended Pascal by specifying requirements for a processor and for a conforming program.
Two levels of compliance are dened for both processors and programs.
1.2
This International Standard does not specify
a) the size or complexity of a program and its data that will exceed the capacity of any specic
data processing system or the capacity of a particular processor, nor the actions to be taken
when the corresponding limits are exceeded;
b) the minimal requirements of a data processing system that is capable of supporting an implementation
of a processor for Extended Pascal;
c) the method of activating the program-block or the set of commands used to control the
environment in which an Extended Pascal program is transformed and executed;
d) the mechanism by which programs written in Extended Pascal are transformed for use by a
data processing system;
e) the method for reporting errors or warnings;
f) the typographical representation of a program published for human reading.
2 Normative reference
The following standard contains provisions which, through reference in this text, constitute provisions
of this International Standard. At the time of publication, the edition indicated was valid. All
standards are subject to revision, and parties to agreements based on this International Standard
are encouraged to investigate the possibility of applying the most recent edition of the standard listed
below. Members of IEC and ISO maintain registers of currently valid International Standards.
ISO 646:1983, Information processing | ISO 7-bit coded character set for information interchange.
1
ISO/IEC 10206:1990(E)
3 Denitions
For the purposes of this International Standard, the following denitions apply.
NOTE | To draw attention to language concepts, some terms are printed in italics on their rst mention
or at their dening occurrence(s) in this International Standard.
3.1 Dynamic-violation
A violation by a program of the requirements of this International Standard that a processor is
permitted to leave undetected up to, but not beyond, execution of the declaration, denition, or
statement that exhibits (see clause 6) the dynamic-violation.
3.2 Error
A violation by a program of the requirements of this International Standard that a processor is
permitted to leave undetected.
NOTES
1 If it is possible to construct a program in which the violation or non-violation of this standard requires
knowledge of the data read by the program or the implementation denition of implementation-dened
features, then violation of that requirement is classied as either a dynamic-violation or an error. Processors
may report on such violations of the requirement without such knowledge, but there always remain some cases
that require execution, simulated execution, or proof procedures with the required knowledge. Requirements
that can be veried without such knowledge are not classied as dynamic-violations or errors.
2 Processors should attempt the detection of as many errors as possible, and to as complete a degree as
possible. Permission to omit detection is provided for implementations in which the detection would be an
excessive burden.
3.3 Extension
A modication to clause 6 of the requirements of this International Standard that does not invalidate
any program complying with this International Standard, as dened by 5.2, except by prohibiting
the use of one or more particular spellings of identiers.
3.5 Implementation-dependent
Possibly diering between processors and not necessarily dened for any particular processor.
2
ISO/IEC 10206:1990(E)
3.6 Processor
A system or mechanism that accepts a program as input, prepares it for execution, and executes the
process so dened with data to produce results.
NOTE | A processor may consist of an interpreter, a compiler and run-time system, or another mechanism,
together with an associated host computing machine and operating system, or another mechanism for
achieving the same eect. A compiler in itself, for example, does not constitute a processor.
4 Denitional conventions
The metalanguage used in this International Standard to specify the syntax of the constructs is
based on Backus-Naur Form. The notation has been modied from the original to permit greater
convenience of description and to allow for iterative productions to replace recursive ones. Table 1
lists the meanings of the various metasymbols. Further specication of the constructs is given by
prose and, in some cases, by equivalent program fragments. Any identier that is dened in clause
6 as a required identier shall denote the corresponding required entity by its occurrence in such
a program fragment. In all other respects, any such program fragment is bound by any pertinent
requirement of this International Standard.
A meta-identier shall be a sequence of letters and hyphens beginning with a letter.
A sequence of terminal and nonterminal symbols in a production implies the concatenation of the
text that they ultimately represent. Within 6.1 this concatenation is direct; no characters shall
intervene. In all other parts of this International Standard the concatenation is in accordance with
the rules set out in 6.1.
The characters required to form Extended Pascal programs shall be those implicitly required to form
the tokens and separators dened in 6.1.
Use of the words of, in, containing, and closest-containing, when expressing a relationship between
terminal or nonterminal symbols, shall have the following meanings
|the x of a y: refers to the x occurring directly in a production dening y;
3
ISO/IEC 10206:1990(E)
5 Compliance
There are two levels of compliance, level 0 and level 1. Level 0 does not include conformant-array-
parameters. Level 1 does include conformant-array-parameters.
5.1 Processors
A processor complying with the requirements of this International Standard shall
a) if it complies at level 0, accept all the features of the language specied in clause 6, except for
6.7.3.6 e), 6.7.3.7, and 6.7.3.8, with the meanings dened in clause 6;
b) if it complies at level 1, accept all the features of the language specied in clause 6 with the
meanings dened in clause 6;
c) not require the inclusion of substitute or additional language elements in a program in order
to accomplish a feature of the language that is specied in clause 6;
d) be accompanied by a document that provides a denition of all implementation-dened features;
e) be able to determine whether or not the program violates any requirements of this International
Standard, where such a violation is not designated an error or dynamic-violation, report the
4
ISO/IEC 10206:1990(E)
result of this determination to the user of the processor before the activation of the program-
block, if any, and shall prevent activation of the program-block, if any;
f) treat each violation that is designated a dynamic-violation in at least one of the following ways
1) the processor shall report the dynamic-violation or the possibility of the dynamic-violation
during preparation of the program for execution and in the event of such a report shall be
able to continue further processing and shall be able to refuse execution of the program-
block;
2) the processor shall report the dynamic-violation during execution of the program;
and if a dynamic-violation is reported during execution of the program, the processor shall
terminate execution; if a dynamic-violation occurs within a declaration, denition, or statement,
the execution of that declaration, denition, or statement shall not be completed;
NOTE | 1 Dynamic-violations, like all violations except errors, must be detected.
g) treat each violation that is designated an error as either:
1) a dynamic-violation; or
2) there shall be a statement in an accompanying document that the error is not reported,
and a note referencing each such treatment shall appear in a separate section of the
accompanying document;
and if an error is reported during execution of the program, the processor shall terminate
execution; if an error occurs within a declaration, denition, or statement, the execution of
that declaration, denition, or statement shall not be completed;
NOTE | 2 This means that processing will continue up to or beyond execution of the program at
the option of the user.
h) be accompanied by a document that separately describes any features accepted by the processor
that are prohibited or not specied in clause 6: such extensions shall be described as being
`extensions to Extended Pascal as specied by ISO/IEC 10206';
i) be able to process, in a manner similar to that specied for errors, any use of any such extension;
and
j) be able to process, in a manner similar to that specied for errors, any use of an implementation-
dependent feature.
NOTE | 3 The phrase `be able to' is used in 5.1 to permit the implementation of a switch with which the
user may control the reporting.
A processor that purports to comply, wholly or partially, with the requirements of this International
Standard shall do so only in the following terms. A compliance statement shall be produced
by the processor as a consequence of using the processor or shall be included in accompanying
documentation. If the processor complies in all respects with the requirements of this standard, the
compliance statement shall be:
5
ISO/IEC 10206:1990(E)
hThis processori complies with the requirements of level hnumberi of ISO/IEC 10206.
If the processor complies with some but not all of the requirements of this International Standard
then it shall not use the above statement, but shall instead use the following compliance statement
hThis processori complies with the requirements of level hnumberi of ISO/IEC 10206 with the
following exceptions: hfollowed by a reference to, or a complete list of, the requirements of the
standard with which the processor does not complyi.
In both cases the text hThis processori shall be replaced by an unambiguous name identifying the
processor, and the text hnumberi shall be replaced by the appropriate level number'
NOTE | 4 Processors that do not comply fully with the requirements of the International Standard are
not required to give full details of their failures to comply in the compliance statement; a brief reference
to accompanying documentation that contains a complete list in sucient detail to identify the defects is
sucient.
5.2 Programs
A program conforming with the requirements of this International Standard shall
a) if it conforms at level 0, use only those features of the language specied in clause 6, except
for 6.7.3.6 e), 6.7.3.7, and 6.7.3.8;
b) if it conforms at level 1, use only those features of the language specied in clause 6; and
c) not rely on any particular interpretation of implementation-dependent features.
NOTES
1 A program that conforms with the requirements of this International Standard may rely on particular
implementation-dened values or features.
2 The requirements for conforming programs and compliant processors do not require that the results
produced by a conforming program are always the same when processed by a compliant processor. They
may be the same, or they may dier, depending on the program. A simple program to illustrate this is:
program x(output); begin writeln(maxint) end.
6 Requirements
6.1 Lexical tokens
NOTE | The syntax given in this subclause describes the formation of lexical tokens from characters and
the separation of these tokens and therefore does not adhere to the same rules as the syntax in the rest of
this International Standard.
6.1.1 General
The lexical tokens used to construct Extended Pascal programs are classied into special-symbols,
identiers, remote-directives, interface-directives, implementation-directives, unsigned-numbers, extended-
6
ISO/IEC 10206:1990(E)
numbers, labels, and character-strings. The representation of any character (upper case or lower
case, dierences of font, etc.) occurring anywhere outside of a character-string (see 6.1.9) shall be
insignicant in that occurrence to the meaning of the program.
letter = `a' j `b' j `c' j `d' j `e' j `f' j `g' j `h' j `i' j `j'
j `k' j `l' j `m' j `n' j `o' j `p' j `q' j `r' j `s'
j `t' j `u' j `v' j `w' j `x' j `y' j `z' .
digit = `0' j `1' j `2' j `3' j `4' j `5' j `6' j `7' j `8' j `9' .
6.1.2 Special-symbols
The special-symbols are tokens having special meanings and are used to delimit the syntactic units
of the language.
special-symbol = `+' j `;' j `*' j `/' j `=' j `<' j `>' j `[' j `]'
j `.' j `,' j `:' j `;' j `"' j `(' j `)' j `**'
j `<>' j `<=' j `>=' j `:=' j `..' j `><' j `=>'
j word-symbol .
word-symbol = `and' j `and then' j `array' j `begin' j `bindable' j `case'
j `const' j `div' j `do' j `downto' j `else' j `end' j `export'
j `le' j `for' j `function' j `goto' j `if' j `import'
j `in' j `label' j `mod' j `module' j `nil' j `not' j `of'
j `only' j `or' j `or else' j `otherwise' j `packed' j `pow'
j `procedure' j `program' j `protected' j `qualied'
j `record' j `repeat' j `restricted' j `set' j `then' j `to'
j `type' j `until' j `value' j `var' j `while' j `with' .
7
ISO/IEC 10206:1990(E)
GInqWsTran
DeviceDriverIdentificationHeader
DeviceDriverIdentificationBody
Trondheim Hammer Dance
6.1.4 Remote-directives
A remote-directive shall only occur in a procedure-declaration or a function-declaration. The remote-
directive shall be the required remote-directive forward (see 6.7.1 and 6.7.2).
remote-directive = directive .
directive = letter f [ underscore ] ( letter j digit ) g .
NOTE | Many processors provide, as an extension, the remote-directive external, which is used to specify
that the procedure-block or function-block corresponding to that procedure-heading or function-heading is
external to the program-block. Usually it is in a library in a form to be input to, or that has been produced
by, the processor. When providing such an extension, a processor should enforce the rules of Extended
Pascal pertaining to type compatibility.
6.1.5 Interface-directives
An interface-directive shall only occur in a module-heading of a module-declaration. The interface-
directive shall be the required interface-directive interface (see 6.11.1).
interface-directive = directive .
NOTE | A processor may provide, as an extension, the interface-directive external, which is used to
specify that the module-block corresponding to the module-heading containing the interface-directive is in
some form other than an Extended Pascal module-block (e.g., it is implemented in some other language).
When providing such an extension, a processor should enforce the rules of Extended Pascal pertaining to
type compatibility.
6.1.6 Implementation-directives
An implementation-directive shall only occur in a module-identication of a module-declaration.
The implementation-directive shall be the required implementation-directive implementation (see
6.11.1).
implementation-directive = directive .
6.1.7 Numbers
An unsigned-integer shall denote in decimal notation a value of integer-type (see 6.4.2.2). An
unsigned-real shall denote in decimal notation a value of real-type (see 6.4.2.2). The letter `e'
preceding a scale-factor shall mean times ten to the power of. The value denoted by an unsigned-
integer shall be in the closed interval 0 to maxint (see 6.4.2.2).
8
ISO/IEC 10206:1990(E)
An extended-digit that is a digit shall denote a digit-value which shall be the number of predecessors
of that digit in the syntactic denition of digit in 6.1.1. An extended-digit that is a letter shall
denote a digit-value which shall be greater by ten than the number of predecessors of that letter in
the syntactic denition of letter in 6.1.1. The unsigned-integer of an extended-number shall denote
the radix of the extended-number; the radix shall be in the closed interval two through thirty-six.
No extended-digit in an extended-number shall denote a digit-value that equals or exceeds the radix
of the extended-number. An extended-number shall denote, in conventional positional notation with
the specied radix, a value of integer-type in the closed interval 0 to maxint (see 6.4.2.2).
extended-digit = digit j letter .
extended-number = unsigned-integer `#' extended-digit f extended-digit g .
Examples:
16#ff
8#377
9
ISO/IEC 10206:1990(E)
32#100
13#42 f the answer to the ultimate question of life,
the universe, and everything g
NOTE | 2 The character # is regarded as identical to corresponding currency symbols that appear in some
national variants of ISO 646.
6.1.8 Labels
Labels shall be digit-sequences and shall be distinguished by their apparent integral values and shall
be in the closed interval 0 to 9999. The spelling of a label shall be its apparent integral value.
label = digit-sequence .
6.1.9 Character-strings
A character-string containing a single string-element shall denote a value of the char-type (see
6.4.2.2). A character-string containing other than a single string-element shall denote a value of the
canonical-string-type (see 6.4.3.3.1) with a length equal to the number of string-elements contained
in the character-string.
There shall be an implementation-dened one-to-one correspondence between the set of alternatives
from which string-elements are drawn and a subset of the values of the required char-type. The
occurrence of a string-element in a character-string shall denote the occurrence of the corresponding
value of char-type.
character-string = `'' f string-element g `'' .
string-element = apostrophe-image j string-character .
apostrophe-image = `"' .
string-character = one-of-a-set-of-implementation-dened-characters .
NOTE | Conventionally, the apostrophe-image is regarded as a substitute for the apostrophe character,
which cannot be a string-character.
Examples:
'A'
';'
''''
'Extended Pascal'
'THIS IS A STRING'
'Don''t think this is two strings'
1 A comment may thus commence with { and end with *), or commence with (* and end with }.
2 The sequence (*) cannot occur in a commentary even though the sequence {) can.
The substitution of a space for a comment shall not alter the meaning of a program.
Comments, spaces (except in character-strings), and the separations of consecutive lines shall be
considered to be token separators. Zero or more token separators can occur between any two
consecutive tokens, before the rst token of a program text, or after the last token of a program text.
There shall be at least one separator between any pair of consecutive tokens made up of identiers,
word-symbols, labels, extended-numbers, or unsigned-numbers. No separators shall occur within
tokens.
NOTE | 1 The character " that appears in some national variants of ISO 646 is regarded as identical to the
character ^. In this International Standard, the character " has been used because of its greater visibility.
The comment-delimiting characters f and g shall be the reference representations, and (* and *)
respectively shall be alternative representations (see 6.1.10).
11
ISO/IEC 10206:1990(E)
The statement-part shall specify the algorithmic actions to be executed upon an activation of the
block.
statement-part = compound-statement .
12
ISO/IEC 10206:1990(E)
6.2.2 Scopes
6.2.2.1
Each identier or label contained by the program-block shall have a dening-point, with the exception
of the identier of a program-heading (see 6.12).
6.2.2.2
Each dening-point shall have one or more regions that are parts of the program text, and a scope
that is part or all of those regions. The region that is an interface (see 6.11.2), however, shall not
be a part of the program text and shall be disjoint from every other interface.
6.2.2.3
The region(s) of each dening-point are dened elsewhere (see 6.2.1, 6.2.2.10, 6.2.2.12, 6.3, 6.4.1,
6.4.2.3, 6.4.3.4, 6.4.7, 6.5.1, 6.5.3.3, 6.7.1, 6.7.2, 6.7.3.1, 6.7.3.7.1, 6.8.4, 6.8.6.3, 6.8.7.3,
6.8.8.3, 6.9.3.10, 6.11.1, 6.11.2, 6.11.3, and 6.12).
6.2.2.4
The scope of each dening-point shall be its region(s) (including all regions enclosed by those regions)
subject to 6.2.2.5 and 6.2.2.6.
6.2.2.5
When an identier or label has a dening-point for region A and another identier or label having
the same spelling has a dening-point for some region B enclosed by A, then region B and all regions
enclosed by B shall be excluded from the scope of the dening-point for region A.
6.2.2.6
The region that is the eld-specier of a eld-designator, the eld-specier of a eld-designated-
constant, the eld-specier of a record-function-access, the discriminant-specier of a schema-discriminant,
a eld-identier of a eld-value, the eld-identier of a tag-eld-identier, the identier-list of the
program-parameter-list, the identier-list of the module-parameter-list, or the import-qualier of an
import-specication shall be excluded from the enclosing scopes. The region that is the constant-
identier of a constant-name, the type-identier of a type-name, the schema-identier of a schema-
name, the variable-identier of a variable-name, the procedure-identier of a procedure-name, or the
function-identier of a function-name shall be excluded from the enclosing scopes if the constant-
name, type-name, schema-name, variable-name, procedure-name, or function-name, respectively,
contains an imported-interface-identier.
NOTE | Consider the variable-name i1.x (see 6.5.1) constructed from an interface-identier i1 and a
variable-identier x. The part of the program text occupied by this occurrence of x is the region that is
excluded from enclosing scopes. This region thus cannot be occupied by any other identier that would be
13
ISO/IEC 10206:1990(E)
legal in a variable-identier position and that has a scope that otherwise would include the region occupied
by x.
For example in:
procedure a;
import i1 qualified only (x);
var y : integer;
begin
i1.x := ...
6.2.2.7
When an identier or label has a dening-point for a region, another identier or label with the
same spelling shall not have a dening-point for that region unless both identiers are imported
identiers and denote the same value, variable, procedure, function, schema, or type. In the case
of imported type-identiers, both identiers shall also denote the same bindability and initial state
(see 6.11.3).
6.2.2.8
Within the scope of a dening-point of an identier or label, each occurrence of an identier or label
having the same spelling as the identier or label of the dening-point shall be designated an applied
occurrence of the identier or label of the dening-point, except for an occurrence that constituted
the dening-point; such an occurrence shall be designated a dening occurrence. No occurrence
outside that scope shall be an applied occurrence.
6.2.2.9
The dening-point of an identier or label shall precede all applied occurrences of that identier or
label contained by the program-block with two exceptions:
a) An identier can have an applied occurrence as a type-identier or schema-identier contained
by the domain-type of any new-pointer-types contained by the type-denition-part containing
the dening-point of the type-identier or schema-identier.
b) An identier can have an applied occurrence as a constant-identier, type-identier, schema-
identier, variable-identier, procedure-identier, or function-identier contained by an export-
list closest-contained by a module-heading containing the dening-point of the identier.
6.2.2.10
Required identiers that denote the required values, types, schemata, procedures, and functions shall
be used as if their dening-points have a region enclosing the program (see 6.1.3, 6.4.2.2, 6.4.3.4,
6.4.3.6, 6.4.3.3.3, 6.7.5, 6.7.6, and 6.10).
NOTES
14
ISO/IEC 10206:1990(E)
1 The required identiers input and output are not included, since these denote variables (see 6.11.4.2).
2 The required identiers StandardInput and StandardOutput are not included, since these denote
interfaces (see 6.11.4.2).
6.2.2.11
Whatever an identier or label denotes at its dening-point shall be denoted at all applied occurrences
of that identier or label.
NOTES
1 Within syntax denitions, an applied occurrence of an identier is qualied (e.g., type-identier) whereas
a dening occurrence is not qualied.
2 It is intended that such qualication indicates the nature of the entity denoted by the applied occurrence:
e.g., a constant-identier denotes a constant.
6.2.2.12
Each dening-point that has as a region a module-heading shall also have as a region the module-
block that is associated with that module-heading.
6.2.2.13
A module A shall be designated as supplying a module B if A supplies the module-heading or module-
block of B. A module A shall be designated as supplying a main-program-block if the module supplies
the block of the main-program-block. A module A shall be designated as supplying a module-heading,
module-block, or block, B, either if B contains an applied occurrence of an interface-identier having
a dening occurrence contained by the module-heading of A, or if A supplies a module that supplies
B.
No module shall supply its module-heading.
NOTE | A module-heading that exports an interface precedes any module-heading, module-block, or block
that imports the interface, and a module-heading precedes its module-block (see 6.2.2.9).
6.2.3 Activations
6.2.3.1
A variable-identier having a dening-point within a variable-declaration-part, for the region that
is a module-block (see also 6.2.2.12) or a block shall be designated local to the module containing
the module-block (see 6.11.1) or to the block, respectively.
A procedure-identier or function-identier having a dening-point within a procedure-and-function-
heading-part or a procedure-and-function-declaration-part, for a region that is a module-block or
a block, shall be designated local to the module containing the module-block or to the block,
respectively.
15
ISO/IEC 10206:1990(E)
6.2.3.2
Each activation of a block or module shall contain
a) for the statement-part of the block, an algorithm, the completion of which shall terminate the
activation (see also 6.9.2.4);
b) for each dening-point of a label in a label-declaration-part of the block, a corresponding
program-point (see 6.2.1);
c) for each new-type closest-contained by the module-heading of the module, the module-block of
the module, or the block, one or more corresponding types (see 6.4.1);
d) for each schema-denition containing a formal-discriminant-part and closest-contained by the
module-heading of the module, the module-block of the module, or the block, a corresponding
schema (see 6.4.7);
e) for each conformant-array-form closest-contained by the formal-parameter-list, if any, dening
the formal-parameters of the block, a corresponding type (see 6.7.3.7.1);
f) for each dening-point of a variable-identier local to the block or module, a corresponding
variable (see 6.5.1);
g) for each dening-point of a variable-identier that is a formal-parameter of the block, occurring
within a value-parameter-specication or a value-conformant-array-specication, a corresponding
variable (see 6.7.3.1, 6.7.3.2, 6.7.3.7.1, and 6.7.3.7.2);
h) for each dening-point of a variable-identier that is a formal-parameter of the block, occurring
within a variable-parameter-specication or a variable-conformant-array-specication, a reference
to the corresponding variable (see 6.7.3.1, 6.7.3.3, 6.7.3.7.1, and 6.7.3.7.3);
i) for each dening-point of a procedure-identier local to the block or module, a corresponding
procedure with the procedure-block corresponding to the procedure-identier, and the formal-
parameters of that procedure-block (see 6.7.1);
j) for each dening-point of a function-identier local to the block or module, a corresponding
function with the function-block corresponding to, and the type associated with, the function-
identier, and the formal-parameters of that function-block (see 6.7.2);
k) if the block is a function-block, a variable called the result of the activation, possessing the type
and initial state (see 6.7.2) associated with the block of the function-block, and possessing
the bindability that is nonbindable;
l) if the block is a main-program-block, each textle required to be implicitly accessible (see
6.11.4.2) by any procedure-statement or function-designator contained by the program containing
the main-program-block;
m) a commencement (see 6.2.3.8);
n) for the module, an initialization, which shall be specied by a statement: if an initialization-
part occurs in the module-block of the module, then the statement of the initialization-part;
otherwise, an empty-statement (see 6.11.1); and
16
ISO/IEC 10206:1990(E)
6.2.3.3
An activation of a procedure or a function shall be an activation of the block of the procedure-block
of the procedure or of the function-block of the function, respectively, and shall be designated as
within
a) the activation containing the procedure or function; and
b) all activations that that containing activation is within.
NOTE | An activation of a block B can only be within activations of blocks containing B. Thus, an
activation is not within another activation of the same block.
6.2.3.4
A procedure-statement or function-designator contained in the algorithm, initialization, or nalization
of an activation and specifying an activation of a block shall be designated the activation-point of
the activation of the block.
6.2.3.5
Each variable contained by an activation of a block or module, unless it is a program-parameter or
module-parameter or it is a formal-parameter of the block, shall be created in its initial state (see
6.2.3.2 k) and 6.5.1) within the commencement of the activation. Each variable contained by an
activation of a block or module, unless it is a program-parameter or module-parameter, shall be
created not bound to an external entity. The algorithm, program-points, types, schemata, variables,
references, nalization, procedures, and functions, if any, contained by an activation shall exist until
the termination of the activation.
6.2.3.6
An activation of a program-block shall consist of an activation of the main-program-block contained
by the program-block and, for each module supplying (see 6.2.2.13) the main-program-block, an
activation of that module. The termination of the activations of both the main-program-block and
those modules shall constitute the termination of the activation of the program-block.
The order of any two distinct commencements shall be implementation-dependent unless the order
is specied by the following sentence. Within an activation of a program-block, for each module or
main-program-block A and for each module B other than A, if B supplies A and A does not supply
17
ISO/IEC 10206:1990(E)
B, then the commencement of the activation of B shall precede the commencement of the activation
of A.
The completion of the nalization of an activation of a module shall terminate the activation.
The order of the action specied by the nalization of an activation and the termination of a distinct
activation shall be implementation-dependent unless the order is specied by the following sentence.
Within an activation of a program-block, for each module or main-program-block A and for each
module B other than A, if B supplies A and A does not supply B, then the termination of the
activation of A shall precede the action specied by the nalization of the activation of B.
6.2.3.7
An activation of the module-heading or module-block associated with a module shall be the same
activation of the module. An activation of a main-program-block shall be the activation of the block
of the main-program-block.
6.2.3.8
The commencement of an activation of either a module or a block shall contain the following events
a) for each formal value parameter of the block, an attribution of a value to the variable denoted
within the activation by the formal-parameter (see 6.7.3.2), and for each formal variable
parameter of the block, an access to the actual-parameter (see 6.7.3.3);
b) for each actual-discriminant-part or subrange-bound not contained by a schema-denition and
closest-contained by the module-heading of the module, by the module-block of the module, or
by the block, the corresponding evaluation of the actual-discriminant-part or subrange-bound,
respectively (see 6.4.8);
c) for each dening occurrence of a variable-identier local to the module or the block, the
corresponding creation of the variable corresponding to the variable-identier (see 6.2.3.2 f)
and 6.2.3.5); and
d) the action specied by the initialization of the activation of the module.
Within the commencement of an activation, any events specied by a) shall precede any events
specied by b) and c), and the latter events shall precede any event specied by d).
Within the commencement of an activation, the order of any events specied by b) and c) shall be the
same as the textual order of their respectively-corresponding actual-discriminant-parts or subrange-
bounds and dening occurrences, with one exception: An event specied by b) shall precede an
event specied by c) if the respectively-corresponding actual-discriminant-part or subrange-bound
and dening occurrence are both contained by one variable-declaration.
NOTE | An evaluation specied by b) can evaluate a local variable only if its initial state is value-bearing.
The commencement of an activation of a block shall precede the algorithm of the activation.
18
ISO/IEC 10206:1990(E)
The completion of the events specied by a), b), c), and d) within a commencement shall constitute
completion of the commencement.
6.2.4 States
A type determines a set of states, each of which shall be either a value-bearing state or a non-
value-bearing state, but not both. A value-bearing state determined by a type shall be said to bear
a value,and the values borne by two distinct value-bearing states shall be distinct. A non-value-
bearing state shall not bear a value. When describing a state, undened shall be synonymous with
non-value-bearing.
The states determined by a structured-type shall have the structure of the structured-type.
The set of states determined by any type shall contain a special non-value-bearing state designated
totally-undened.
For any type that is not an array-type, a record-type, or a le-type, the set of states shall contain
only the totally-undened state and, for each value determined by the type, a state bearing that
value.
NOTE | 1 The set of states determined by an array-type, a record-type, or a le-type is specied in 6.4.3.2,
6.4.3.4, and 6.4.3.6, respectively, together with 6.4.2.1.
For an array-type, a record-type, or a le-type, each component of the totally-undened state shall
be the totally-undened state of the component-type, and each component of a value-bearing state
shall be a value-bearing state.
NOTES
2 For a structured-type, each undened state shall have at least one component that is undened.
3 For a pointer-type, the set of states is dynamic in that the states bearing identifying-values (see 6.4.4) are
created and destroyed by actions of the program. Every non-pointer type determines a static set of values,
i.e., a set that does not change during the existence of the type.
A variable declared to possess a type shall always have one of the states determined by the type; the
particular state of a variable that is not bound to an external entity at any point shall have been
determined by the actions specied by the program.
A value borne by the state of a variable shall be said to be attributed to the variable; a variable
having a non-value-bearing state shall be said to have no value attributed to the variable and shall
also be designated undened.
NOTE | 4 Each state of a variable when the variable does not have attributed to it a value specied by its
type is undened. If a variable possesses a structured-type, the state of the variable when every component
of the variable is totally-undened is totally-undened. Totally-undened is synonymous with undened for
a variable that does not possess a structured-type.
Causing a variable to have the state bearing a value shall be described as attributing the value to
the variable.
19
ISO/IEC 10206:1990(E)
NOTE | 5 Subclauses that specify attribution (or de-attribution) of a value to a variable are: 6.5.3.3, 6.6,
6.7.3.2, 6.7.3.7.2, 6.7.5.2, 6.7.5.3, 6.7.5.4, 6.7.5.5, 6.7.5.6, 6.7.5.8, 6.7.6.7, 6.9.2.2, 6.9.3.9, 6.10,
6.11.4.2. In some of these subclauses the attribution is implicit.
The initial state denoted by a type-denoter shall be a state determined by the type denoted by the
type-denoter (see 6.6).
6.3 Constants
6.3.1 General
A constant-denition shall introduce an identier to denote a value.
constant-denition = identier `=' constant-expression .
constant-identier = identier .
constant-name = [ imported-interface-identier `.' ] constant-identier .
A constant-name shall denote the value denoted by the constant-identier of the constant-name.
The occurrence of an imported-interface-identier in a constant-name shall be the dening-point
of each imported constant-identier associated with the imported-interface-identier for the region
that is the constant-identier of the constant-name.
The occurrence of an identier in a constant-denition of a constant-denition-part of a block, a
module-heading, or a module-block shall constitute its dening-point as a constant-identier for
the region that is the block, the module-heading, or the module-block, respectively. A constant-
expression in a constant-denition shall not contain an applied occurrence of the identier in the
constant-denition.
Each applied occurrence of the identier in the constant-denition shall be a constant-identier.
Within an activation of the block, the module-heading, or the module-block, all applied occurrences
of that identier shall denote the value denoted by the constant-expression of the constant-denition.
The required constant-identiers shall be as specied in 6.4.2.2.
NOTE | Constants of pointer-types are allowed, but they can only denote the value NIL.
20
ISO/IEC 10206:1990(E)
21
ISO/IEC 10206:1990(E)
If the symbol bindable occurs in a type-denoter, the type-denoter shall denote the bindability that is
bindable; otherwise, the type-denoter shall denote the bindability that is denoted by the type-name,
the new-type, the type-inquiry, or the discriminated-schema of the type-denoter. The bindability
denoted by a required type-identier shall be nonbindable. A type-denoter denoting a restricted-type
shall not contain the symbol bindable.
If an initial-state-specier occurs in a type-denoter, the type-denoter shall denote the initial state that
is denoted by the initial-state-specier (see 6.6); otherwise, the type-denoter shall denote the initial
state that is denoted by the type-name, the new-type, the type-inquiry, or the discriminated-schema
of the type-denoter. The initial state denoted by a required type-identier shall be totally-undened.
A new-type shall denote the initial state denoted by the new-ordinal-type, the new-structured-type,
the new-pointer-type, or the restricted-type of the new-type.
Types shall be classied as simple-types, restricted-types, structured-types, or pointer-types. The
required type-identiers and corresponding required types shall be as specied in 6.4.2.2, 6.4.3.4,
and 6.4.3.6. The required schema-identier and the corresponding required schema shall be as
specied in 6.4.3.3.3.
simple-type-name = type-name .
structured-type-name = array-type-name
j record-type-name
j set-type-name
j le-type-name .
array-type-name = type-name .
record-type-name = type-name .
set-type-name = type-name .
le-type-name = type-name .
pointer-type-name = type-name .
type-identier = identier .
type-name = [ imported-interface-identier `.' ] type-identier .
A type-name shall denote the type, bindability, and initial state denoted by the type-identier of
the type-name.
The occurrence of an imported-interface-identier in a type-name shall be the dening-point of each
imported type-identier associated with the imported-interface-identier for the region that is the
type-identier of the type-name.
A type-name shall be considered a simple-type-name, an array-type-name, a record-type-name, a
set-type-name, a le-type-name, or a pointer-type-name, according to the type that it denotes.
A type shall be designated protectable unless
22
ISO/IEC 10206:1990(E)
23
ISO/IEC 10206:1990(E)
25
ISO/IEC 10206:1990(E)
6.4.2.3 Enumerated-types
enumerated-type = `(' identier-list `)' .
identier-list = identier f `,' identier g .
The occurrence of an identier in the identier-list of an enumerated-type shall constitute its
dening-point for the region that is the block, module-heading, or module-block closest-containing
the enumerated-type. Each applied occurrence of the identier shall be a constant-identier. Within
an activation of the block, the module-heading, or the module-block, all applied occurrences of that
identier shall possess the type denoted by the enumerated-type and shall denote the type's value
whose ordinal number is the number of occurrences of identiers preceding that identier in the
identier-list. The identier shall be designated a principal identier of the value so denoted.
NOTES
1 Enumerated type constants are ordered by the sequence in which they are dened, and they have
consecutive ordinal numbers starting at zero.
2 While several identiers may be known as principal identiers of a given value (see 6.11.2 and 6.11.3),
there is no ambiguity, because each is dened for a dierent region, all have the same spelling, and all denote
the same value.
Examples:
(red, yellow, green, blue, tartan)
(club, diamond, heart, spade)
(married, divorced, widowed, single)
(scanning, found, notpresent)
(Busy, InterruptEnable, ParityError, OutOfPaper, LineBreak)
6.4.2.4 Subrange-types
A subrange-type shall include identication of the smallest and the largest value in the subrange. The
rst subrange-bound of a subrange-type shall specify the smallest value. If both subrange-bounds
of the subrange-type denote expressions that are nonvarying and do not contain a discriminant-
identier, the smallest value shall be less than or equal to the largest value, which shall be specied
by the second subrange-bound of the subrange-type; otherwise, it shall be a dynamic-violation if
the smallest value is not less than or equal to the largest value. The subrange-bounds shall be of
compatible ordinal-types, and the range-type (see 6.4.2.1) of the ordinal-types shall be designated
the host-type of the subrange-type. An evaluation of a subrange-bound shall constitute evaluation of
the expression of the subrange-bound (see 6.2.3.8). The set of values determined by the subrange-
type shall contain each value of the host-type not smaller than the smallest value and not larger
than the largest value.
subrange-type = subrange-bound `..' subrange-bound .
subrange-bound = expression .
Examples:
1..100
26
ISO/IEC 10206:1990(E)
-10..+10
red..green
'0'..'9'
6.4.2.5 Restricted-types
A restricted-type shall denote a type whose set of states is associated one-to-one with the states
determined by another type, designated the underlying-type of the type denoted by the restricted-
type. A type denoted by a restricted-type shall be designated restricted.
restricted-type = `restricted' type-name .
The underlying-type of a restricted-type shall be the type denoted by the type-name of the restricted-
type. The underlying-type of a type that is not restricted shall be the type, and each state shall be
associated with itself. Attribution of a value of a type to a variable possessing the underlying-type of
the type shall constitute the attribution of the associated value of the underlying-type. Attribution
of a value of the underlying-type of a type to a variable possessing the type shall constitute the
attribution of the associated value of the type. The bindability denoted by a restricted-type shall
be nonbindable. The initial state denoted by a restricted-type shall be the state associated with the
initial state denoted by the type-name of the restricted-type.
NOTE | A value of a restricted-type may be passed as a value parameter to a formal-parameter possessing
its underlying-type (see 6.7.3.2) or returned as the result of a function (see 6.9.2.2). A variable of a
restricted-type may be passed as a variable parameter to a formal-parameter possessing the same type or
its underlying-type (see 6.7.3.3). No other operations, such as accessing a component of a restricted-type
value or performing arithmetic, are possible.
Example:
module widget module;
27
ISO/IEC 10206:1990(E)
it are restricted. g
procedure copy widget( source: real widget; var target: real widget );
var
28
ISO/IEC 10206:1990(E)
begin
write( output, 'First is initially ' ); print widget( output, first );
copy widget( increment widget( increment widget( first ) ), second );
write(output, 'Second is now '); print widget( output, second );
copy widget( second, first );
write(output, 'First is now '); print widget( output, first );
end.
6.4.3 Structured-types
6.4.3.1 General
A new-structured-type shall be classied as an array-type, record-type, set-type, or le-type according
to the unpacked-structured-type closest-contained by the new-structured-type. A component of a
value of a structured-type shall be a value. A component of a state of a structured-type shall be a
state.
structured-type = new-structured-type j structured-type-name .
new-structured-type = [ `packed' ] unpacked-structured-type .
unpacked-structured-type = array-type j record-type j set-type j le-type .
The occurrence of the token packed in a new-structured-type shall designate the type denoted thereby
as packed. The designation of a structured-type as packed shall indicate to the processor that data-
storage of states should be economized, even if this causes operations on, or accesses to components
of, variables possessing the type to be less ecient in terms of space or time.
The designation of a structured-type as packed shall aect the representation in data-storage of
that structured-type only; i.e., if a component is itself structured, the component's representation
in data-storage shall be packed only if the type of the component is designated packed.
NOTE | The ways in which the treatment of entities of a type is aected by whether or not the type is
designated packed are specied in 6.4.3.2, 6.4.5, 6.7.3.3, 6.7.3.7.3, 6.7.5.4, and 6.8.1.
A new-structured-type shall denote the type, bindability, and initial state denoted by the unpacked-
structured-type of the new-structured-type. An unpacked-structured-type shall denote the type and
initial state denoted by the array-type, record-type, set-type, or le-type of the unpacked-structured-
type. The bindability denoted by an unpacked-structured-type shall be nonbindable.
6.4.3.2 Array-types
An array-type shall be structured as a mapping from each value specied by its index-type to a
distinct component. Each component shall have the type, bindability, and initial state denoted by
the type-denoter of the component-type of the array-type. The type-denoter of a component-type
shall not closest-contain an initial-state-specier (see 6.6).
29
ISO/IEC 10206:1990(E)
An array-type that species a sequence of two or more index-types shall be an abbreviated notation
for an array-type specied to have as its index-type the rst index-type in the sequence and to have a
component-type that is an array-type specifying the sequence of index-types without the rst index-
type in the sequence and specifying the same component-type as the original specication. The
component-type thus constructed shall be designated packed if and only if the original array-type is
designated packed. The abbreviated form and the full form shall be equivalent.
NOTE | 1 Each of the following two examples thus contains dierent ways of expressing its array-type.
Examples:
1) array [Boolean] of array [1..10] of array [size] of real
array [Boolean] of array [1..10, size] of real
array [Boolean, 1..10, size] of real
array [Boolean, 1..10] of array [size] of real
Let i denote a value of the index-type; let Vi denote a state of that component of the array-type
that corresponds to the value i by the structure of the array-type; let the smallest and largest values
specied by the index-type be denoted by m and n, respectively; and let k = (ord(n)-ord(m)+1)
denote the number of values specied by the index-type; then the states of the array-type shall be
the distinct k-tuples of the form
(Vm ,...,Vn ).
NOTE | 2 A state of an array-type is value-bearing if and only if each of its component states is value-
bearing. If the component-type has c values, then it follows that the cardinality of the set of values of the
array-type is c raised to the power k.
The ordinal-type of an index-type shall denote the bindability that is nonbindable.
6.4.3.3 String-types
6.4.3.3.1 General
A string-type shall be a xed-string-type or a variable-string-type or the required type designated
canonical-string-type. Each string-type value is a value of the canonical-string-type.
30
ISO/IEC 10206:1990(E)
31
ISO/IEC 10206:1990(E)
Example:
string(6) f capacity 6 g
NOTES
1 A variable-string-type possesses the properties of a string-type. The individual components of a variable-
string-type can be obtained by indexing it as an array (see 6.5.3.2).
2 For additional information on the bindability and initial state of variable-string-types, see 6.4.8.
6.4.3.4 Record-types
The structure and states of a record-type shall be the structure and states of the eld-list of the
record-type. The initial state denoted by a record-type shall be that denoted by the eld-list of the
record-type.
record-type = `record' eld-list `end' .
eld-list = [ ( xed-part [ `;' variant-part ] j variant-part ) [ `;' ] ] .
xed-part = record-section f `;' record-section g .
record-section = identier-list `:' type-denoter .
eld-identier = identier .
variant-part = `case' variant-selector `of'
( variant-list-element f `;' variant-list-element g
[ [ `;' ] variant-part-completer ]
j variant-part-completer ) .
variant-list-element = case-constant-list `:' variant-denoter .
variant-part-completer = `otherwise' variant-denoter .
variant-denoter = `(' eld-list `)' .
variant-selector = [ tag-eld `:' ] tag-type j discriminant-identier .
tag-eld = identier .
tag-type = ordinal-type-name .
case-constant-list = case-range f `,' case-range g .
case-range = case-constant [ `..' case-constant ] .
case-constant = constant-expression .
A eld-list containing neither a xed-part nor a variant-part shall have no components, shall determine
a single value-bearing state bearing a null value, shall be designated empty, and shall denote the
totally-undened initial state.
32
ISO/IEC 10206:1990(E)
33
ISO/IEC 10206:1990(E)
With each variant-part shall be associated a type designated the selector-type possessed by the
variant-part. If the variant-selector of a variant-part contains a tag-eld or discriminant-identier,
then the selector-type possessed by the variant-part shall be the variant-type, and each variant of
the variant-part shall be associated with exactly those values designated as corresponding to the
variant. Otherwise, the selector-type possessed by the variant-part shall be a new-ordinal-type that
is constructed to possess exactly one value for each variant of the variant-part, and no others, and
each such variant shall be associated with a distinct value of that type.
Each variant-part shall have a component which shall be designated the selector of the variant-part,
and which shall possess the selector-type of the variant-part. If the variant-selector of the variant-
part contains a tag-eld, then the occurrence of an identier in the tag-eld shall constitute the
dening-point of the identier as a eld-identier for the region that is the type-denoter closest-
containing the record-type closest-containing the variant-part and shall associate the eld-identier
with the selector of the variant-part. The selector shall be designated a eld of the record-type if
and only if it is associated with a eld-identier. The selector shall be nonbindable.
The initial state possessed by the selector of a variant-part type shall be determined as follows.
a) If a discriminant-identier occurs in the variant-selector of the variant-part, the initial state
shall be the state bearing the value denoted by the discriminant-identier;
b) If the selector is a eld, the initial state shall be the initial state denoted by the tag-type of
the variant-selector of the variant-part;
c) If the selector is not a eld and the tag-type denotes an initial state that is not undened, the
initial state shall be the state bearing a value of the selector-type; this value shall be the value
associated with the variant corresponding to the value borne by the initial state denoted by
the tag-type;
d) Otherwise, the initial state shall be totally-undened.
The value of the selector of the variant-part shall cause the associated variant of the variant-part to
be designated active. In a record-type derived from a schema with a tuple, the value of the selector
of a variant-part closest-containing a variant-selector containing a discriminant-identier shall be that
value of the value corresponding to the discriminant-identier according to the tuple; it shall be a
dynamic-violation to attribute another value to such a selector (see 6.5.3.3).
The set of states determined by a variant-part shall contain, in addition to the totally-undened
state (see 6.2.4), the states that are the distinct pairs
(k, Xk )
where k represents a value of the selector-type of the variant-part and Xk is a state of the eld-list
of the active variant of the variant-part. The value-bearing states shall be those pairs where Xk is
a value-bearing state.
NOTES
2 If there are n values specied by the selector-type, and if the eld-list of the variant associated with the
i-th value has Ti values, then the cardinality of the set of values of the variant-part is (T1 + T2 + ... +
Tn ). There is no component of a value of a variant-part corresponding to any non-active variant of the
34
ISO/IEC 10206:1990(E)
variant-part.
3 Restrictions placed on the use of elds of a record-variable pertaining to variant-parts are specied in
6.5.3.3, 6.7.3.3, and 6.7.5.3.
The bindability of each eld of a required record-type shall be nonbindable. If the variant-selector
of the variant-part closest-contains an ordinal-type-name, the ordinal-type-name of the tag-type of
the variant-selector of the variant-part shall denote the bindability that is nonbindable.
Examples:
1) record
year : 0..2000;
month : 1..12;
day : 1..31
end
2) record
name, firstname : namestring;
age : 0..969; f
Age of Methuselah, see Genesis 5:27 g
case married : Boolean of
true : (Spousesname : namestring);
false : ( )
end
3) record
x, y : real;
area : real;
case shape of
triangle : (side : real;
inclination,
angle1,
angle2 : angle);
rectangle : (side1,
side2 : real;
skew : angle);
circle : (diameter : real);
end
4) record
field1 : integer;
case tag : initially 42 of
1: (field2 : real value 0.0);
42: (field3 : integer value 13#42);
35
ISO/IEC 10206:1990(E)
There shall be a record-type designated packed and denoted by the required type-identier TimeStamp.
For each of the required eld-identiers DateValid, TimeValid, year, month, day, hour, minute,
and second, there shall be an associated required eld of the record-type, and that eld shall have
a type denoted by the type-denoter Boolean, Boolean, integer, 1..12, 1..31, 0..23, 0..59, and 0..59,
respectively.
NOTES
4 This is analogous to the Pascal record-type:
packed record
DateValid,
TimeValid : Boolean;
year : integer;
month : 1..12;
day : 1..31;
hour : 0..23;
minute : 0..59;
second : 0..59;
end
5 A processor may provide additional elds as an extension. These elds might contain information such as
day of the week, fractions of seconds, leap seconds, time zone, or local time dierential from Universal Time.
6 The required type-identier TimeStamp is used by the time procedure GetTimeStamp (see 6.7.5.8)
and by the time functions date and time (see 6.7.6.9).
There shall be a record-type designated packed and denoted by the required type-identier BindingType.
For each of the required eld-identiers name and bound, there shall be an associated required
eld of the record-type, and that eld shall have an implementation-dened variable-string-type
and a type denoted by the type-denoter Boolean, respectively. The values of this record-type shall
designate the status of binding to external entities.
NOTES
7 A processor may provide additional elds as an extension.
8 The required type-identier BindingType is used by the binding procedure bind (see 6.7.5.6) and the
binding function binding (see 6.7.6.8).
6.4.3.5 Set-types
A set-type shall determine the set of values that is structured as the power set of the base-type of
the set-type. Thus, each value of a set-type shall be a set whose members shall be unique values of
the base-type.
set-type = `set' `of' base-type .
base-type = ordinal-type .
36
ISO/IEC 10206:1990(E)
NOTE | 2 If the base-type of a set-type has b values, then the cardinality of the set of values is 2 raised
to the power b.
For each ordinal-type T that is not a subrange-type, there shall exist both an unpacked set-
type designated the unpacked-canonical-set-of-T-type and a packed set-type designated the packed-
canonical-set-of-T-type. If S is any subrange-type and T is its range-type, then the set of values
determined by the type set of S shall be included in the sets of values determined by the unpacked-
canonical-set-of-T-type and by the packed-canonical-set-of-T-type (see 6.8.1).
A set-type shall denote an initial state that is totally-undened.
An ordinal-type contained by a set-type shall denote the bindability that is nonbindable.
6.4.3.6 File-types
NOTE | 1 A le-type describes sequences of values of the specied component-type, together with a current
position in each sequence and a mode that indicates whether the sequence is being inspected, generated, or
updated.
le-type = `le' [ `[' index-type `]' ] `of' component-type .
A type-denoter shall not be permissible as the component-type of a le-type if it denotes a le-type, a
structured-type having any component whose type-denoter is not permissible as the component-type
of a le-type, a restricted-type, or the bindability that is bindable.
Examples:
file of real
file of vector
file [char] of 1..9999
A le-type shall dene implicitly a type designated a sequence-type having exactly those values,
which shall be designated sequences, dened by the following six rules in items a) to f).
NOTE | 2 The notation x~y represents the concatenation of sequences x and y. The explicit representation
of sequences (e.g., S(c)); of concatenation of sequences; of the rst, last, and rest selectors; and of sequence
equality is not part of the programming language Extended Pascal. These notations are used to dene le
values, below, and the required le operations elsewhere in clause 6.
a) S( ) shall be a value of the sequence-type S and shall be designated the empty sequence. The
empty sequence shall have no components.
b) Let c be a value of the specied component-type and let x be a value of the sequence-type S;
then S(c) shall be a sequence of type S, consisting of the single component-value c, and both
S(c)~x and x~S(c) shall be sequences, distinct from S( ), of type S.
37
ISO/IEC 10206:1990(E)
c) Let c, S, and x be as in b), let y denote the sequence S(c)~x and let z denote the sequence
x~S(c); then the notation y.rst shall denote c (i.e., the rst component-value of y), y.rest shall
denote x (i.e., the sequence obtained from y by deleting the rst component), and z.last shall
denote c (i.e., the last component-value of z).
d) Let x and y each be a non-empty sequence of type S; then x = y shall be true if and only if
both (x.rst = y.rst) and (x.rest = y.rest) are true. If x or y is the empty sequence, then x
= y shall be true if and only if both x and y are the empty sequence.
e) Let x, y, and z be sequences of type S; then x~(y~z) = (x~y)~z, S( )~x = x, and x~S( ) = x
shall be true.
f) Let x be a sequence; then the notation length(x) is 0 if x = S( ); otherwise length(x) is
1+length(x.rest).
A le-type also shall dene implicitly a type designated a mode-type having exactly three values,
which are designated Inspection, Generation, and Update.
NOTE | 3 The explicit denotation of the values Inspection, Generation, and Update is not part of the
programming language Extended Pascal.
A le-type shall be structured as three components. Two of these components, designated f.L and
f.R, shall be of the implicit sequence-type. The third component, designated f.M, shall be of the
implicit mode-type.
Let f.L and f.R each be a single value of the sequence-type and let f.M be a single value of the
mode-type; then each value of the le-type shall be a distinct triple of the form
(f.L, f.R, f.M).
The value, f, of the le-type shall be designated empty if and only if f.L~f.R is the empty sequence.
NOTE | 4 The two components, f.L and f.R, of a value of the le-type may be considered to represent the
single sequence f.L~f.R together with a current position in that sequence. If f.R is non-empty, then f.R.rst
may be considered the current component as determined by the current position; otherwise, the current
position is the end-of-le position.
If there is an index-type in a le-type, then that le-type shall be designated a direct-access le-type.
If f is of a direct-access le-type with index-type T, and a is the smallest value of type T and b is the
largest value of type T, then it shall be an error whenever f.L and f.R are dened and length(f.L~f.R)
> ord(b)-ord(a)+1.
If the le-type is not a direct-access le-type, then f.M shall not be Update.
There shall be a le-type that is not a direct-access le-type, and that type shall be denoted by the
required type-identier text. The structure of the type denoted by text shall dene an additional
sequence-type whose values shall be designated lines. A line shall be a sequence cs~S(end-of-line),
where cs is a sequence of components possessing the char-type, and end-of-line shall represent a
special component-value. Any assertion in clause 6 that the end-of-line value is attributed to a
variable other than a component of a sequence shall be construed as an assertion that the variable
has attributed to it the char-type value space. If l is a line, then no component of l other than
38
ISO/IEC 10206:1990(E)
l.last shall be an end-of-line. There shall be an implementation-dened subset of the set of char-
type values, designated characters prohibited from textles; the eect of causing a character in that
subset to be attributed to a component of either t.L or t.R for any textle t shall be implementation-
dependent.
A line-sequence, ls, shall be either the empty sequence or the sequence l~ls' where l is a line and ls'
is a line-sequence.
Every value t of the type denoted by text shall satisfy the following two rules:
a) If t.M = Inspection, then t.L~t.R shall be a line-sequence.
b) If t.M = Generation, then t.L~t.R shall be ls~cs, where ls is a line-sequence and cs is a sequence
of components possessing the char-type.
NOTE | 5 In rule b), cs may be considered, especially if it is non-empty, to be a partial line that is being
generated. Such a partial line cannot occur during inspection of a le. Also, cs does not correspond to t.R,
since t.R is the empty sequence if t.M = Generation.
A variable that possesses the type denoted by the required type-identier text shall be designated
a textle.
NOTE | 6 All required procedures and functions applicable to a variable of type le of char are applicable
to textles. Additional required procedures and functions, applicable only to textles, are dened in 6.7.6.5
and 6.10.
A le-type shall denote an initial state that is totally-undened.
6.4.4 Pointer-Types
The values of a pointer-type shall consist of a single nil-value and a set of identifying-values. Each
identifying-value shall identify a distinct variable possessing a type, bindability, and initial state
specied by the domain-type of the new-pointer-type that denotes the pointer-type. The domain-
type shall either specify the type, bindability, and initial state denoted by the type-name of the
domain-type, or specify each type, bindability, and initial state produced from the schema denoted
by the schema-name of the domain-type. The set of identifying-values shall be dynamic, in that the
variables and the values identifying them shall be permitted to be created and destroyed during the
execution of the program. Identifying-values and the variables identied by them shall be created
only by the required procedure new (see 6.7.5.3).
NOTE | 1 Since the nil-value is not an identifying-value, it does not identify a variable.
The token nil shall denote the nil-value in all pointer-types.
pointer-type = new-pointer-type j pointer-type-name .
new-pointer-type = `"' domain-type .
domain-type = type-name j schema-name .
39
ISO/IEC 10206:1990(E)
NOTE | 2 The token nil does not have a single type, but assumes a suitable pointer-type to satisfy the
assignment-compatibility rules, or the compatibility rules for operators, if possible.
A new-pointer-type shall denote an initial state that is totally-undened.
The bindability denoted by a new-pointer-type shall be nonbindable.
6.4.6 Assignment-compatibility
A value of type T2 shall be designated assignment-compatible with a type T1 if any of the following
six statements is true:
a) T1 and T2 are the same type, and that type is permissible as the component-type of a le-type
(see 6.4.3.6).
NOTE | Because T1 and T2 are types, rather than type-denoters, the restriction on the bindability
of component-types of le-types does not apply here.
b) T1 is the real-type and T2 is the integer-type.
c) T1 is the complex-type and T2 is either the integer-type or the real-type.
d) T1 and T2 are compatible ordinal-types, and the value of type T2 is in the closed interval
specied by the type T1.
e) T1 and T2 are compatible set-types, and all the members of the value of type T2 are in the
closed interval specied by the base-type of T1.
f) T1 and T2 are compatible, T1 is a string-type or the char-type, and the length of the value of
T2 is less than or equal to the capacity of T1 (see 6.4.3.3).
At any place where the rule of assignment-compatibility is used
a) it shall be an error if T1 and T2 are compatible ordinal-types and the value of type T2 is not
in the closed interval specied by the type T1;
b) it shall be an error if T1 and T2 are compatible set-types and a member of the value of type
T2 is not in the closed interval specied by the base-type of the type T1;
40
ISO/IEC 10206:1990(E)
c) it shall be an error if T1 and T2 are compatible, T1 is a string-type or the char-type, and the
length of the value of T2 is greater than the capacity of T1;
d) it shall be a dynamic-violation if T1 and T2 are produced from the same schema, but not with
the same tuple (see 6.4.7).
At any place where the rule of assignment-compatibility is used to require a value of integer-type to
be assignment-compatible with a real-type, an implicit integer-to-real conversion shall be performed
(see 6.4.2.2 b)).
At any place where the rule of assignment-compatibility is used to require a value of integer-
type or real-type to be assignment-compatible with a complex-type, an implicit integer-to-complex
conversion or real-to-complex conversion, respectively, shall be performed (see 6.4.2.2 e)).
At any place where the rule of assignment-compatibility is used to require a value of the char-type
to be assignment-compatible with a string-type, the char-type value shall be treated as a value of
the canonical-string-type with length 1 and with the component-value equal to the char-type value.
At any place where the rule of assignment-compatibility is used to require a value of the canonical-
string-type to be assignment-compatible with a xed-string-type or the char-type, the canonical-
string-type value shall be treated as a value of the xed-string-type whose components in order of
increasing index shall be the components of the canonical-string-type value in order of increasing
index followed by zero or more spaces.
6.4.7 Schema-denitions
A schema shall be a one-to-one mapping from a domain consisting of discriminant tuples to a set of
types. Within an activation, a schema-denition containing a formal-discriminant-part shall dene a
new schema that is distinct both from the schema dened by the schema-denition within any other
activation and from any schema dened by any other schema-denition.
schema-denition = identier `=' schema-name
j identier formal-discriminant-part `=' type-denoter .
formal-discriminant-part = `(' discriminant-specication f `;' discriminant-specication g `)' .
discriminant-specication = identier-list `:' ordinal-type-name .
discriminant-identier = identier .
schema-identier = identier .
schema-name = [ imported-interface-identier `.' ] schema-identier .
A schema-name shall denote the schema denoted by the schema-identier of the schema-name.
The occurrence of an imported-interface-identier in a schema-name shall be the dening-point of
each imported schema-identier associated with the imported-interface-identier for the region that
is the schema-identier of the schema-name.
NOTE | 1 `Extra' formal discriminants that do not occur in the type-denoter of the schema-denition can
41
ISO/IEC 10206:1990(E)
42
ISO/IEC 10206:1990(E)
The type to which a schema maps a tuple shall be said to be produced from the schema with the
tuple.
An expression contained by a schema-denition shall be nonvarying (see 6.8.2).
The ordinal-type-name of a discriminant-specication shall denote the bindability that is nonbindable.
6.4.8 Discriminated-schemata
A type denoted by a discriminated-schema shall be produced from the schema denoted by the
schema-name of the discriminated-schema with the tuple denoted by the actual-discriminant-part
of the discriminated-schema. The bindability denoted by the discriminated-schema shall be the
bindability associated with the tuple by the schema. The initial state denoted by the discriminated-
schema shall be the initial state associated with the tuple by the schema. The tuple shall consist
of the values of the discriminant-values of the actual-discriminant-part taken in textual order; the
type of each such discriminant-value shall be compatible with the type of the corresponding formal
discriminant of the schema. It shall be a dynamic-violation if the tuple is not in the domain of the
schema. A type produced from a schema with a tuple shall be distinct from a type produced from
the schema with a distinct tuple and from all types produced from a distinct schema with a tuple.
discriminated-schema = schema-name actual-discriminant-part .
actual-discriminant-part = `(' discriminant-value f `,' discriminant-value g `)' .
discriminant-value = expression .
An evaluation of an actual-discriminant-part shall constitute the evaluation in implementation-
dependent order of the discriminant-values in the actual-discriminant-part. Within the commencement
of either an activation of a block, a module-heading, or a module-block, closest-containing a discriminant-
value, the discriminant-value shall denote the value denoted by the expression in the discriminant-
value. Evaluation of a discriminant-value shall constitute evaluation of the expression in the discriminant-
value.
A discriminated-schema that denotes a type produced from the required schema string shall denote
an initial state that is totally-undened and the bindability that is nonbindable.
43
ISO/IEC 10206:1990(E)
6.4.9 Type-inquiry
A type-inquiry shall denote a type, bindability, and initial state.
type-inquiry = `type' `of' type-inquiry-object .
type-inquiry-object = variable-name j parameter-identier .
The type denoted by a type-inquiry shall be the type possessed by the variable-identier or parameter-
identier contained by the type-inquiry. The bindability denoted by a type-inquiry shall be the
bindability possessed by the variable-identier or parameter-identier contained by the type-inquiry.
The initial state denoted by a type-inquiry shall be the initial state possessed by the variable-identier
or parameter-identier contained by the type-inquiry. A parameter-identier in a type-inquiry-object
shall have its dening-point in a value-parameter-specication or variable-parameter-specication in
the formal-parameter-list closest-containing the type-inquiry-object.
Example:
procedure p(var a : VVector);
var b : type of a;
f parameter a and variable b will have the same type g
f Count, range, and integer denote the same type; range and
integer have the same initial state (undefined). The types denoted
by year and natural are compatible with, but not the same as,
the type denoted by range, count, and integer. g
colour = (red, yellow, green, blue);
sex = (male, female);
shape = (triangle, rectangle, circle);
punchedcard = array [1..80] of char;
charsequence = file of char;
angle = real value 0.0;
subpolar = record
r : real;
theta : angle
end;
indextype = 1..limit;
vector = array [indextype] of real;
person = "persondetails value nil;
44
ISO/IEC 10206:1990(E)
persondetails = record
name,
firstname : charsequence;
age : natural;
married : Boolean;
father,
child,
sibling : person;
case s : sex of
male : (enlisted,
bearded : Boolean);
female : (mother,
programmer : Boolean)
end;
initially 42 = integer value 42;
quiver = array [1..10] of vector;
sieve = set of 1..20;
FileOfInteger = file of integer;
VectorIndex = 1 .. maxint;
Bindable FOI = bindable FileOfInteger;
VVector(vlength: VectorIndex) =
array [1 .. vlength] of real;
Pixel = set of colour;
DeviceStatusType = (Busy, LineBreak, OutOfPaper, ParityError);
namestring = string(20);
SWidth = 0 .. 1023;
SHeight = 0 .. 2047;
Screen(width: SWidth; height: SHeight) =
array[0 .. height, 0 .. width] of Pixel;
Positive = 1..MaxMatrix;
Matrix(M,N : Positive) = array[1..M, 1..N] of real;
M = Matrix(5,10);
colour map(formal discriminant : colour) =
record
case formal discriminant of
red: (red field : integer value ord(red));
yellow: (yellow field : integer value ord(yellow));
green: (green field : integer value ord(green));
blue: (blue field : integer value ord(blue));
end;
45
ISO/IEC 10206:1990(E)
variable-identier = identier .
The occurrence of an identier in the identier-list of a variable-declaration of the variable-declaration-
part of a block, a module-heading, or a module-block shall constitute its dening-point for the region
that is the block, the module-heading, or the module-block, respectively. Each applied occurrence of
that identier shall be a variable-identier. Within an activation of the block, the module-heading,
or the module-block, all applied occurrences of that identier shall denote the same corresponding
variable (see 6.2.3.2 g)) and shall possess the type and initial state denoted by the type-denoter
of the variable-declaration. The variable-identier shall possess the bindability denoted by the
type-denoter, unless the variable-identier is a program-parameter or a module-parameter, in which
case the variable-identier shall possess the bindability that is bindable. If the variable-identier
is a program-parameter or a module-parameter, any corresponding variable shall be designated a
program-parameter or a module-parameter, respectively. The type-denoter shall not contain an
applied occurrence of the identier.
The structure of a variable possessing a structured-type shall be the structure of the structured-type.
variable-name = [ imported-interface-identier `.' ] variable-identier .
A variable-name shall denote the variable denoted by the variable-identier of the variable-name.
The occurrence of an imported-interface-identier in a variable-name shall be the dening-point of
each imported variable-identier associated with the imported-interface-identier for the region that
is the variable-identier of the variable-name.
A use of a variable-access shall be an access, at the time of the use, to the variable thereby denoted.
A variable-access, according to whether it is an entire-variable, a component-variable, an identied-
variable, a buer-variable, a substring-variable, or a function-identied-variable shall denote a
declared variable, a component of a variable, a variable that is identied by an identifying-value
(see 6.4.4), a buer-variable, a substring-variable, or a function-identied-variable (see 6.8.6.4),
respectively.
variable-access = entire-variable j component-variable
j identied-variable j buer-variable
j substring-variable j function-identied-variable .
No statement shall threaten (see 6.9.4) a variable-access closest-containing a protected variable-
identier (see 6.7.3.1, 6.7.3.7.1, and 6.11.3).
A variable possessing the bindability that is bindable shall be totally-undened while the variable is
not bound to an external entity. It shall be an error to attribute a value to such a variable while the
variable is not bound to an external entity. A variable possessing the bindability that is bindable
shall possess the initial state that is totally-undened.
The initial state of a variant of a variable possessing a variant-part type (see 6.4.3.4) shall be:
a) if the initial state of the selector of the variable bears a value associated with the variant, the
initial state possessed by the eld-list of the variant-denoter that denotes the variant;
46
ISO/IEC 10206:1990(E)
NOTE | Variables occurring in examples in the remainder of this International Standard should be assumed
to have been declared as in the above example.
6.5.2 Entire-variables
entire-variable = variable-name .
6.5.3 Component-variables
6.5.3.1 General
A component of a variable shall be a variable. A component-variable shall denote a component of
a variable. A reference or an access to a component of a variable shall constitute a reference or an
access, respectively, to the variable. The state of the component of a variable shall be the same
47
ISO/IEC 10206:1990(E)
component of the state of the variable. The components of a variable possessing a string-type shall
have the bindability that is nonbindable. It shall be an error to access or reference a component
of a variable that possesses the bindability that is bindable while the variable is not bound to an
external entity.
component-variable = indexed-variable j eld-designator .
6.5.3.2 Indexed-variables
An indexed-variable shall denote a component of a variable possessing an array-type or a string-type.
indexed-variable = array-variable `[' index-expression f `,' index-expression g `]'
j string-variable `[' index-expression `]' .
array-variable = variable-access .
string-variable = variable-access .
index-expression = expression .
An array-variable shall be a variable-access that denotes a variable possessing an array-type. A
string-variable shall be a variable-access that denotes a variable possessing a string-type. The string-
variable of an indexed-variable shall denote a variable possessing a variable-string-type.
NOTE | 1 Variables possessing a xed-string-type are indexed using array-type properties.
For an array-variable in an indexed-variable closest-containing a single index-expression, the value
of the index-expression shall be assignment-compatible with the index-type of the array-type of the
array-variable.
For a string-variable in an indexed-variable, the index-expression of the indexed-variable shall possess
the integer-type, and it shall be an error if the value of the index-expression is not in the index-
domain of the value of the string-variable. It shall be an error to alter the length of the value of a
string-variable when a reference to a component of the string-variable exists. It shall be an error to
access an indexed-variable when the string-variable, if any, of the indexed-variable is undened.
The component denoted by the indexed-variable shall be the component that corresponds to the
value of the index-expression by the mapping of the type possessed by the array-variable (see 6.4.3.2)
or string-variable (see 6.4.3.3).
Examples:
a[12]
a[i + j]
m[k]
48
ISO/IEC 10206:1990(E)
6.5.3.3 Field-designators
A eld-designator either shall denote that component of the record-variable of the eld-designator
associated (see 6.4.3.4) with the eld-identier of the eld-specier of the eld-designator or shall
denote the variable denoted by the eld-designator-identier (see 6.9.3.10) of the eld-designator.
A record-variable shall be a variable-access that denotes a variable possessing a record-type.
The occurrence of a record-variable in a eld-designator shall constitute the dening-point of the
eld-identiers associated with components of the record-type possessed by the record-variable, for
the region that is the eld-specier of the eld-designator.
eld-designator = record-variable `.' eld-specier j eld-designator-identier .
record-variable = variable-access .
eld-specier = eld-identier .
Examples:
"
p2 .mother
Good thru.year
An access to a component of a variant of a variant-part, where the selector of the variant-part is not
a eld, shall attribute to the selector the value associated (see 6.4.3.4) with the variant.
It shall be an error unless a variant of a record-variable is active for the entirety of each reference
and access to each component of the variant.
When a variant becomes non-active, all of its components shall become totally-undened.
NOTES
1 If the selector of a variant-part is undened, then no variant of the variant-part is active.
2 When a variant becomes active, it is not created and therefore its initial state does not apply.
49
ISO/IEC 10206:1990(E)
6.5.6 Substring-variables
A substring-variable shall denote a variable possessing a new xed-string-type. The bindability
possessed by the substring-variable shall be nonbindable.
substring-variable = string-variable `[' index-expression `..' index-expression `]' .
The index-expressions in a substring-variable shall possess the integer-type. It shall be an error if
the string-variable of the substring-variable is undened, or if the value of an index-expression in
a substring-variable is less than 1 or greater than the length of the value of the string-variable of
the substring-variable, or if the value of the rst index-expression is greater than the value of the
second index-expression. The capacity of the xed-string-type possessed by the variable denoted
by the substring-variable shall be equal to one plus the value of the second index-expression minus
the value of the rst index-expression. The components of the variable denoted by the substring-
variable shall be, in order of increasing index, the contiguous components of the string-variable from
the component that corresponds to the value of the rst index-expression through the component
that corresponds to the value of the second index-expression.
50
ISO/IEC 10206:1990(E)
The order of both the evaluation of the index-expressions of, and the access to the string-variable
of, a substring-variable shall be implementation-dependent.
It shall be an error to alter the length of the value of a string-variable when a reference to a substring
of the string-variable exists. A reference or an access to a substring of a variable shall constitute a
reference or access, respectively, to the variable.
is valid, and the initial state denoted by S is an array of eight stars; whereas
type S = array [1..8] of char value '*';
is a violation.
4 The component-value of an initial-state-specier consists of an assignment-compatible expression, an array-
value, or a record-value (see 6.8.7.1).
51
ISO/IEC 10206:1990(E)
procedure-block = block .
procedure-name = [ imported-interface-identier `.' ] procedure-identier .
A procedure-name shall denote the procedure denoted by the procedure-identier of the procedure-
name.
The occurrence of an imported-interface-identier in a procedure-name shall be the dening-point
of each imported procedure-identier associated with the imported-interface-identier for the region
that is the procedure-identier of the procedure-name.
The occurrence of an identier in the procedure-heading of a procedure-declaration shall constitute
its dening-point as a procedure-identier for the region that is the block or module-block closest-
containing the procedure-declaration. The occurrence of an identier in a procedure-heading of a
procedure-and-function-heading-part contained by a module-heading shall constitute its dening-
point as a procedure-identier for the region that is the module-heading. Within an activation of
that block, that module-heading, or that module-block, each applied occurrence of the identier
shall denote the corresponding procedure (see 6.2.3.2).
Each identier having a dening-point as a procedure-identier in a procedure-heading of a procedure-
declaration in which the remote-directive forward occurs shall have exactly one of its applied
occurrences in a procedure-identication of a procedure-declaration, and this applied occurrence shall
be closest-contained by the procedure-and-function-declaration-part closest-containing the procedure-
heading.
Each identier having a dening-point as a procedure-identier in a procedure-heading of a procedure-
and-function-heading-part of a module-heading shall have exactly one of its applied occurrences in a
procedure-identication of a procedure-declaration of a procedure-and-function-declaration-part of
the module-block that is associated with the module-heading (see 6.11.1).
The occurrence of a procedure-block in a procedure-declaration shall associate the procedure-block
with the identier in the procedure-heading, or with the procedure-identier in the procedure-
identication, of the procedure-declaration. There shall be at most one procedure-block associated
with a procedure-identier.
The occurrence of a formal-parameter-list in a procedure-heading of a procedure-declaration shall
dene the formal-parameters of the procedure-block, if any, associated with the identier of the
procedure-heading to be those of the formal-parameter-list.
Examples of procedure-and-function-declaration-parts:
Example 1:
52
ISO/IEC 10206:1990(E)
i : natural;
begin
for i := low to high do A[i] := B[i] + C[i]
end f g
of AddVectors ;
Example 2:
53
ISO/IEC 10206:1990(E)
54
ISO/IEC 10206:1990(E)
6.7.2 Function-declarations
function-declaration = function-heading `;' remote-directive
j function-identication `;' function-block
j function-heading `;' function-block .
function-heading = `function' identier [ formal-parameter-list ]
[ result-variable-specication ] `:' result-type .
result-variable-specication = `=' identier .
function-identication = `function' function-identier .
function-identier = identier .
result-type = type-name .
function-block = block .
function-name = [ imported-interface-identier `.' ] function-identier .
A function-name shall denote the function denoted by the function-identier of the function-name.
The occurrence of an imported-interface-identier in a function-name shall be the dening-point of
each imported function-identier associated with the imported-interface-identier for the region that
is the function-identier of the function-name.
The occurrence of the identier in a result-variable-specication of a function-heading shall constitute
its dening-point as a function-result-identier for the region that is the formal-parameter-list, if any,
of the function-heading and shall constitute its dening-point as a variable-identier for the region
that is the block of the function-block, if any, associated with the identier of the function-heading;
the variable-identier shall possess the type, initial state, and bindability denoted by the type-name
of the result-type of the function-heading, and within each activation of the function-block, if any,
shall denote the result of the activation (see 6.2.3.2 k)).
If there is a result-variable-specication in the function-heading associated with a function-block, the
function-block shall contain no assignment-statement (see 6.9.2.2) such that the function-identier
of the assignment-statement is associated with the function-block, and the function-block shall
contain at least one statement threatening (see 6.9.4) a variable-access denoting the result of each
activation (see 6.2.3.2 k)) of the function-block; otherwise, the function-block shall contain at least
one assignment-statement such that the function-identier of the assignment-statement is associated
with the function-block.
The occurrence of an identier in the function-heading of a function-declaration shall constitute
its dening-point as a function-identier for the region that is the block or module-block closest-
containing the function-declaration. The type and initial state associated with the function-identier
shall be the type and initial state denoted by the result-type of the function-heading. The occurrence
of an identier in the function-heading of a procedure-and-function-heading-part contained by a
module-heading shall constitute its dening-point as a function-identier for the region that is the
module-heading. Within an activation of that block, that module-heading, or that module-block,
55
ISO/IEC 10206:1990(E)
each applied occurrence of the identier shall denote the corresponding function (see 6.2.3.2).
A type-name shall not be permissible as the type-name of a result-type if it denotes a le-type, a
structured-type having any component whose type-denoter is not permissible as a component-type
of a le-type, or the bindability that is bindable.
Each identier having a dening-point as a function-identier in the function-heading of a function-
declaration in which the remote-directive forward occurs shall have exactly one of its applied
occurrences in a function-identication of a function-declaration, and this applied occurrence shall
be closest-contained by the procedure-and-function-declaration-part closest-containing the function-
heading.
NOTE | This prohibits using a forward-declared function in a discriminated-schema and then using the
type dened by that discriminated-schema inside the block of the function.
Each identier having a dening-point as a function-identier in a function-heading of a procedure-
and-function-heading-part of a module-heading shall have exactly one of its applied occurrences in a
function-identication of a function-declaration of a procedure-and-function-declaration-part of the
module-block that is associated with the module-heading (see 6.11.1).
The occurrence of a function-block in a function-declaration shall associate the function-block with
the identier in the function-heading, or with the function-identier in the function-identication,
of the function-declaration; the block of the function-block shall be associated with the type and
initial state that is associated with the identier or function-identier. There shall be at most one
function-block associated with a function-identier.
The occurrence of a formal-parameter-list in a function-heading of a function-declaration shall dene
the formal-parameters of the function-block, if any, associated with the identier of the function-
heading to be those of the formal-parameter-list.
Example of a procedure-and-function-declaration-part:
function Sqrt (x : real) : real;
fThis function computes the square root of x (x > 0) using Newton's
method. g
const
eps = 10.0 * epsreal;
var
old, estimate : real;
begin
estimate := x;
repeat
old := estimate;
estimate := (old + x / old) * 0.5;
until abs(estimate - old) < eps * estimate;
Sqrt := estimate
end fof Sqrt ; g
function max (a : vector) = largestsofar : real;
56
ISO/IEC 10206:1990(E)
f
function ReadExpression; See forward declaration of heading. g
var
this : formula;
op : operation;
begin
this := ReadOperand;
while IsOperator(nextsym) do
begin
op := ReadOperator;
this := MakeFormula(this, op, ReadOperand);
end;
ReadExpression := this
end;
57
ISO/IEC 10206:1990(E)
if IsOpenParenthesis(nextsym) then
begin
SkipSymbol;
ReadOperand := ReadExpression;
f
nextsym should be a close-parenthesis g
SkipSymbol
end
else ReadOperand := ReadElement
end;
begin
midnight := targ time;
with midnight do begin
hours := 0;
minutes := 0;
seconds := 0;
end;
end;
6.7.3 Parameters
6.7.3.1 General
The identier-list in a value-parameter-specication shall be a list of value parameters. The identier-
list in a variable-parameter-specication shall be a list of variable parameters.
formal-parameter-list = `(' formal-parameter-section f `;' formal-parameter-section g `)' .
formal-parameter-section > value-parameter-specication
j variable-parameter-specication
j procedural-parameter-specication
j functional-parameter-specication .
NOTE | 1 There is also a syntax rule for formal-parameter-section in 6.7.3.7.1.
58
ISO/IEC 10206:1990(E)
NOTE | 2 The state (or value, if any) of a protected formal variable parameter can change during an
activation due to changes made to the actual-parameter (e.g., aliasing), whereas the value of a protected
formal value parameter cannot change.
Example:
procedure illustrate(a : integer; f value paramg
var b : integer; f variable param g
protected c : integer; f protected value param g
protected var d : integer); f protected variable param g
59
ISO/IEC 10206:1990(E)
60
ISO/IEC 10206:1990(E)
type-name or type-inquiry. The bindability of the formal-parameters and their associated variable-
identiers, and the bindability denoted by the type-name or type-inquiry, shall be nonbindable.
61
ISO/IEC 10206:1990(E)
An actual variable parameter shall not denote a eld that is the selector of a variant-part. An
actual variable parameter shall not denote a component of a variable where that variable possesses
a type that is designated packed. An actual variable parameter shall not denote a component of a
string-type.
NOTE | 3 An actual variable parameter cannot denote a substring-variable because the type of a substring-
variable is a new xed-string-type dierent from every named type.
62
ISO/IEC 10206:1990(E)
a) 1) They are both value-parameter-specications containing the same number of parameters.
2) Either both contain protected or neither contains protected.
3) All the parameters possess the same bindability.
4) The schema-name in the parameter-form of each value-parameter-specication denotes
the same schema, or the type-name in the parameter-form of each value-parameter-
specication denotes the same type not produced from a schema, or the type-name in
the parameter-form of each value-parameter-specication denotes a type that is produced
from the same schema, or the variable-name closest-contained by the type-inquiry in the
parameter-form of each value-parameter-specication denotes the same variable, or the
parameter-identier closest-contained by the type-inquiry in the parameter-form of each
value-parameter-specication denotes parameter-identiers with their dening-points in
corresponding positions in the formal-parameter-list closest-contained by the formal-
parameter-section and the formal-parameter-list that denes the formal-parameters of the
procedure or function denoted by the actual-parameter. It shall be a dynamic-violation
if the type-name in the parameter-form of each value-parameter-specication denotes a
type produced from the same schema but not with the same tuple.
b) 1) They are both variable-parameter-specications containing the same number of
parameters.
2) Either both contain protected or neither contains protected.
3) Unless the parameters possess a le-type, all the parameters possess the same bindability.
4) The schema-name in the parameter-form of each variable-parameter-specication denotes
the same schema, or the type-name in the parameter-form of each variable-parameter-
specication denotes the same type not produced from a schema, or the type-name in the
parameter-form of each variable-parameter-specication denotes a type that is produced
from the same schema, or the variable-name closest-contained by the type-inquiry in the
parameter-form of each variable-parameter-specication denotes the same variable, or the
parameter-identier closest-contained by the type-inquiry in the parameter-form of each
variable-parameter-specication denotes parameter-identiers with their dening-points
in corresponding positions in the formal-parameter-list closest-contained by the formal-
parameter-section and the formal-parameter-list that denes the formal-parameters of the
procedure or function denoted by the actual-parameter. It shall be a dynamic-violation
if the type-name in the parameter-form of each variable-parameter-specication denotes
a type produced from the same schema but not with the same tuple.
c) They are both procedural-parameter-specications and the formal-parameter-lists of the
procedure-headings thereof are congruous.
d) They are both functional-parameter-specications, the formal-parameter-lists of the function-
headings thereof are congruous, and the type-names of the result-types of the function-headings
thereof denote the same type.
e) They are either both value-conformant-array-specications or both variable-conformant-array-
specications; and in both cases the conformant-array-parameter-specications contain the
63
ISO/IEC 10206:1990(E)
1 The abbreviated conformant-array-form and its corresponding full form are equivalent (see 6.7.3.7).
2 For the status of item e) see 5.1 a), 5.1 b), 5.1 c), 5.2 a), and 5.2 b).
6.7.3.7.1 General
The occurrence of an identier in the identier-list contained by a conformant-array-parameter-
specication shall constitute its dening-point as a parameter-identier for the region that is the
formal-parameter-list closest-containing it and its dening-point as the associated variable-identier
for the region that is the block, if any, of which it is a formal-parameter. A variable-identier
so dened shall be designated a conformant-array-parameter. If the conformant-array-parameter-
specication contains protected, then the variable-identier shall be designated protected (see 6.5.1).
The occurrence of an identier in an index-type-specication shall constitute its dening-point as
a bound-identier for the region that is the formal-parameter-list closest-containing it and for the
region that is the block, if any, whose formal-parameters are specied by that formal-parameter-list.
formal-parameter-section > conformant-array-parameter-specication .
conformant-array-parameter-specication =
[ `protected' ]( value-conformant-array-specication
j variable-conformant-array-specication ) .
value-conformant-array-specication = identier-list `:' conformant-array-form .
variable-conformant-array-specication = `var' identier-list `:' conformant-array-form .
conformant-array-form = packed-conformant-array-form
j unpacked-conformant-array-form .
64
ISO/IEC 10206:1990(E)
Within the activation of the block, applied occurrences of the rst identier of an index-type-
specication shall denote the smallest value specied by the corresponding index-type (see 6.7.3.8)
possessed by the actual-parameter, and applied occurrences of the second identier of the index-
type-specication shall denote the largest value specied by that index-type.
NOTE | 2 The object denoted by a bound-identier is neither constant nor a variable.
The conformant-actual-variables (see 6.7.3.7.2) corresponding to formal-parameters that occur in a
single value-conformant-array-specication and contained by one activation shall all possess the same
type or shall all possess xed-string-types with the same capacity. The conformant-actual-variables
(see 6.7.3.7.3) corresponding to formal-parameters that occur in a single variable-conformant-array-
specication and having references contained by one activation shall all possess the same type.
The type possessed by the conformant-actual-variables shall be conformable (see 6.7.3.8) with the
conformant-array-form, and the formal-parameters shall possess an array-type which shall be distinct
from any other type and which shall have a component-type that shall be the xed-component-type of
the conformant-array-parameters dened in the conformant-array-parameter-specication and that
shall have the index-types of the type possessed by the conformant-actual-variables that correspond
(see 6.7.3.8) to the index-type-specications contained by the conformant-array-form contained by
the conformant-array-parameter-specication. The type and initial state denoted by the type-name
that is not contained by an index-type-specication and that is contained by a conformant-array-
parameter-specication shall be designated the xed-component-type and xed-component-initial-
state, respectively, of the conformant-array-parameters dened by that conformant-array-parameter-
specication. The formal-parameters shall possess the initial state of their type having as its
component initial state the xed-component-initial-state. The formal-parameters shall possess the
bindability that is nonbindable.
65
ISO/IEC 10206:1990(E)
66
ISO/IEC 10206:1990(E)
6.7.3.8 Conformability
NOTE | 1 For the status of this subclause see 5.1 a), 5.1 b), 5.1 c), 5.2 a), and 5.2 b).
Given a type denoted by an array-type closest-containing a single index-type and a conformant-
array-form closest-containing a single index-type-specication, then the index-type and the index-
type-specication shall be designated as corresponding. Given two conformant-array-forms closest-
containing a single index-type-specication, then the two index-type-specications shall be designated
as corresponding. Let T1 be an array-type with a single index-type and let T2 be the type denoted
by the ordinal-type-name of the index-type-specication closest-contained by a conformant-array-
form closest-containing a single index-type-specication; then T1 shall be conformable with the
conformant-array-form if all the following ve statements are true.
a) The index-type of T1 is compatible with T2.
b) The smallest and largest values specied by the index-type of T1 lie within the closed interval
specied by T2.
c) The component-type of T1 denotes the same type and bindability as that denoted by the
type-name of the packed-conformant-array-form or unpacked-conformant-array-form of the
conformant-array-form or is conformable to the conformant-array-form closest-contained by
the conformant-array-form.
d) Either T1 is not designated packed and the conformant-array-form is an unpacked-conformant-
array-form, or T1 is designated packed and the conformant-array-form is a packed-conformant-
array-form.
e) T1 denotes the bindability that is nonbindable.
NOTE | 2 The abbreviated and full forms of a conformant-array-form are equivalent (see 6.7.3.7). The
abbreviated and full forms of an array-type are equivalent (see 6.4.3.2).
At any place where the rule of conformability is used, it shall be an error if the smallest or largest
value specied by the index-type of T1 lies outside the closed interval specied by T2.
67
ISO/IEC 10206:1990(E)
68
ISO/IEC 10206:1990(E)
where, if f possesses the type denoted by the required type-identier text and if f0.L~f0.R is
not empty and if (f0.L~f0.R).last is not an end-of-line, then X shall be a sequence having an
end-of-line component as its only component; otherwise, X = S( ).
get(f)
pre-assertion: (f0.M = Inspection or f0.M = Update) and (neither f0.L nor f0.R is undened)
and
(f0.R <> S( )).
post-assertion: (f.M = f0.M) and
(f.L = (f0.L~S(f0.R.rst))) and
(f.R = f0.R.rest) and
(if f.R = S( )
then (f" is totally-undened)
else (f" = f.R.rst)).
SeekWrite(f, n)
pre-assertion: (neither f0.L nor f0.R is undened) and
(0 <= ord(n)-ord(a) <= length(f0.L~f0.R))
post-assertion: (f.M = Generation) and
(f.L~f.R = f0.L~f0.R) and
(length(f.L) = ord(n)-ord(a)) and
(f"is totally-undened).
69
ISO/IEC 10206:1990(E)
SeekRead(f, n)
pre-assertion: (neither f0.L nor f0.R is undened) and
(0 <= ord(n)-ord(a) <= length(f0.L~f0.R)).
post-assertion: (f.M = Inspection) and
(f.L~f.R = f0.L~f0.R) and
(if length(f0.L~f0.R) > ord(n)-ord(a)
then
((length(f.L) = ord(n)-ord(a)) and
(f"= f.R.rst))
else
((f.R = S( )) and
(f"is totally-undened))).
SeekUpdate(f, n)
pre-assertion: (neither f0.L nor f0.R is undened) and
(0 <= ord(n)-ord(a) <= length(f0.L~f0.R))
post-assertion: (f.M = Update) and
(f.L~f.R = f0.L~f0.R) and
(if (length(f0.L~f0.R) > ord(n)-ord(a)
then
((length(f.L) = ord(n) - ord(a)) and
(f"= f.R.rst))
else
((f.R = S( )) and
(f" is totally-undened))).
When the le-variable f possesses a type other than that denoted by text, the required procedures
read and write shall be dened as follows.
read
Let f denote a le-variable and v1 ,...,vn denote variable-accesses (n>=2); then the procedure-
statement read(f,v1 ,...,vn ) shall access the le-variable and establish a reference to the le-
variable for the remaining execution of the statement. The execution of the statement shall
be equivalent to
begin read(,v1 ); read(,v2 ,...,vn ) end
where denotes the referenced le-variable.
Let f be a le-variable and v be a variable-access; then the procedure-statement read(f,v) shall
access the le-variable and establish a reference to that le-variable for the remaining execution
of the statement. The execution of the statement shall be equivalent to
begin v := "; get() end
where denotes the referenced le-variable.
NOTE | 2 The variable-access is not a variable parameter. Consequently, it may be a variant-selector
70
ISO/IEC 10206:1990(E)
or a component of a packed structure, and the value of the buer-variable need only be assignment-
compatible with it.
write
Let f denote a le-variable and e1 ,...,en denote expressions (n>=2); then the procedure-
statement write(f,e1 ,...,en ) shall access the le-variable and establish a reference to that le-
variable for the remaining execution of the statement. The execution of the statement shall
be equivalent to
begin write(,e1 ); write(,e2 ,...,en ) end
where denotes the referenced le-variable.
Let f be a le-variable and e be an expression; then the procedure-statement write(f,e) shall
access the le-variable and establish a reference to that le-variable for the remaining execution
of the statement. The execution of the write statement shall be equivalent to
begin " := e; put() end
where denotes the referenced le-variable.
NOTES
3 The required procedures read, write, readln, writeln, and page, as applied to textles, are
described in 6.10.
4 Since the denitions of read and write include the use of get and put, the implementation-dened
aspects of their post-assertions also apply.
5 A consequence of the denitions of read and write is that non-le parameters are evaluated in a
left-to-right order.
71
ISO/IEC 10206:1990(E)
The case-constant c1 shall correspond to the variant-part of the eld-list of the record-type.
For 1 < i <= n, ci shall correspond to the variant-part of the eld-list of the variant-denoter
denoting the variant specied by ci -1. For 1 <= i <= n, the variant-part corresponding to
ci shall closest-contain a tag-type. For 1 <= i <= n, the initial state of the selector of the
variant corresponding (see above) with the case-constant ci shall be the state bearing the value
associated (see 6.4.3.4) with the variant corresponding (see 6.4.3.4) to the value denoted by
ci .
It shall be an error if a variant of a variant-part within the new variable is active and a dierent
variant of the variant-part is one of the specied variants.
NOTE | 1 Since the initial state of each selector is determined by the corresponding case-constant,
any corresponding tag-eld is also attributed the value of the case-constant (see 6.4.3.4).
new(p,d1 ,...,ds )
shall create a new variable that is in its initial state and not bound to an external entity; shall
create a new identifying-value of the pointer-type associated with p, that identies the new
variable; and shall attribute this identifying-value to the variable denoted by the variable-access
p.
The domain-type of the new-pointer-type denoting the type possessed by p shall contain a
schema-identier. The created variable shall possess the type, bindability, and initial state
associated by the schema denoted by the schema-identier with the tuple consisting of the
values of the expressions d1 ,...,ds taken in textual order; the type of each such expression shall
be compatible with the type of the corresponding formal discriminant of the schema. The
order of evaluation of the expressions shall be implementation-dependent.
It shall be a dynamic-violation if the tuple is not in the domain of the schema.
NOTES
2 If the schema is the required schema string, then s = 1, and the created variable possesses a new
variable-string-type with capacity equal to the value of d1 , a positive integer.
3 The variable-access p is not a variable parameter. Consequently, it may be a variant-selector or a
component of a packed structure.
A variable created by the required procedure new shall exist until the termination of the activation
of the program-block or until the value identifying the variable is removed from the set of values of
its pointer-type.
NOTE | 4 A complying program can access an identied-variable only when the identifying-value is
attributed to a variable (possibly a function activation result).
dispose(q)
shall remove the identifying-value denoted by the expression q from the pointer-type of q. It
shall be an error if the identifying-value had been created using the form new(p,cl ,...,cn ).
dispose(q,kl ,...,km )
shall remove the identifying-value denoted by the expression q from the pointer-type of q. The
case-constants kl ,...,km shall be listed in order of increasing nesting of the variant-parts, each
72
ISO/IEC 10206:1990(E)
closest-containing a tag-type. It shall be an error unless the variable had been created using
the form new(p,cl ,...,cn ) and m is equal to n. It shall be an error if the variants in the variable
identied by the pointer value of q are dierent from those specied by the values denoted by
the case-constants k1 ,...,km .
NOTE | 5 The removal of an identifying-value from the pointer-type to which it belongs renders the
identied-variable inaccessible (see 6.5.4) and makes undened all variables and functions that have that
value attributed (see 6.7.3.2 and 6.9.2.2).
It shall be an error if q has a nil-value or is undened.
It shall be an error if a variable-access in a primary, in an assignment-statement, or in an actual-
parameter closest-contains an identied-variable that denotes a variable created using the form new(p,
cl ,...,cn ).
73
ISO/IEC 10206:1990(E)
NOTE | Errors will arise if the references cannot be established, if one or more of the values attributed to
j is not assignment-compatible with the index-type of the type of a, or if an evaluated array component is
undened.
NOTE | 2 The above example, where E, R, C, and I possess a variable-string-type having a capacity
of at least 5, the real-type, the char-type, and the integer-type, respectively, yields:
R = 0.0,
C = '-', and
I = 4.
writestr(s,p1 ,...,pn )
The syntax of the parameter list of writestr shall be
writestr-parameter-list = `(' string-variable `,' write-parameter f `,' write-parameter g `)' .
NOTE | 3 Write-parameter is dened in 6.10.3.
74
ISO/IEC 10206:1990(E)
Writestr(s,p1 ,...,pn ) shall access the string-variable s, which shall possess a xed-string-type
or a variable-string-type, and establish a reference to that string-variable for the remaining
execution of the statement. The execution of the statement shall be equivalent to
begin
rewrite(f);
writeln(f,pl ,...,pn );
reset(f);
read(f,ss)
end
where ss denotes the referenced string-variable corresponding to s, and f denotes an auxiliary
variable that the program does not otherwise contain, which possesses the required type text.
It shall be an error if any of the write-parameters accesses the referenced string-variable. It
shall be an error if the equivalent of eoln(f) is false upon completion.
NOTE | 4 The capacity of the string-type possessed by the string-variable must be great enough to
receive the concatenation of the representations of the values specied by the write-parameters.
Example:
writestr(S, 0.168:5:2, 6:3);
NOTE | 5 The above example, where S possesses a string-type having a capacity of at least 8, might
yield (assuming that type real is suciently precise):
S = ' 0.17 6'.
75
ISO/IEC 10206:1990(E)
4 In bind(f,b), b may be any expression of type BindingType; but even if b is a variable, the value
of b is not altered by bind(f,b). In particular, bind(f,b) does not set b.bound to true or false to re
ect
the success of the binding. The only time b.bound is guaranteed to be the binding status of f is
immediately after a statement such as b:=binding(f) (see 6.7.6.8).
5 After bind(f,b), the value of b is altered only by program action. Bind(f,b) binds f to the external
entity described by b; it does not set up any dynamic association between the binding and b.
6 An example is found in 6.7.6.8.
unbind(f)
For a variable-access f, the statement unbind(f) shall access the variable denoted by f and
shall attempt to unbind the accessed variable from the entity external to the program to which
it is bound, if any. If the attempt is successful, the variable shall become totally-undened.
The eect on the binding, if any, of any bindable variable contained by the accessed variable
shall be implementation-dependent. If the variable-access f possesses a le-type, it shall be a
dynamic-violation if the variable does not possess the bindability that is bindable; otherwise,
the variable shall possess the bindability that is bindable.
NOTE | 7 Unbind(f) is permitted even if f is not bound to an external entity and is permitted even
if f is totally-undened.
76
ISO/IEC 10206:1990(E)
NOTE | The principal value of the argument of x is greater than -pi and is less than or equal to pi (radians).
The principal value of the natural logarithm of x has as its real part the natural logarithm of the absolute
value of x, and as its imaginary part the principal value, in radians, of the argument of x. The principal
value of the square root of x is the base of natural logarithms raised to the power one-half the principal value
of the natural logarithm of x. Its argument is greater than -pi/2 and is less than or equal to pi/2 (radians);
thus, its real part is non-negative. The principal value of the arctangent of x is (-i/2) times the principal
value of the natural logarithm of (1+i*x)/(1-i*x), where i is the principal value of the square root of -1.
77
ISO/IEC 10206:1990(E)
78
ISO/IEC 10206:1990(E)
chr(ord(ch)) = ch
succ(x,k)
From the expression x that shall be of an ordinal-type and the expression k that shall be of
integer-type, this function shall return a result that shall be of the ordinal-type. The function
shall yield a value whose ordinal number is ord(x) + k, if such a value exists. It shall be an
error if such a value does not exist.
succ(x)
Shall be equivalent to succ(x,1).
pred(x,k)
Shall be equivalent to succ(x,-(k)).
pred(x)
Shall be equivalent to succ(x,-1).
Examples:
f The types shape and colour are dened in 6.4.10g
succ(yellow, -1) f yields redg
succ(triangle, 0) f yields triangleg
succ(yellow) f yields greeng
succ(yellow, 2) f yields blueg
pred(red, -1) f yields yellowg
pred(triangle, 0) f yields triangleg
pred(green) f yields yellowg
pred(blue, 2) f yields yellowg
6.7.6.5 Boolean functions
odd(x)
From the expression x that shall be of integer-type, this function shall be equivalent to the
expression:
(abs(x) mod 2 = 1).
eof(f)
The parameter f shall be a le-variable; if the actual-parameter-list is omitted, the function
shall be applied to the required textle input, which shall be implicitly accessible (see 6.11.4.2)
by the function-designator. When eof(f) is activated, it shall be an error if f is undened;
otherwise, the function shall yield the value true if f.R is the empty sequence (see 6.4.3.6);
otherwise, false.
eoln(f)
The parameter f shall be a textle; if the actual-parameter-list is omitted, the function shall
be applied to the required textle input, which shall be implicitly accessible (see 6.11.4.2)
by the function-designator. When eoln(f) is activated, it shall be an error if f is undened or
if eof(f) is true; otherwise, the function shall yield the value true if f.R.rst is an end-of-line
component (see 6.4.3.6); otherwise, false.
79
ISO/IEC 10206:1990(E)
empty(f)
The parameter f shall be a le-variable that possesses a direct-access le-type. When empty(f)
is activated, it shall be an error if f is undened; otherwise, the function shall yield the value
true if f.L~f.R is the empty sequence (see 6.4.3.6); otherwise, false.
6.7.6.6 Direct-access position functions
position(f)
The parameter f shall be a le-variable that possesses a direct-access le-type with index-type
T. Let a be the smallest value of type T. When position(f) is activated, it shall be an error if
f is undened; otherwise, the function shall return a result of type T such that position(f) =
succ(a, length(f.L)). It shall be an error if no such value exists.
LastPosition(f)
The parameter f shall be a le-variable that possesses a direct-access le-type with index-type
T. Let a be the smallest value of type T. When LastPosition(f) is activated, it shall be an error
if f is undened; otherwise, the function shall return a result of type T such that LastPosition(f)
= succ(a, length(f.L~f.R)-1). It shall be an error if no such value exists.
80
ISO/IEC 10206:1990(E)
equals 0, the function shall yield the null-string; otherwise, the function shall yield the value
of sv[i..(i)+(j)-1].
NOTE | 2 Substr(s,i,j) computes the substring of string s beginning at position i and extending for
length j.
substr(s, i)
Let sv denote an auxiliary variable that the program does not otherwise contain and that
possesses a variable-string-type with a capacity equal to the greater of 1 and the length of
the value of s. Let the value attributed to sv be the value of s. Let iv denote an auxiliary
variable that the program does not otherwise contain and that possesses the integer-type. Let
the value attributed to iv be the value of i. The function shall be equivalent to the expression
substr(sv,iv,length(sv)-(iv)+1).
trim(s)
From the expression s that shall be of char-type or a string-type, this function shall return a
result of the canonical-string-type. Let n be the length of the value of s. Let sv denote an
auxiliary variable that the program does not otherwise contain and that possesses a variable-
string-type with a capacity equal to the greater of 1 and n. Let the value attributed to sv
be the value of s. If n equals 0, the function shall yield the null-string; if the value of sv[n]
is not equal to the char-type value space, the function shall yield the value of sv; otherwise,
the function shall yield the value of substr(sv,1,p-1), where p is the least value in the closed
interval 1..n such that each component of sv[p..n] is the char-type value space.
For the following string comparison functions, the expressions s1 and s2 shall each be of char-type
or the canonical-string-type. Let n1 be the length of the value of s1 and n2 be the length of the
value of s2. Let s1v denote an auxiliary variable that the program does not otherwise contain and
that possesses a variable-string-type with a capacity equal to the greater of 1 and n1. Let the value
attributed to s1v be the value of s1. Let s2v denote an auxiliary variable that the program does not
otherwise contain and that possesses a variable-string-type with a capacity equal to the greater of 1
and n2. Let the value attributed to s2v be the value of s2.
The result of each of the following string comparison functions shall be of Boolean-type.
EQ(s1,s2)
This function shall be equivalent to the expression
( (s1v = s2v) and (n1 = n2) ).
LT(s1,s2)
If n1 < n2, this function shall be equivalent to the expression
( s1v <= substr(s2v, 1, n1) );
otherwise, this function shall be equivalent to the expression
( substr(s1v, 1, n2) < s2v ) .
GT(s1,s2)
This function shall be equivalent to the expression
81
ISO/IEC 10206:1990(E)
82
ISO/IEC 10206:1990(E)
repeat
writeln('Enter file name:');
readln(b.name);
bind(f, b);
b := binding(f);
if not b.bound
then
writeln('File not bound--try again.');
until b.bound;
end;
6.8 Expressions
6.8.1 General
An expression not contained by a schema-denition shall denote a value; an expression contained
by a schema-denition shall denote a value for each tuple allowed by the actual-discriminant-part
of the schema-denition. The use of a variable-access as a primary shall denote the value, if any,
attributed to the variable accessed thereby. When a primary is used, it shall be an error if the variable
denoted by a variable-access of the primary is undened. Operator precedences shall be according
to ve classes of operators as follows. The operator not shall have the highest precedence, followed
by the exponentiating-operators, followed by the multiplying-operators, the adding-operators and
signs, and nally, with the lowest precedence, the relational-operators. Sequences of two or more
operators of the same precedence shall be left associative.
expression = simple-expression [ relational-operator simple-expression ] .
simple-expression = [ sign ] term f adding-operator term g .
term = factor f multiplying-operator factor g .
factor = primary [ exponentiating-operator primary ] .
83
ISO/IEC 10206:1990(E)
84
ISO/IEC 10206:1990(E)
not p
pixel [red, c, green]
b) Factors:
x pow (-k)
x**y
c) Terms:
x * y
i / (1 - i)
(x <= y) and (y < z)
x*y**z
"
(x <> nil) and then (x .field = 5)
d) Simple Expressions:
p or q
x + y
-x
hue1 + hue2
i * j + 1
x pow 3 + y pow 3 + z pow 3
(x = 0) or else (a = (b/x))
e) Expressions:
x = 1.5
p <= q
p = q and r
(i < j) = (j < k)
c in hue1
x pow k > y pow k - z pow k
6.8.2 Constant-expressions
A constant-expression shall denote the value denoted by the expression of the constant-expression.
constant-expression = expression .
The expression of a constant-expression shall be nonvarying and shall not contain a discriminant-
identier.
An expression shall be designated nonvarying if it does not contain the following
a) an applied occurrence of an identier as a variable-identier, a schema-discriminant, a bound-
identier, or a eld-designator-identier; or
b) an applied occurrence of an identier as a type-name that denotes a type that is not static; or
c) an applied occurrence of an identier as a function-identier that has a dening-point contained
85
ISO/IEC 10206:1990(E)
by the program-block or that denotes one of the required functions eof or eoln.
NOTES
1 By the above, it is implied that variable-accesses are excluded from constant-expressions. Similarly, the
functions empty, position, and LastPosition cannot appear in constant-expressions because these functions
require a variable as a parameter.
2 Since the accuracy of mathematical results of the real-type and of the complex-type are implementation-
dened (see 6.4.2.2), an implementation is required to specify the accuracy of constant-expressions.
3 See 6.3.2 for examples of the use of nonvarying expressions.
6.8.3 Operators
6.8.3.1 General
exponentiating-operator = `**' j `pow' .
multiplying-operator = `*' j `/' j `div' j `mod' j `and' j `and then' .
adding-operator = `+' j `;' j `><' j `or' j `or else' .
relational-operator = `=' j `<>' j `<' j `>' j `<=' j `>=' j `in' .
A primary, a factor, a term, or a simple-expression shall be designated an operand. Except for the
and then and or else operators, the order of evaluation of the operands of a dyadic operator shall
be implementation-dependent.
NOTE | This means, for example, that the operands may be evaluated in textual order, or in reverse order,
or in parallel, or they may not both be evaluated.
86
ISO/IEC 10206:1990(E)
NOTES
2 Only for i >= 0 and j > 0 does the relation (i div j) * j + i mod j = i hold.
3 See 6.4.2.2 for conditions under which the arithmetic operations are correctly performed.
A factor of the form x**y shall be an error if x is zero and y is less than or equal to zero.
A factor of the form x**y, where x is of integer-type or real-type, shall be an error if x is negative;
otherwise, the value of x**y shall be zero if x is zero, else 1.0 if y is zero, else an approximation to
(though not necessarily calculated by) exp(y*ln(x)).
The value of a factor of the form x**y, where x is of complex-type, shall be zero if x is zero, else 1.0
if y is zero, else an approximation to (though not necessarily calculated by) exp(y*ln(x)).
A factor of the form x pow y shall be an error if x is zero and y is less than or equal to zero.
The value of a factor of the form x pow y, where x is of integer-type, shall be zero if x is zero, else
1 if y is zero, else equal to x*(x pow (y-1)) if y is positive, else equal to (1 div x) pow (-y) if y is
87
ISO/IEC 10206:1990(E)
negative.
The value of a factor of the form x pow y, where x is of real-type or complex-type, shall be zero
if x is zero, else 1.0 if y is zero, else an approximation to x*(x pow (y-1)) if y is positive, else an
approximation to (1/x) pow (-y) if y is negative.
88
ISO/IEC 10206:1990(E)
Where x denotes a value of the ordinal-type T and u and v are operands of an unpacked-canonical-
set-of-T-type or a packed-canonical-set-of-T-type, it shall be true for all x that
| x is a member of the value u+v if and only if it is a member of the value of u or a member
of the value of v;
| x is a member of the value u;v if and only if it is a member of the value of u and not a
member of the value of v;
| x is a member of the value u*v if and only if it is a member of the value of u and a member
of the value of v;
| x is a member of the value u >< v if and only if it is a member of the value of u and not a
member of the value of v or is a member of the value of v and not a member of the value of u.
6.8.3.5 Relational operators
The types of operands and results for relational operations shall be as shown in table 6.
89
ISO/IEC 10206:1990(E)
When the relational-operators =, <>, <, >, <=, and >= are used to compare operands of
compatible string-types (see 6.4.5), they shall denote the lexicographic relations dened below.
This lexicographic ordering shall impose a total ordering on values of a string-type.
Let s1 and s2 be two values of compatible string-types where the length of s1 is less than or equal
to the length of s2, let n1 be the length of s1, and let n2 be the length of s2; then
s1 = s2 i (for all i in [1..n1]: s1[i] = s2[i])
and (for all i in [n1+1..n2]: ' ' = s2[i])
s1 < s2 i ( there exists p in [1..n1]:
(for all i in [1..p-1]: s1[i] = s2[i])
and s1[p] < s2[p] )
or
( (for all i in [1..n1]: s1[i] = s2[i] )
and ( there exists p in [n1+1..n2]:
(for all i in [n1+1..p-1]: ' ' = s2[i])
and ' ' < s2[p]) )
The denitions of operations >, <>, <=, and >= are derived from the denitions of = and <.
The denitions of the relational operators for the length of s1 greater than the length of s2 are
derived from the denitions of the operators for the length of s1 less than or equal to the length of
s2.
When comparing a char-type value with a string-type value, the char-type value shall be treated
as a value of the canonical-string-type with length 1 and with the component-value equal to the
char-type value.
NOTES
2 For comparison of values of compatible char-types or string-types, the relational-operators eectively
extend the shorter value with trailing spaces to the length of the longer value.
3 String-type ordering is dened in terms of the char-type ordering, in turn dened in table 6.
The operator in shall yield the value true if the value of the operand of ordinal-type is a member of
the value of the set-type; otherwise, it shall yield the value false.
6.8.3.6 String operator
The types of operands and results for the string operator shall be as shown in table 7.
90
ISO/IEC 10206:1990(E)
denote a value of the canonical-string-type whose length shall be equal to the sum of the length of
a and the length of b. The value of the components of a + b in order of increasing index shall be
the values of the components of a in order of increasing index or the char-type value of a, followed
by the values of the components of b in order of increasing index or the char-type value of b.
6.8.4 Schema-discriminants
schema-discriminant = ( variable-access j constant-access ) `.' discriminant-specier
j schema-discriminant-identier .
discriminant-specier = discriminant-identier .
If a schema-discriminant closest-contains a variable-access or constant-access, the variable-access
or constant-access shall possess a type produced from a schema with a tuple, and the schema-
discriminant shall possess the type possessed by, and denote the value corresponding to, the discriminant-
identier of the discriminant-specier of the schema-discriminant according to the tuple. If a schema-
discriminant closest-contains a schema-discriminant-identier, the schema-discriminant shall possess
the type possessed by, and denote the value denoted by, the schema-discriminant-identier. The
occurrence of the variable-access or constant-access shall constitute the dening-point of each of
the discriminant-identiers that is a formal discriminant of the schema for the region that is the
discriminant-specier of the schema-discriminant.
Examples:
ShowScreen.height
ShowScreen.width
MyVector.vlength
6.8.5 Function-designators
A function-designator shall specify the activation of the block of the function-block of the function
(see 6.2.3.2 j)) denoted by the function-name of the function-designator and shall yield the value of
the result of the activation upon completion of the algorithm of the activation; it shall be an error
if the result is undened upon completion of the algorithm.
NOTE | When a function activation is terminated by a goto-statement (see 6.9.2.4), the algorithm of the
activation does not complete (see 6.2.3.2 a)), and thus there is no error if the result of the activation is
undened.
If the function has any formal-parameters, the function-designator shall contain actual-parameters
that shall be bound to their corresponding formal-parameters dened in the function-declaration.
The correspondence shall be established by the positions of the parameters in the lists of actual-
parameters and formal-parameters, respectively. The number of actual-parameters shall be equal to
the number of formal-parameters. The types of the actual-parameters shall correspond to the types
of the formal-parameters as specied by 6.7.3. The order of evaluation, accessing, and binding of
the actual-parameters shall be implementation-dependent.
function-designator = function-name [ actual-parameter-list ] .
91
ISO/IEC 10206:1990(E)
6.8.6.2 Indexed-function-accesses
An indexed-function-access shall denote a component of the value of a function-access possessing an
array-type or a string-type.
indexed-function-access = array-function `[' index-expression f `,' index-expression g `]'
j string-function `[' index-expression `]' .
array-function = function-access .
92
ISO/IEC 10206:1990(E)
string-function = function-access .
An array-function shall be a function-access possessing an array-type. A string-function shall be a
function-access possessing a string-type. The string-function of an indexed-function-access shall be
a function-access possessing a variable-string-type.
NOTE | Function-accesses possessing a xed-string-type are indexed using array-type properties.
6.8.6.3 Record-function-accesses
A record-function-access shall denote that component of the value of the record-function of the
record-function-access associated (see 6.4.3.4) with the eld-identier of the eld-specier of the
record-function-access. A record-function shall be a function-access possessing a record-type.
The occurrence of a record-function in a record-function-access shall constitute the dening-point of
the eld-identiers associated with components of the record-type possessed by the record-function
for the region that is the eld-specier of the record-function-access.
record-function-access = record-function `.' eld-specier .
record-function = function-access .
It shall be an error to denote a component of a variant, unless the variant is active.
93
ISO/IEC 10206:1990(E)
6.8.6.5 Substring-function-accesses
A substring-function-access shall denote a value of the canonical-string-type.
substring-function-access = string-function `[' index-expression `..' index-expression `]' .
The index-expressions in a substring-function-access shall possess the integer-type. It shall be an
error if the value of an index-expression in a substring-function-access is less than one or greater
than the length of the value of the string-function of the substring-function-access or if the value
of the rst index-expression is greater than the value of the second index-expression. The length
of the string-type value of the substring-function-access shall be equal to one plus the value of the
second index-expression minus the value of the rst index-expression. The components of the value
of the substring-function-access shall be, in order of increasing index, the contiguous components of
the value of the string-function from the component that corresponds to the value of the rst index-
expression through the component that corresponds to the value of the second index-expression.
The order of evaluation both of the index-expressions of, and of the string-function of, a substring-
function-access shall be implementation-dependent.
6.8.7 Structured-value-constructors
6.8.7.1 General
A structured-value-constructor shall denote a value of the type of the structured-value-constructor.
That type shall be a type that is permissible as the component-type of a le-type (see 6.4.3.6).
The order of evaluation of the component-values contained by a structured-value-constructor shall
be implementation-dependent.
structured-value-constructor = array-type-name array-value
j record-type-name record-value
j set-type-name set-value .
component-value = expression j array-value j record-value .
The type of a structured-value-constructor shall be the type denoted by the array-type-name, record-
type-name, or set-type-name of the structured-value-constructor. The type of an array-value, a
record-value, or a set-value of either a structured-value-constructor or a component-value shall be the
type of the structured-value-constructor or the component-value, respectively. The value denoted by
an expression in a component-value shall be assignment-compatible with the type of the component-
value. The structure of a value possessing a structured-type shall be the structure of the structured-
type.
94
ISO/IEC 10206:1990(E)
6.8.7.2 Array-values
The type of an array-value shall be an array-type, and the array-value shall denote a value of that
type.
array-value = `[' [ array-value-element f `;' array-value-element g [ `;' ] ]
[ array-value-completer [ `;' ] ] `]' .
array-value-element = case-constant-list `:' component-value .
array-value-completer = `otherwise' component-value .
The type of a component-value of either an array-value-element or an array-value-completer of an
array-value shall be the component-type of the array-type of the array-value.
The values denoted by the case-ranges of the case-constant-lists of the array-value-elements of an
array-value shall be distinct and shall belong to the set of values determined by the index-type of
the array-type possessed by the array-value. Every component of an array-value shall be a value, as
specied by one of the following two statements.
a) The component mapped to by each value denoted by a case-range of a case-constant-list of an
array-value-element of the array-value shall be the value denoted by the component-value of
the array-value-element.
b) Any component not mapped to by a value denoted by a case-range of a case-constant-list of
an array-value-element of the array-value shall be the value denoted by the component-value
of the array-value-completer of the array-value. If there is at least one such component, there
shall be an array-value-completer in the array-value.
6.8.7.3 Record-values
The type of a record-value shall be a record-type, and the record-value shall denote a value of that
type.
record-value = `[' eld-list-value `]' .
eld-list-value = [ ( xed-part-value [ `;' variant-part-value ] j variant-part-value ) [ `;' ] ] .
xed-part-value = eld-value f `;' eld-value g .
eld-value = eld-identier f `,' eld-identier g `:' component-value .
variant-part-value = `case' [ tag-eld-identier `:' ]
constant-tag-value `of' `[' eld-list-value `]' .
constant-tag-value = constant-expression .
tag-eld-identier = eld-identier .
95
ISO/IEC 10206:1990(E)
The occurrence of a record-value shall constitute the dening-point of each of the eld-identiers of
the record-type of the record-value as eld-identiers associated with the components of the record-
value for each region that is a eld-identier closest-contained by the record-value. The component
associated with each eld-identier in a eld-value shall be the value denoted by the component-
value of that eld-value. The type of the component-value of a eld-value shall be the type of each
of the components that are components of the record-type of the record-value closest-containing the
eld-value and that are associated with the eld-identiers of the eld-value.
NOTE | 1 Consequently, all eld-identiers in a eld-value must have been declared to have the same type.
Each eld-identier in a eld-value of a xed-part-value of a eld-list-value that corresponds to a eld-
list shall denote a eld of the eld-list. The eld-list-value of a record-value shall correspond to the
eld-list of the record-type possessed by the record-value. The xed-part-value or variant-part-value
of a eld-list-value shall correspond to the xed-part or variant-part, respectively, of the eld-list
corresponding to the eld-list-value. The constant-expression of a constant-tag-value of a variant-
part-value shall denote a value belonging to the set of values determined by the variant-type of
the variant-part corresponding to the variant-part-value. The eld-list-value of a variant-part-value
shall correspond to the eld-list of the variant corresponding to the value of the constant-expression
of the constant-tag-value of the variant-part-value; the selector component of the variant-part-value
shall be a value that is associated with that variant. A tag-eld-identier in a variant-part-value
shall be the eld-identier associated with the selector of the variant-part corresponding to the
variant-part-value; the component of the variant-part-value associated with the eld-identier shall
be the selector of the variant-part and shall be the value denoted by the constant-tag-value of the
variant-part-value. The eld-identier, if any, associated with the selector of a variant-part shall
have an applied occurrence in the tag-eld-identier of each variant-part-value corresponding to the
variant-part.
For each eld-list-value that corresponds to a eld-list, each eld-identier associated with a component
of the eld-list shall have exactly one applied occurrence as a eld-identier closest-contained by the
eld-list-value.
NOTE | 2 Consequently, every component of the record-value, including each active variant, must be
specied as a value. Also, a eld-identier cannot be specied more than once in a record-value.
6.8.7.4 Set-values
The type of a set-value shall be a set-type, and the set-value shall denote a value of that type.
set-value = set-constructor .
The value of the set-constructor of a set-value shall be assignment-compatible with the type of the
set-value.
6.8.8 Constant-accesses
6.8.8.1 General
NOTE | Neither a constant-access nor a constant-access-component is necessarily a constant. For example,
96
ISO/IEC 10206:1990(E)
the constant-access, c[i], denotes a dierent value for each iteration of the loop.
A constant-access-component shall denote a component or a substring of a value.
constant-access = constant-access-component j constant-name .
constant-access-component = indexed-constant
j eld-designated-constant
j substring-constant .
The value and type of a constant-access shall be the value and type, respectively, either of the
constant-name of the constant-access or of the indexed-constant, eld-designated-constant, or substring-
constant of the constant-access-component.
6.8.8.2 Indexed-constants
An indexed-constant shall denote a component of a value possessing an array-type or a string-type.
indexed-constant = array-constant `[' index-expression f `,' index-expression g `]'
j string-constant `[' index-expression `]' .
array-constant = constant-access .
string-constant = constant-access .
An array-constant shall be a constant-access possessing an array-type. A string-constant shall be
a constant-access possessing a string-type. The string-constant of an indexed-constant shall be a
constant-access possessing a variable-string-type.
NOTE | Constant-accesses possessing a xed-string-type are indexed using array-type properties.
For an array-constant in an indexed-constant closest-containing a single index-expression (see 6.5.3.2),
the value of the index-expression of the indexed-constant shall be assignment-compatible with the
index-type of the array-type of the array-constant.
For a string-constant in an indexed-constant, the index-expression of the indexed-constant shall
possess the integer-type, and it shall be an error if the value of the index-expression is not in the
index-domain of the value of the string-constant.
97
ISO/IEC 10206:1990(E)
The component denoted by the indexed-constant shall be the component that corresponds to the
value of the index-expression by the mapping of the type possessed by the array-constant (see
6.4.3.2) or string-constant (see 6.4.3.3).
If the array-constant is itself an indexed-constant, an abbreviation shall be permitted. In the
abbreviated form, a single comma shall replace the sequence ] [ that occurs in the full form. The
abbreviated form and the full form shall be equivalent.
The order of evaluation of the index-expressions of an indexed-constant shall be implementation-
dependent.
Examples:
UnitVector[limit]
BlankCard[1]
6.8.8.3 Field-designated-constants
A eld-designated-constant either shall denote that component of the value denoted by the record-
constant of the eld-designated-constant associated (see 6.4.3.4) with the eld-identier of the
eld-specier (see 6.5.3.3) of the eld-designated-constant or shall denote the value denoted by the
constant-eld-identier (see 6.9.3.10) of the eld-designated-constant.
The occurrence of a record-constant in a eld-designated-constant shall constitute the dening-
point of the eld-identiers associated with components of the record-type possessed by the record-
constant, for the region that is the eld-specier of the eld-designated-constant.
eld-designated-constant = record-constant `.' eld-specier
j constant-eld-identier .
record-constant = constant-access .
A record-constant shall be a constant-access possessing a record-type.
It shall be an error to denote a component of a variant, unless the variant is active.
Examples:
origin.r
origin.theta
unit.theta
6.8.8.4 Substring-constants
A substring-constant shall denote a value of the canonical-string-type.
substring-constant = string-constant `[' index-expression `..' index-expression `]' .
The index-expressions in a substring-constant shall possess the integer-type. It shall be an error if
the value of an index-expression in a substring-constant is less than 1 or greater than the length of
the value of the string-constant of the substring-constant or if the value of the rst index-expression
is greater than the value of the second index-expression. The length of the string-type value of the
98
ISO/IEC 10206:1990(E)
substring-constant shall be equal to one plus the value of the second index-expression minus the
value of the rst index-expression. The components of the value of the substring-constant shall be,
in order of increasing index, the contiguous components of the value of the string-constant from the
component that corresponds to the value of the rst index-expression through the component that
corresponds to the value of the second index-expression.
The order of evaluation of the index-expressions of a substring-constant shall be implementation-
dependent.
Example:
hex string[14..16]
6.9 Statements
6.9.1 General
Statements shall denote algorithmic actions and shall be executable.
A label, if any, of a statement S shall be designated as prexing S. The label shall be permitted
to occur in a goto-statement G (see 6.9.2.4) if and only if any of the following three conditions is
satised.
a) S contains G.
b) S is a statement of a statement-sequence containing G.
c) S is a statement of the statement-sequence of the compound-statement of the statement-part
of a block containing G.
statement = [ label `:' ] ( simple-statement j structured-statement ) .
NOTE | 2 A goto-statement within a block may refer to a label in an enclosing block, provided that the
label prexes a statement at the outermost level of nesting of the block.
6.9.2 Simple-statements
6.9.2.1 General
A simple-statement shall be a statement not containing a statement. An empty-statement shall
contain no symbol and shall denote no action.
simple-statement = empty-statement j assignment-statement
j procedure-statement j goto-statement .
empty-statement = .
99
ISO/IEC 10206:1990(E)
6.9.2.2 Assignment-statements
An assignment-statement shall attribute the value of the expression of the assignment-statement to
the variable that is denoted by the variable-access of the assignment-statement or that is the result
of the activation of the function denoted by the function-identier of the assignment-statement. The
value shall be assignment-compatible with the type of the variable denoted by the variable-access,
or the underlying-type (see 6.4.2.5) of the type of the variable that is the result of the activation.
The function-block associated (see 6.7.2) with the function-identier of an assignment-statement
shall contain the assignment-statement.
assignment-statement = ( variable-access j function-identier ) `:=' expression .
The variable-access shall establish a reference to the variable during the execution of the assignment-
statement. The order of establishing the reference to the variable and evaluating the expression shall
be implementation-dependent.
Examples:
x := y + z
p := (1 <= i) and (i < 100)
i := sqr(k) - (i * j)
hue1 := [blue, succ(c)]
"
p1 .mother := true
full name := last name + ', ' + first name + ' ' + middle initial
f
+ '., ' + mister 'Grant, Ulysses S., Mr.' g
6.9.2.3 Procedure-statements
A procedure-statement shall specify the activation of the block of the procedure-block of the procedure
(see 6.2.3.2 i)) denoted by the procedure-name of the procedure-statement. If the procedure has
any formal-parameters, the procedure-statement shall contain an actual-parameter-list, which is
the list of actual-parameters that shall be bound to their corresponding formal-parameters dened
in the procedure-declaration. The correspondence shall be established by the positions of the
parameters in the lists of actual-parameters and formal-parameters, respectively. The number of
actual-parameters shall be equal to the number of formal-parameters. The types of the actual-
parameters shall correspond to the types of the formal-parameters as specied by 6.7.3.
The order of evaluation, accessing, and binding of the actual-parameters shall be implementation-
dependent.
The procedure-name in a procedure-statement containing a read-parameter-list shall denote the
required procedure read; the procedure-name in a procedure-statement containing a readln-parameter-
list shall denote the required procedure readln; the procedure-name in a procedure-statement
containing a readstr-parameter-list shall denote the required procedure readstr; the procedure-
name in a procedure-statement containing a write-parameter-list shall denote the required procedure
write; the procedure-name in a procedure-statement containing a writeln-parameter-list shall denote
the required procedure writeln; the procedure-name in a procedure-statement containing a writestr-
parameter-list shall denote the required procedure writestr.
100
ISO/IEC 10206:1990(E)
6.9.2.4 Goto-statements
A goto-statement shall indicate that further processing is to continue at the program-point denoted
by the label in the goto-statement and shall cause the termination of all activations except
a) the activation containing the program-point;
b) any activation containing the activation-point of an activation required by exceptions a) or b)
not to be terminated; and
c) each of the activations that comprise the activation of the program-block (see 6.2.3.6).
goto-statement = `goto' label .
It shall be a dynamic-violation if the commencement of the activation containing the program-point
has not completed (see 6.2.3.8).
6.9.3 Structured-statements
6.9.3.1 General
structured-statement = compound-statement j conditional-statement
j repetitive-statement j with-statement .
statement-sequence = statement f `;' statement g .
The execution of a statement-sequence shall specify the execution of the statements of the statement-
sequence in textual order, except as modied by execution of a goto-statement.
6.9.3.2 Compound-statements
A compound-statement shall specify execution of the statement-sequence of the compound-statement.
compound-statement = `begin' statement-sequence `end' .
Example:
begin z := x; x := y; y := z end
6.9.3.3 Conditional-statements
conditional-statement = if-statement j case-statement .
101
ISO/IEC 10206:1990(E)
6.9.3.4 If-statements
if-statement = `if' Boolean-expression `then' statement [ else-part ] .
else-part = `else' statement .
If the Boolean-expression of the if-statement yields the value true, the statement of the if-statement
shall be executed. If the Boolean-expression yields the value false, the statement of the if-statement
shall not be executed, and the statement of the else-part, if any, shall be executed.
An if-statement without an else-part shall not be immediately followed by the token else.
NOTE | An else-part is thus paired with the nearest preceding otherwise unpaired then.
Examples:
if x < 1.5 then z := x + y else z := 1.5
"
if p1 <> nil then p1 := p1 .father
if j = 0 then
if i = 0 then writeln('indefinite')
else writeln('infinite')
else writeln( i / j )
6.9.3.5 Case-statements
The case-index of a case-statement and each case-constant closest-contained by the case-constant-
list of a case-list-element of the case-statement shall all possess the same ordinal-type; no value
shall be denoted by more than one case-range closest-contained by the case-constant-list of any case-
list-elements of the case-statement. On execution of the case-statement, the case-index shall be
evaluated. If a case-range closest-contained by a case-constant-list of a case-list-element of the case-
statement denotes that value, the statement of the case-list-element shall be executed; otherwise,
if a case-statement-completer occurs in the case-statement, the statement-sequence of the case-
statement-completer shall be executed; otherwise, it shall be a dynamic-violation.
NOTE | Case-constants are not the same as statement labels.
case-statement = `case' case-index `of'
( case-list-element f `;' case-list-element g
[ [ `;' ] case-statement-completer ] j case-statement-completer )
[ `;' ] `end' .
case-index = expression .
case-list-element = case-constant-list `:' statement .
case-statement-completer = `otherwise' statement-sequence .
Examples:
1) case operator of
102
ISO/IEC 10206:1990(E)
plus: i := i + j;
minus: i := i - j;
times: i := i * j;
divvy: case j of
-maxint..-1, 1..maxint: i := i div j;
0 : begin
writeln('divide by zero!');
halt;
end
otherwise i := 0; writeln(' See 6.4.2.2 a).')
end
end
2) if limit >= 0
then
case i of
-maxint..(-limit-1): writeln('too small');
-limit..limit: writeln('just right');
(limit+1)..maxint: writeln('too big')
end
else
writeln('limit is less than 0');
6.9.3.6 Repetitive-statements
Repetitive-statements shall specify that certain statements are to be executed repeatedly.
repetitive-statement = repeat-statement j while-statement j for-statement .
6.9.3.7 Repeat-statements
repeat-statement = `repeat' statement-sequence `until' Boolean-expression .
The statement-sequence of the repeat-statement shall be repeatedly executed, except as modied by
the execution of a goto-statement, until the Boolean-expression of the repeat-statement yields the
value true on completion of the statement-sequence. The statement-sequence shall be executed at
least once, because the Boolean-expression is evaluated after execution of the statement-sequence.
Example:
repeat
k := i mod j;
i := j;
j := k
until j = 0
103
ISO/IEC 10206:1990(E)
6.9.3.8 While-statements
while-statement = `while' Boolean-expression `do' statement .
The while-statement
while b do body
shall be equivalent to
begin
if b then
repeat
body
until not (b)
end
Examples:
while i > 0 do
begin if odd(i) then z := z * x;
i := i div 2;
x := sqr(x)
end
6.9.3.9 For-statements
6.9.3.9.1 General
The for-statement shall specify that the statement of the for-statement is to be repeatedly executed
while a progression of values is attributed to a variable denoted by the control-variable of the for-
statement.
for-statement = `for' control-variable iteration-clause `do' statement .
control-variable = entire-variable .
iteration-clause = sequence-iteration j set-member-iteration .
The control-variable shall be an entire-variable whose identier is declared in a variable-declaration-
part of the block closest-containing the for-statement. The control-variable shall possess an ordinal-
type and shall be nonbindable. After a for-statement is executed, other than being left by a goto-
statement, the control-variable shall be undened. Neither a for-statement nor any procedure-and-
function-declaration-part of the block that closest-contains a for-statement shall contain a statement
threatening (see 6.9.4) a variable-access denoting the variable denoted by the control-variable of
the for-statement.
104
ISO/IEC 10206:1990(E)
6.9.3.9.2 Sequence-iteration
sequence-iteration = `:=' initial-value ( `to' j `downto' ) nal-value .
initial-value = expression .
nal-value = expression .
The initial-value and the nal-value of a sequence-iteration of an iteration-clause of a for-statement
shall be of a type compatible with the type of the control-variable of the for-statement. The initial-
value and the nal-value shall be assignment-compatible with the type possessed by the control-
variable if the statement of the for-statement is executed.
Apart from the restrictions imposed by these requirements, the for-statement
for v := e1 to e2 do body
shall be equivalent to
begin
temp1 := e1;
temp2 := e2;
if temp1 <= temp2 then
begin
v := temp1;
body;
while v <> temp2 do
begin
v := succ(v);
body
end
end
end
and the for-statement
for v := e1 downto e2 do body
shall be equivalent to
begin
temp1 := e1;
temp2 := e2;
if temp1 >= temp2 then
begin
v := temp1;
body;
while v <> temp2 do
begin
v := pred(v);
105
ISO/IEC 10206:1990(E)
body
end
end
end
where temp1 and temp2 denote auxiliary variables that the program does not otherwise contain,
and that possess the range-type of the type possessed by the variable v.
Examples:
for i := 2 to 63 do
if a[i] > max then max := a[i]
for i := 1 to 10 do
for j := 1 to 10 do
begin
x := 0;
for k := 1 to 10 do
x := x + m1[i,k] * m2[k,j];
m[i,j] := x
end
for i := 1 to 10 do
for j := 1 to i - 1 do
m[i][j] := 0.0
6.9.3.9.3 Set-member-iteration
set-member-iteration = `in' set-expression .
set-expression = expression .
The set-expression of a set-member-iteration of an iteration-clause of a for-statement shall possess
an unpacked-canonical-set-of-T-type or a packed-canonical-set-of-T-type. The type of the control-
variable of the for-statement shall be compatible with T. The set-expression shall be evaluated prior
to the rst execution, if any, of the statement of the for-statement. Each value, if any, that is a
member of the value of the set-expression shall be assignment-compatible with the type possessed
by the control-variable. For each member of the value of the set-expression, the value that is the
member shall be attributed to the control-variable, and then the statement of the for-statement shall
be executed. The order in which members of the value of the set-expression are selected shall be
implementation-dependent.
Examples:
1) for c in hue1 do q(c)
106
ISO/IEC 10206:1990(E)
6.9.3.10 With-statements
with-statement = `with' with-list `do' statement .
with-list = with-element f `,' with-element g .
with-element = variable-access j constant-access .
eld-designator-identier = identier .
constant-eld-identier = identier .
schema-discriminant-identier = identier .
A with-statement shall specify the execution of the statement of the with-statement. The constant-
access or variable-access of a with-element shall possess either a type produced from a schema or a
record-type. The occurrence of a variable-access or constant-access, that possesses a record-type, in
the only with-element in the with-list of a with-statement shall constitute the dening-point of each
of the eld-identiers associated with components of the record-type as a eld-designator-identier
or constant-eld-identier, respectively, for the region that is the statement of the with-statement;
each applied occurrence of the eld-designator-identier or constant-eld-identier shall denote that
component, either of the variable denoted by the variable-access or of the value denoted by the
constant-access, respectively, that is associated with the eld-identier by the record-type.
An occurrence of a variable-access or constant-access, that possesses a type produced from a schema
with a tuple, in the only with-element in the with-list of a with-statement shall constitute the
dening-point of each discriminant-identier that is a formal discriminant of the schema as a schema-
discriminant-identier for the region that is the statement of the with-statement; each applied
occurrence of the schema-discriminant-identier shall possess the type possessed by the discriminant-
identier and shall denote the value corresponding to the discriminant-identier according to the
tuple.
The variable-access shall be accessed or the value of the constant-access shall be determined before
the statement of the with-statement is executed, and the access to the variable shall establish a
reference to the variable during the entire execution of the statement of the with-statement.
The statement
107
ISO/IEC 10206:1990(E)
with v1,v2,...,vn do s
shall be equivalent to
with v1 do
with v2 do
...
with vn do s
Examples:
1) with Good thru do
if month = 12
then begin
month := 1;
year := year+1
end
else month := month+1;
if Good thru.month = 12
then begin
Good thru.month := 1;
Good thru.year := Good thru.year+1
end
else Good thru.month := Good thru.month+1; g
2) with ShowScreen do
if (width = 80) and (height = 24)
then f
write full screen g
else f
write line by line g
3) with unit do
begin
x := r;
coordinate.theta := theta
end;
NOTE | Month and year in Example 1) are eld-designator-identiers, width and height in Example 2)
are schema-discriminant-identiers, and r and theta in Example 3) are constant-eld-identiers.
6.9.4 Threats
A statement S shall be designated as threatening a variable-access V if one or more of the following
statements is true.
a) S is an assignment-statement and V is in S.
108
ISO/IEC 10206:1990(E)
109
ISO/IEC 10206:1990(E)
110
ISO/IEC 10206:1990(E)
remaining execution of the statement shall cause a value to be attributed to v. That value shall
be the value of the xed-string-type whose components in order of increasing index consist of the
components of s, in order, followed by zero or more spaces. If c exceeds length(s~t), length(t) shall
equal 0; otherwise, length(s) shall equal c.
NOTE | 6 If eoln(f) is initially true, then no characters are read, and the value of each component of v is
a space.
f) If v is a variable-access possessing a variable-string-type of capacity c, read(f,v) shall satisfy the
following requirements. Length(r) shall equal 0, no component of s shall equal end-of-line, and the
remaining execution of the statement shall cause a value to be attributed to v. That value shall be
the value of the variable-string-type whose components in order of increasing index consist of the
components of s, in order. If c exceeds length(s~t), length(t) shall equal 0; otherwise, length(s) shall
equal c.
NOTE | 7 If eoln(f) is initially true, then no characters are read, and the value of v is the null-string.
111
ISO/IEC 10206:1990(E)
NOTE | Because the denition of write includes the use of put, the implementation-dened aspects of
the post-assertion of put also apply (see 6.7.5.2).
6.10.3.1 Write-parameters
A write-parameter shall have one of the following forms
e : TotalWidth : FracDigits
e : TotalWidth
e
where e shall be an expression whose value is to be written on the le f and shall be of integer-type,
real-type, char-type, Boolean-type, or a string-type, and where TotalWidth and FracDigits shall be
expressions of integer-type whose values shall be designated the eld-width parameters. The value
of TotalWidth shall be greater than or equal to zero; it shall be an error if the value is less than
zero. The value of FracDigits shall be greater than or equal to zero; it shall be an error if the value
is less than zero.
Write(f,e) shall be equivalent to the form write(f,e : TotalWidth), using a default value for TotalWidth
that depends on the type of e; for integer-type, real-type, and Boolean-type, the default values shall
be implementation-dened.
Write(f,e : TotalWidth : FracDigits) shall be applicable only if e is of real-type (see 6.10.3.4.2).
112
ISO/IEC 10206:1990(E)
6.10.3.2 Char-type
If e is of char-type, the default value of TotalWidth shall be one. The representation written on the
le f shall be
if TotalWidth > 0,
(TotalWidth ; 1) spaces, the character value of e;
if TotalWidth=0,
no characters.
6.10.3.3 Integer-type
If e is of integer-type, the decimal representation of the value of e shall be written on the le f.
Assume a function
function IntegerSize ( x : integer ) : integer ;
f returns the number of digits, z, such that
10 pow (z;1) abs(x) < 10 pow z g
and let IntDigits be the positive integer dened by
if e = 0
then IntDigits := 1
else IntDigits := IntegerSize(e);
then the representation shall consist of
a) if TotalWidth >= IntDigits + 1:
(TotalWidth ; IntDigits ; 1) spaces,
the sign character: `-' if e < 0, otherwise a space,
IntDigits digit-characters of the decimal representation of abs(e).
b) if TotalWidth < IntDigits + 1:
if e < 0 the sign character `;',
IntDigits digit-characters of the decimal representation of abs(e).
6.10.3.4 Real-type
If e is of real-type, a decimal representation of the value of e, rounded to the specied number of
signicant gures or decimal places, shall be written on the le f.
114
ISO/IEC 10206:1990(E)
NOTE | At least MinNumChars characters are written. If TotalWidth is less than this value, no initial
spaces are written.
6.10.3.5 Boolean-type
If e is of Boolean-type, a representation of the word true or the word false (as appropriate to the
value of e) shall be written on the le f. This shall be equivalent to writing the appropriate character-
string 'True' or 'False' (see 6.10.3.6), where the case of each letter is implementation-dened, with
a eld-width parameter of TotalWidth.
115
ISO/IEC 10206:1990(E)
6.10.3.6 String-types
If the value of e is a string-type value with a length of n, the default value of TotalWidth shall be
n. The representation shall consist of
if TotalWidth > n,
(TotalWidth ; n) spaces,
if n > 0,
the rst through n-th characters of the value of e in that order.
if 1 <= TotalWidth <= n,
the rst through TotalWidth-th characters in that order.
if TotalWidth = 0,
no characters.
116
ISO/IEC 10206:1990(E)
and shall cause the buer-variable f"to become totally-undened. The eect of inspecting a textle
to which the page procedure was applied during generation shall be implementation-dependent.
6.11 Modules
6.11.1 Module-declarations
module-declaration = module-heading [ `;' module-block ]
j module-identication `;' module-block .
module-heading = `module' identier [ interface-directive ]
[ `(' module-parameter-list `)' ] `;'
interface-specication-part
import-part
f constant-denition-part
j type-denition-part
j variable-declaration-part
j procedure-and-function-heading-part g
`end' .
module-parameter-list = identier-list .
procedure-and-function-heading-part = ( procedure-heading j function-heading ) `;' .
module-identication = `module' module-identier implementation-directive .
module-identier = identier .
module-block = import-part
f constant-denition-part
j type-denition-part
j variable-declaration-part
j procedure-and-function-declaration-part g
[ initialization-part ]
[ nalization-part ]
`end' .
initialization-part = `to' `begin' `do' statement `;' .
nalization-part = `to' `end' `do' statement `;' .
The occurrence of an identier in the module-heading of a module-declaration shall constitute
its dening-point as a module-identier for each region that is either the identier of a module-
heading contained by the program or the module-identier of a module-identication contained by
the program.
NOTE | 1 The module-identier has meaning only in places where a module-identier is either dened or
referenced. A module-identier does not otherwise aect the program.
117
ISO/IEC 10206:1990(E)
118
ISO/IEC 10206:1990(E)
6 Variables that are module-parameters are not necessarily bound when the module is activated.
6.11.2 Export-part
An export-part shall introduce an identier to denote an interface. An export-list shall introduce
one or more constituent-identiers.
interface-specication-part = `export' export-part `;' f export-part `;' g .
export-part = identier `=' `(' export-list `)' .
export-list = ( export-clause j export-range ) f `,' ( export-clause j export-range ) g .
export-clause = exportable-name j export-renaming-clause .
export-renaming-clause = exportable-name `=>' identier .
exportable-name = constant-name
j type-name
j schema-name
j [ `protected' ] variable-name
j procedure-name
j function-name .
export-range = rst-constant-name `..' last-constant-name .
rst-constant-name = constant-name .
last-constant-name = constant-name .
constituent-identier = identier .
interface-identier = identier .
The occurrence of an identier in an export-part shall constitute its dening-point as an interface-
identier for each region that is either the identier of an export-part contained by the program-block
or the interface-identier of an import-specication contained by the program-block.
The occurrence of an exportable-name in an export-clause shall constitute the dening-point of the
identier of the constant-identier, type-identier, schema-identier, variable-identier, procedure-
identier, or function-identier contained by the exportable-name as a constituent-identier for the
region that is the interface denoted by the identier of the export-part that contains the export-clause.
The occurrence of an identier in an export-renaming-clause of an export-clause shall constitute the
dening-point of that identier as a constituent-identier for the region that is the interface denoted
by the identier of the export-part that contains the export-clause.
A constituent-identier so dened shall denote: the value denoted by the constant-name; the type,
bindability, and initial state denoted by the type-name; the schema denoted by the schema-name;
the variable denoted by the variable-name; the procedure denoted by the procedure-name; or the
function denoted by the function-name; that is contained by the export-clause. That constituent-
119
ISO/IEC 10206:1990(E)
identier shall be designated protected (see 6.5.1) if the export-clause contains either protected or
a protected variable-identier. The type possessed by a protected constituent-identier shall be
protectable. The constituent-identier shall be designated a module-parameter if and only if the
export-clause contains a variable-identier that is a module-parameter. If the constituent-identier
denotes a value, it shall be designated a principal identier (see 6.4.2.3) of that value if the constant-
identier contained by the export-clause is a principal identier of the value and the export-clause
does not contain an export-renaming-clause.
NOTE | 1 A principal identier of a value is exported as a principal identier only if it is not renamed.
Renaming a principal identier exports a new identier for the value, but the new identier is not a principal
identier.
The constant-names of the rst-constant-name and of the last-constant-name of an export-range
shall denote values of the same type, which shall be an enumerated-type; these values and type
shall be designated the least-value, greatest-value, and type of the export-range, respectively. The
least-value shall not exceed the greatest-value.
For each value of the type of an export-range not smaller than the least-value of the export-range
and not larger than the greatest-value of the export-range
a) the export-range shall be within the scope of a dening-point of an identier that is a principal
identier of the value;
b) the occurrence of the export-range shall constitute the dening-point of that identier as a
constituent-identier for the region that is the interface denoted by the identier of the export-
part that contains the export-range; and
c) the constituent-identier so dened shall denote that value and shall be designated a principal
identier of that value.
NOTES
2 Only the identiers specied in an export-list are exported. In particular, the constant-identiers of an
enumerated-type are not exported by exporting the type-identier.
3 Although the eld-identiers of a record-type cannot be exported, they are available in any block that can
access a variable, constant, or function result possessing the record-type.
4 Although the discriminant-identiers of a schema cannot be exported, they are available in any block that
can access a variable or constant possessing a type produced from the schema.
5 Protected variable-names excepted, a constant-name, type-name, schema-name, variable-name, procedure-
name, or function-name that is passed through an interface by a constituent-identier behaves the same as a
constant-name, type-name, schema-name, variable-name, procedure-name, or function-name that does not
pass through an interface.
6 An export-range serves to export only the principal identiers of the values within the specied range;
it is essentially a shorthand notation for listing the principal identiers for each value. The names that
are specied in the export-range serve only to denote the least and greatest values and are not themselves
exported unless they happen to be the principal identiers of those values.
The required interface-identiers and required constituent-identiers shall be as specied in 6.11.4.2.
120
ISO/IEC 10206:1990(E)
121
ISO/IEC 10206:1990(E)
denotes the value; a type-identier that denotes the type, bindability, and initial state; a schema-
identier that denotes the schema; a variable-identier that denotes the variable; a procedure-
identier that denotes the procedure; or a function-identier that denotes the function; denoted by
the constituent-identier. An imported variable-identier corresponding to a protected constituent-
identier shall be designated protected. An imported variable-identier shall be designated a module-
parameter if and only if it corresponds to a constituent-identier that is a module-parameter.
The occurrence of an interface-identier in an import-specication shall constitute the dening-point
of the identier of the interface-identier as an imported-interface-identier for the region that is the
block, module-heading, or module-block closest-containing the import-specication. Each imported
identier in the set of imported identiers determined by the import-specication shall be said to
be associated with that imported-interface-identier.
Each dening-point of an imported identier occurring within an import-specication shall be for
the region that is the import-specication, and, if an access-qualier does not occur in the import-
specication, also for the region that is the module-heading, module-block, or block closest-containing
the import-specication.
NOTE | 2 If the access-qualier qualied does occur in the import-specication, then imported identiers
can only be referred to within the module-heading, module-block, or containing block by their full name,
which includes the interface-identier.
122
ISO/IEC 10206:1990(E)
const
p1 = 30269; m1 = 171;
p2 = 30307; m2 = 172;
p3 = 30323; m3 = 170;
type
seedtype = record
s1: 1..p1-1;
s2: 1..p2-1;
s3: 1..p3-1
end;
const
seedmin = seedtype[s1,s2,s3:1];
seedmax = seedtype[s1:p1-1; s2:p2-1; s3:p3-1];
seedinit = seedtype[s1:1; s2:10000; s3:3000];
procedure
123
ISO/IEC 10206:1990(E)
setseed (s:seedtype);
procedure
getseed (var s:seedtype);
function
random: real;
procedure setseed;
begin
seed := s
end;
procedure getseed;
begin
s := seed
end;
function random;
var
x1,x2,x3: integer;
temp: real;
begin
with seed do
begin
f first generator g
x1 := m1*(s1 mod 177) - 2*(s1 div 177);
if x1<0 then x1 := x1+p1;
f second generator g
x2 := m2*(s2 mod 176) - 35*(s2 div 176);
if x2<0 then x2 := x2+p2;
f third generator g
x3 := m3*(s3 mod 178) - 63*(s3 div 178);
if x3<0 then x3 := x3+p3;
f form new seed and function resultg
seed := seedtype[s1:x1; s2:x2; s3:x3];
temp := s1/p1 + s2/p2 + s3/p3;
random := temp-trunc(temp)
124
ISO/IEC 10206:1990(E)
end
end; f of random g
end. f of RandomUniform block g
module RandomUniform implementation;
f An alternative implementation of RandomUniform that assumes
maxint >= largestof((p1-1)*m1,(p2-1)*m2,(p3-1)*m3) (= 5212632)
by using larger integers, this will run faster on many machines
g
var
seed: seedtype value seedinit;
procedure setseed;
begin
seed := s
end;
procedure getseed;
begin
s := seed
end;
function random;
var
temp: real;
begin
with seed do
begin
f form new seed g
s1 := (m1*s1) mod p1; f
first generator g
s2 := (m2*s2) mod p2; f
second generator g
s3 := (m3*s3) mod p3; f
third generator g
f form function result g
temp := s1/p1 + s2/p2 + s3/p3;
random := temp-trunc(temp)
end
end; f
of random g
end. f of RandomUniform block g
125
ISO/IEC 10206:1990(E)
Example 1:
module m1;
f m1 exports one interface named i1, containing two values named low and high.
The variable null is not exported. m1 has a minimal module-block. g
export i1 = (low,high);
Example 2:
module m2;
f m2 exports two interfaces named i2 and j2. i2 contains a type called t; j2
contains the two values (still named low and high) imported from m1 through
interface i1. m2 also has a minimal module-block. g
export
i2 = (t); f
define i2 to have t as its only constituent-identifiers. g
j2 = (low,high); f
re-export low and high in j2. They are
imported through interface i1.g
import
i1; f
import all constituent-identifiers of i1g
type t = low..high;
Example 3:
module m3;
126
ISO/IEC 10206:1990(E)
f m3 exports one interface containing a function, a type, and two values. The
function-heading is declared in the module-heading, and the function-block is
declared in the module-block. g
export
i3 = (f, i2.f range, i1.low=>f low, i1.high=>f high);
f
Export constituent-identifiers f, f range, f low, and
f high. g
import
i1 qualified; f
Import all constituent-identifiers from i1. Within this
module they are named i1.low and i1.high. g
i2 qualified only (t=>f range);
f
Import only t through i2. Within this
module it is named i2.f range. g
function f(x: integer): i2.f range;
function f;
begin
if x < i1.low then f := i1.low
else if x > i1.high then f := i1.high
else f := x
end f
f g
;
Example 4:
module m4 interface;
f m4 exports two interfaces named enq and deq. enq contains a
procedure named enqueue. deq contains a procedure called dequeue, a
function called empty, and a type called range. The module-block is given
separately in example 5. g
export enq = (enqueue); deq = (dequeue,empty,range);
127
ISO/IEC 10206:1990(E)
Example 5:
module m4 implementation;
f This is the module-block of m4. Note that any other program-components could
be placed between examples 4 and 5. All identifiers and interfaces that are
visible in the module-heading 4 are also visible here. g
type
qp = "
qnode;
qnode = record next: qp; c: range end;
var
oldest: qp value nil; f initialize queue to empty g
newest: qp;
function empty;
begin empty := (oldest = nil) end f empty g ;
procedure enqueue;
begin
if empty then
begin new(newest); oldest := newest end
else
"
begin new(newest .next); newest := newest .next end; "
"
newest .c := e
end f
enqueue ; g
procedure dequeue;
var p: qp;
begin
if empty then halt;
"
e := oldest .c; p := oldest;
if oldest = newest then oldest := nil
"
else oldest := oldest .next;
dispose(p)
end f
dequeue ; g
128
ISO/IEC 10206:1990(E)
NOTE | 2 Each of examples 7 to 9 depends on one or more of examples 6 to 8 that precede it.
Example 6:
f the export of current pass and swap occurred during sort allows the g
f caller of the sort procedure to determine the status of the sort g
f --- they are marked as protected so that the caller is not g
f allowed write access g
f current pass is renamed to number of passes as it is exported g
type max sort index = 1..maxint;
end.
Example 7:
129
ISO/IEC 10206:1990(E)
repeat
swap occurred this pass := false;
current pass := current pass + 1;
for n := 1 to element count - 1 do
if greater(n,n + 1) then begin
swap(n,n + 1);
swap occurred this pass := true;
end;
swap occurred during sort := swap occurred during sort or
swap occurred this pass;
until not swap occurred this pass;
end;
end.
Example 8:
type
employee = record
last name,first name : string(30);
clock number : 1..maxint;
end;
end.
Example 9:
130
ISO/IEC 10206:1990(E)
begin
temp := employees[e1];
employees[e2] := employees[e1];
employees[e1] := temp;
end;
begin
name is greater := (employees[e1].last name > employees[e2].last name)
or ( (employees[e1].last name = employees[e2].last name) and
(employees[e1].first name > employees[e2].first name));
end;
begin f
sort by name g
do the sort(employees.num employees,name is greater,swap employees );
something done := swap occurred during sort;
end; f sort by nameg
procedure sort by clock number;
begin
temp := employees[e1];
employees[e2] := employees[e1];
employees[e1] := temp;
end;
begin
clock is greater := employees[e1].clock number >
employees[e2].clock number;
131
ISO/IEC 10206:1990(E)
end;
begin f
sort by clock number g
do the sort(employees.num employees,clock is greater,swap employees );
something done := swap occurred during sort;
end; f
sort by clock number g
end.
Example 10:
end;
var
logfile : bindable text;
logbind : BindingType;
begin
GetTimeStamp(stamp);
writeln(logfile,'event ',event to record,' occurred on ',
date(stamp),' at ',time(stamp));
end;
132
ISO/IEC 10206:1990(E)
logbind.name := 'logfile';
bind(logfile,logbind);
rewrite(logfile);
record event('event-module initialization');
end;
to end do
begin
record event('event-module termination');
unbind(logfile);
end;
end.
export
line states = (line state, onhook..permanent sequence,
first state, last state, initial state);
f
'onhook..permanent sequence' exports each value name
defined in the type definition. g
type
line state = (onhook, offhook, tone applied,
ringing applied, two way talk, out of service,
permanent sequence);
const
first state = onhook;
last state = permanent sequence;
initial state = out of service;
end.
export
standard line interface = (first state..last state,
first state, last state, initial state, set state,
current state);
f'first state..last state' exports 'onhook' through
'permanent sequence', but not 'first state' and
'last state'; 'first state, last state' exports
'first state' and 'last state'. g
133
ISO/IEC 10206:1990(E)
import
line states;
end.
6.12 Main-program-declarations
main-program-declaration = program-heading `;' main-program-block .
program-heading = `program' identier [ `(' program-parameter-list `)' ] .
program-parameter-list = identier-list .
main-program-block = block .
The identiers contained by the program-parameter-list of a program-heading of a main-program-
declaration shall have distinct spellings, and for each such identier there shall be a dening-point
as a variable-identier with the same spelling for the region that is the block of the main-program-
block of the main-program-declaration. If the spelling is neither input nor output, the variable-
identier either shall be local to the block or shall be an imported variable-identier that is a
module-parameter. If the spelling is input or output, the occurrence of the identier contained
by the program-parameter-list shall constitute a dening-point for the region that is the block of
the main-program-block as a variable-identier denoting the required textle input or output,
respectively. If the variable-identier is local to the block or has the spelling input or output,
both the variable-identier and any variable it denotes shall be designated a program-parameter.
The binding of a variable that is a program-parameter to entities external to the program shall be
implementation-dened.
NOTES
1 The external representation of such external entities is not dened by this International Standard.
2 Variables that are program-parameters are not necessarily bound when the program is activated.
3 See 6.11.4.2 regarding reset, rewrite, and extend for the required textles input and output.
Examples:
1) program copy (f, g);
var f, g : file of real;
begin
reset(f);
rewrite(g);
while not eof(f) do
begin
"
g := f ; "
134
ISO/IEC 10206:1990(E)
get(f);
put(g)
end
end.
procedure dummy;
begin
writeln('fail4')
end f
of dummy ; g
procedure p (procedure f(procedure ff; procedure gg); procedure g);
var localtop : integer;
procedure r;
begin r fg
if globalone = 1
then begin
if (globaltwo <> 2) or (localtop <> 1)
then writeln('fail1')
end
else if globalone = 2
then begin
if (globaltwo <> 2) or (localtop <> 2)
then writeln('fail2')
else writeln('pass')
end
135
ISO/IEC 10206:1990(E)
else writeln('fail3');
globalone := globalone + 1
end f
of r ; g
begin f
of p g
globaltwo := globaltwo + 1;
localtop := globaltwo;
if globaltwo = 1
then p(f, r)
else f(g, r)
end f
of p ; g
procedure q (procedure f; procedure g);
begin
f;
g
end f
of q ; g
begin f
of t6p6p3p4 g
globalone := 1;
globaltwo := 0;
p(q, dummy)
end. f
of t6p6p3p4 g
4) program clear my screens;
type
positive = 1..maxint;
var
136
ISO/IEC 10206:1990(E)
begin
for n := 0 to scr.max rows - 1 do
for m := 0 to scr.max cols - 1 do
scr[n,m] := [];
end;
begin f
main program g
clear screen(medium res mono);
clear screen(highres mono);
clear screen(lowres color);
clear screen(super highres technicolor);
end. f main program g
6.13 Programs
program = program-block .
program-block = program-component f program-component g .
program-component = main-program-declaration `.' j module-declaration `.' .
A program-block shall contain exactly one main-program-declaration.
A processor should be able to accept the program-components of the program-block separately.
NOTES
1 This International Standard constrains the order of program-components of a conforming program only
by the partial ordering dened by 6.2.2.9. A further restriction by a processor on the order of program-
components can be justied only by subclause 1.2 a).
2 This International Standard does not contain mechanisms for interfacing with other languages. If such
a facility is implemented as an extension, it is recommended that a processor enforce the requirements of
Extended Pascal pertaining to type compatibility. This facility could be provided in one of the following
ways.
a) The use of module-parameters and program-parameters to denote variables, procedures, and other
entities that the processor can handle. This would require some extensions, e.g., that a procedure not
contain a block if it is a module-parameter or program-parameter.
b) The extension of import-specication for the same purpose.
c) The importation of a Pascal-compatible interface that has been created by an auxiliary processor.
d) The association of a module-heading with a construct in another language that the implementation
has determined to be equivalent to a module-block.
137
ISO/IEC 10206:1990(E)
Annex A
(Informative)
Collected syntax
A.1 Production rules
The nonterminal symbols number, pointer-type, program, simple-type, simple-type-name, special-
symbol, and structured-type are only referenced by the semantics and are not used in the right-hand
side of any production. The nonterminal symbol program is the start of the grammar. The subclause
of denition appears at the left of each production.
6.11.3 access-qualier = `qualied' .
6.4.8 actual-discriminant-part = `(' discriminant-value f `,' discriminant-value g `)' .
6.8.5 actual-parameter = expression j variable-access
j procedure-name j function-name .
6.8.5 actual-parameter-list = `(' actual-parameter f `,' actual-parameter g `)' .
6.8.3.1 adding-operator = `+' j `;' j `><' j `or' j `or else' .
6.1.9 apostrophe-image = `"' .
6.8.8.2 array-constant = constant-access .
6.8.6.2 array-function = function-access .
6.4.3.2 array-type = `array' `[' index-type f `,' index-type g `]' `of' component-type .
6.4.1 array-type-name = type-name .
6.8.7.2 array-value = `[' [ array-value-element f `;' array-value-element g [ `;' ] ]
[ array-value-completer [ `;' ] ] `]' .
6.8.7.2 array-value-completer = `otherwise' component-value .
6.8.7.2 array-value-element = case-constant-list `:' component-value .
6.5.3.2 array-variable = variable-access .
6.9.2.2 assignment-statement = ( variable-access j function-identier ) `:=' expression .
6.4.3.5 base-type = ordinal-type .
138
ISO/IEC 10206:1990(E)
139
ISO/IEC 10206:1990(E)
140
ISO/IEC 10206:1990(E)
141
ISO/IEC 10206:1990(E)
142
ISO/IEC 10206:1990(E)
143
ISO/IEC 10206:1990(E)
144
ISO/IEC 10206:1990(E)
145
ISO/IEC 10206:1990(E)
146
ISO/IEC 10206:1990(E)
147
ISO/IEC 10206:1990(E)
6.1.2 special-symbol = `+' j `;' j `*' j `/' j `=' j `<' j `>' j `[' j `]'
j `.' j `,' j `:' j `;' j `"' j `(' j `)' j `**'
j `<>' j `<=' j `>=' j `:=' j `..' j `><' j `=>'
j word-symbol .
6.9.1 statement = [ label `:' ] ( simple-statement j structured-statement ) .
6.2.1 statement-part = compound-statement .
6.9.3.1 statement-sequence = statement f `;' statement g .
6.1.9 string-character = one-of-a-set-of-implementation-dened-characters .
6.8.8.2 string-constant = constant-access .
6.1.9 string-element = apostrophe-image j string-character .
6.7.5.5 string-expression = expression .
6.8.6.2 string-function = function-access .
6.5.3.2 string-variable = variable-access .
6.9.3.1 structured-statement = compound-statement j conditional-statement
j repetitive-statement j with-statement .
6.4.3.1 structured-type = new-structured-type j structured-type-name .
6.4.1 structured-type-name = array-type-name
j record-type-name
j set-type-name
j le-type-name .
6.8.7.1 structured-value-constructor = array-type-name array-value
j record-type-name record-value
j set-type-name set-value .
6.4.2.4 subrange-bound = expression .
6.4.2.4 subrange-type = subrange-bound `..' subrange-bound .
6.8.8.4 substring-constant = string-constant `[' index-expression `..' index-expression `]' .
6.8.6.5 substring-function-access = string-function `[' index-expression `..' index-expression `]' .
6.5.6 substring-variable = string-variable `[' index-expression `..' index-expression `]' .
6.4.3.4 tag-eld = identier .
6.8.7.3 tag-eld-identier = eld-identier .
6.4.3.4 tag-type = ordinal-type-name .
148
ISO/IEC 10206:1990(E)
149
ISO/IEC 10206:1990(E)
150
ISO/IEC 10206:1990(E)
151
ISO/IEC 10206:1990(E)
sign
special-symbol
"," ................................... actual-discriminant-part
actual-parameter-list
array-type
case-constant-list
export-list
field-value
identifier-list
import-list
indexed-constant
indexed-function-access
indexed-variable
label-declaration-part
read-parameter-list
readln-parameter-list
readstr-parameter-list
set-constructor
special-symbol
with-list
write-parameter-list
writeln-parameter-list
writestr-parameter-list
"-" ................................... adding-operator
sign
special-symbol
"." ................................... constant-name
field-designated-constant
field-designator
function-name
number
procedure-name
program-component
record-function-access
schema-discriminant
schema-name
special-symbol
type-name
unsigned-real
variable-name
".." .................................. case-range
export-range
index-type-specification
member-designator
special-symbol
subrange-type
152
ISO/IEC 10206:1990(E)
substring-constant
substring-function-access
substring-variable
"/" ................................... multiplying-operator
special-symbol
"0" ................................... digit
"1" ................................... digit
"2" ................................... digit
"3" ................................... digit
"4" ................................... digit
"5" ................................... digit
"6" ................................... digit
"7" ................................... digit
"8" ................................... digit
"9" ................................... digit
":" ................................... array-value-element
case-list-element
discriminant-specification
field-value
function-heading
index-type-specification
record-section
special-symbol
statement
value-conformant-array-specification
value-parameter-specification
variable-conformant-array-specification
variable-declaration
variable-parameter-specification
variant-list-element
variant-part-value
variant-selector
write-parameter
":=" .................................. assignment-statement
sequence-iteration
special-symbol
";" ................................... array-value
case-statement
constant-definition-part
field-list
field-list-value
finalization-part
fixed-part
fixed-part-value
formal-discriminant-part
formal-parameter-list
153
ISO/IEC 10206:1990(E)
function-declaration
import-part
initialization-part
interface-specification-part
label-declaration-part
main-program-declaration
module-declaration
module-heading
procedure-and-function-declaration-part
procedure-and-function-heading-part
procedure-declaration
special-symbol
statement-sequence
type-definition-part
unpacked-conformant-array-form
variable-declaration-part
variant-part
<
" " ................................... relational-operator
special-symbol
<
" =" .................................. relational-operator
special-symbol
"<> " .................................. relational-operator
special-symbol
"=" ................................... constant-definition
export-part
relational-operator
result-variable-specification
schema-definition
special-symbol
type-definition
>
"= " .................................. export-renaming-clause
import-renaming-clause
special-symbol
>
" " ................................... relational-operator
special-symbol
">< " .................................. adding-operator
special-symbol
>
" =" .................................. relational-operator
special-symbol
"[" ................................... array-type
array-value
file-type
indexed-constant
indexed-function-access
indexed-variable
packed-conformant-array-form
154
ISO/IEC 10206:1990(E)
record-value
set-constructor
special-symbol
substring-constant
substring-function-access
substring-variable
unpacked-conformant-array-form
variant-part-value
"]" ................................... array-type
array-value
file-type
indexed-constant
indexed-function-access
indexed-variable
packed-conformant-array-form
record-value
set-constructor
special-symbol
substring-constant
substring-function-access
substring-variable
unpacked-conformant-array-form
variant-part-value
"
" " ................................... buffer-variable
function-identified-variable
identified-variable
new-pointer-type
special-symbol
" " ................................... underscore
"a" ................................... letter
"and" ................................. multiplying-operator
word-symbol
"and then" ............................ multiplying-operator
word-symbol
"array" ............................... array-type
packed-conformant-array-form
unpacked-conformant-array-form
word-symbol
"b" ................................... letter
"begin" ............................... compound-statement
initialization-part
word-symbol
"bindable" ............................ type-denoter
word-symbol
"c" ................................... letter
"case" ................................ case-statement
155
ISO/IEC 10206:1990(E)
variant-part
variant-part-value
word-symbol
"const" ............................... constant-definition-part
word-symbol
"d" ................................... letter
"div" ................................. multiplying-operator
word-symbol
"do" .................................. finalization-part
for-statement
initialization-part
while-statement
with-statement
word-symbol
"downto" .............................. sequence-iteration
word-symbol
"e" ................................... letter
number
unsigned-real
"else" ................................ else-part
word-symbol
"end" ................................. case-statement
compound-statement
finalization-part
module-block
module-heading
record-type
word-symbol
"export" .............................. interface-specification-part
word-symbol
"f" ................................... letter
"file" ................................ file-type
word-symbol
"for" ................................. for-statement
word-symbol
"function" ............................ function-heading
function-identification
word-symbol
"g" ................................... letter
"goto" ................................ goto-statement
word-symbol
"h" ................................... letter
"i" ................................... letter
"if" .................................. if-statement
word-symbol
"import" .............................. import-part
156
ISO/IEC 10206:1990(E)
word-symbol
"in" .................................. relational-operator
set-member-iteration
word-symbol
"j" ................................... letter
"k" ................................... letter
"l" ................................... letter
"label" ............................... label-declaration-part
word-symbol
"m" ................................... letter
"mod" ................................. multiplying-operator
word-symbol
"module" .............................. module-heading
module-identification
word-symbol
"n" ................................... letter
"nil" ................................. unsigned-constant
word-symbol
"not" ................................. primary
word-symbol
"o" ................................... letter
"of" .................................. array-type
case-statement
file-type
packed-conformant-array-form
set-type
type-inquiry
unpacked-conformant-array-form
variant-part
variant-part-value
word-symbol
"only" ................................ selective-import-option
word-symbol
"or" .................................. adding-operator
word-symbol
"or else" ............................. adding-operator
word-symbol
"otherwise" ........................... array-value-completer
case-statement-completer
variant-part-completer
word-symbol
"p" ................................... letter
"packed" .............................. new-structured-type
packed-conformant-array-form
word-symbol
"pow" ................................. exponentiating-operator
157
ISO/IEC 10206:1990(E)
word-symbol
"procedure" ........................... procedure-heading
procedure-identification
word-symbol
"program" ............................. program-heading
word-symbol
"protected" ........................... conformant-array-parameter-specification
exportable-name
value-parameter-specification
variable-parameter-specification
word-symbol
"q" ................................... letter
"qualified" ........................... access-qualifier
word-symbol
"r" ................................... letter
"record" .............................. record-type
word-symbol
"repeat" .............................. repeat-statement
word-symbol
"restricted" .......................... restricted-type
word-symbol
"s" ................................... letter
"set" ................................. set-type
word-symbol
"t" ................................... letter
"then" ................................ if-statement
word-symbol
"to" .................................. finalization-part
initialization-part
sequence-iteration
word-symbol
"type" ................................ type-definition-part
type-inquiry
word-symbol
"u" ................................... letter
"until" ............................... repeat-statement
word-symbol
"v" ................................... letter
"value" ............................... initial-state-specifier
word-symbol
"var" ................................. variable-conformant-array-specification
variable-declaration-part
variable-parameter-specification
word-symbol
"w" ................................... letter
"while" ............................... while-statement
158
ISO/IEC 10206:1990(E)
word-symbol
"with" ................................ with-statement
word-symbol
"x" ................................... letter
"y" ................................... letter
"z" ................................... letter
159
ISO/IEC 10206:1990(E)
{b{
base-type ............................ set-type
block ................................ function-block
main-program-block
procedure-block
Boolean-expression ................... if-statement
repeat-statement
while-statement
bound-identifier ..................... primary
buffer-variable ...................... variable-access
{c{
case-constant ........................ case-range
case-constant-list ................... array-value-element
case-list-element
variant-list-element
case-index ........................... case-statement
case-list-element .................... case-statement
160
ISO/IEC 10206:1990(E)
161
ISO/IEC 10206:1990(E)
{d{
digit ................................ digit-sequence
directive
extended-digit
identifier
digit-sequence ....................... fractional-part
label
number
scale-factor
unsigned-integer
unsigned-real
directive ............................ implementation-directive
interface-directive
remote-directive
discriminant-identifier .............. discriminant-specifier
primary
variant-selector
discriminant-specification ........... formal-discriminant-part
discriminant-specifier ............... schema-discriminant
discriminant-value ................... actual-discriminant-part
discriminated-schema ................. ordinal-type
type-denoter
domain-type .......................... new-pointer-type
{e{
else-part ............................ if-statement
empty-statement ...................... simple-statement
entire-function-access ............... function-access
entire-variable ...................... control-variable
variable-access
enumerated-type ...................... new-ordinal-type
exponentiating-operator .............. factor
export-clause ........................ export-list
export-list .......................... export-part
export-part .......................... interface-specification-part
export-range ......................... export-list
export-renaming-clause ............... export-clause
exportable-name ...................... export-clause
export-renaming-clause
expression ........................... actual-parameter
assignment-statement
Boolean-expression
162
ISO/IEC 10206:1990(E)
case-index
component-value
constant-expression
discriminant-value
final-value
index-expression
initial-value
member-designator
primary
set-expression
string-expression
subrange-bound
write-parameter
extended-digit ....................... extended-number
extended-number ...................... unsigned-constant
{f{
factor ............................... term
field-designated-constant ............ constant-access-component
field-designator ..................... component-variable
field-designator-identifier .......... field-designator
field-identifier ..................... field-specifier
field-value
tag-field-identifier
field-list ........................... record-type
variant-denoter
field-list-value ..................... record-value
variant-part-value
field-specifier ...................... field-designated-constant
field-designator
record-function-access
field-value .......................... fixed-part-value
file-type ............................ unpacked-structured-type
file-type-name ....................... structured-type-name
file-variable ........................ buffer-variable
read-parameter-list
readln-parameter-list
write-parameter-list
writeln-parameter-list
final-value .......................... sequence-iteration
finalization-part .................... module-block
first-constant-name .................. export-range
fixed-part ........................... field-list
fixed-part-value ..................... field-list-value
163
ISO/IEC 10206:1990(E)
{g{
goto-statement ....................... simple-statement
{i{
identified-variable .................. variable-access
identifier ........................... bound-identifier
constant-definition
constant-field-identifier
constant-identifier
constituent-identifier
discriminant-identifier
export-part
export-renaming-clause
164
ISO/IEC 10206:1990(E)
field-designator-identifier
field-identifier
function-heading
function-identifier
identifier-list
import-renaming-clause
imported-interface-identifier
index-type-specification
interface-identifier
module-heading
module-identifier
parameter-identifier
procedure-heading
procedure-identifier
program-heading
result-variable-specification
schema-definition
schema-discriminant-identifier
schema-identifier
tag-field
type-definition
type-identifier
variable-identifier
identifier-list ...................... discriminant-specification
enumerated-type
module-parameter-list
program-parameter-list
record-section
value-conformant-array-specification
value-parameter-specification
variable-conformant-array-specification
variable-declaration
variable-parameter-specification
if-statement ......................... conditional-statement
implementation-directive ............. module-identification
import-clause ........................ import-list
import-list .......................... import-qualifier
import-part .......................... block
module-block
module-heading
import-qualifier ..................... import-specification
import-renaming-clause ............... import-clause
import-specification ................. import-part
imported-interface-identifier ........ constant-name
function-name
procedure-name
165
ISO/IEC 10206:1990(E)
schema-name
type-name
variable-name
index-expression ..................... indexed-constant
indexed-function-access
indexed-variable
substring-constant
substring-function-access
substring-variable
index-type ........................... array-type
file-type
index-type-specification ............. packed-conformant-array-form
unpacked-conformant-array-form
indexed-constant ..................... constant-access-component
indexed-function-access .............. component-function-access
indexed-variable ..................... component-variable
initial-state-specifier .............. type-denoter
initial-value ........................ sequence-iteration
initialization-part .................. module-block
interface-directive .................. module-heading
interface-identifier ................. import-specification
interface-specification-part ......... module-heading
iteration-clause ..................... for-statement
{l{
label ................................ goto-statement
label-declaration-part
statement
label-declaration-part ............... block
last-constant-name ................... export-range
letter ............................... directive
extended-digit
identifier
{m{
main-program-block ................... main-program-declaration
main-program-declaration ............. program-component
member-designator .................... set-constructor
module-block ......................... module-declaration
module-declaration ................... program-component
module-heading ....................... module-declaration
module-identification ................ module-declaration
166
ISO/IEC 10206:1990(E)
{n{
new-ordinal-type ..................... new-type
ordinal-type
new-pointer-type ..................... new-type
pointer-type
new-structured-type .................. new-type
structured-type
new-type ............................. type-denoter
{o{
one-of-a-set-of-implementation-defined-characters ...
string-character
ordinal-type ......................... base-type
index-type
simple-type
ordinal-type-name .................... discriminant-specification
index-type-specification
ordinal-type
tag-type
{p{
packed-conformant-array-form ......... conformant-array-form
parameter-form ....................... value-parameter-specification
variable-parameter-specification
parameter-identifier ................. type-inquiry-object
pointer-function ..................... function-identified-variable
pointer-type-name .................... pointer-type
pointer-variable ..................... identified-variable
primary .............................. factor
primary
procedural-parameter-specification ... formal-parameter-section
procedure-and-function-declaration-part block
module-block
procedure-and-function-heading-part ... module-heading
procedure-block ...................... procedure-declaration
procedure-declaration ................ procedure-and-function-declaration-part
167
ISO/IEC 10206:1990(E)
{r{
read-parameter-list .................. procedure-statement
readln-parameter-list ................ procedure-statement
readstr-parameter-list ............... procedure-statement
real-type-name ....................... simple-type
record-constant ...................... field-designated-constant
record-function ...................... record-function-access
record-function-access ............... component-function-access
record-section ....................... fixed-part
record-type .......................... unpacked-structured-type
record-type-name ..................... structured-type-name
structured-value-constructor
record-value ......................... component-value
structured-value-constructor
record-variable ...................... field-designator
relational-operator .................. expression
remote-directive ..................... function-declaration
procedure-declaration
repeat-statement ..................... repetitive-statement
repetitive-statement ................. structured-statement
restricted-type ...................... new-type
result-type .......................... function-heading
result-variable-specification ........ function-heading
{s{
scale-factor ......................... number
168
ISO/IEC 10206:1990(E)
unsigned-real
schema-definition .................... type-definition-part
schema-discriminant .................. primary
schema-discriminant-identifier ....... schema-discriminant
schema-identifier .................... schema-name
schema-name .......................... discriminated-schema
domain-type
exportable-name
parameter-form
schema-definition
selective-import-option .............. import-qualifier
sequence-iteration ................... iteration-clause
set-constructor ...................... primary
set-value
set-expression ....................... set-member-iteration
set-member-iteration ................. iteration-clause
set-type ............................. unpacked-structured-type
set-type-name ........................ structured-type-name
structured-value-constructor
set-value ............................ structured-value-constructor
sign ................................. number
scale-factor
signed-integer
signed-real
simple-expression
signed-integer ....................... signed-number
signed-number ........................ number
signed-real .......................... signed-number
simple-expression .................... expression
simple-statement ..................... statement
statement ............................ case-list-element
else-part
finalization-part
for-statement
if-statement
initialization-part
statement-sequence
while-statement
with-statement
statement-part ....................... block
statement-sequence ................... case-statement-completer
compound-statement
repeat-statement
string-character ..................... string-element
string-constant ...................... indexed-constant
substring-constant
169
ISO/IEC 10206:1990(E)
{t{
tag-field ............................ variant-selector
tag-field-identifier ................. variant-part-value
tag-type ............................. variant-selector
term ................................. simple-expression
type-definition ...................... type-definition-part
type-definition-part ................. block
module-block
module-heading
type-denoter ......................... component-type
record-section
schema-definition
type-definition
variable-declaration
type-identifier ...................... type-name
type-inquiry ......................... ordinal-type
parameter-form
type-denoter
type-inquiry-object .................. type-inquiry
type-name ............................ array-type-name
complex-type-name
domain-type
exportable-name
file-type-name
ordinal-type-name
packed-conformant-array-form
parameter-form
170
ISO/IEC 10206:1990(E)
pointer-type-name
real-type-name
record-type-name
restricted-type
result-type
set-type-name
simple-type-name
type-denoter
unpacked-conformant-array-form
{u{
underscore ........................... directive
identifier
unpacked-conformant-array-form ....... conformant-array-form
unpacked-structured-type ............. new-structured-type
unsigned-constant .................... primary
unsigned-integer ..................... extended-number
signed-integer
unsigned-number
unsigned-number ...................... unsigned-constant
unsigned-real ........................ signed-real
unsigned-number
{v{
value-conformant-array-specification .. conformant-array-parameter-specification
value-parameter-specification ........ formal-parameter-section
variable-access ...................... actual-parameter
array-variable
assignment-statement
file-variable
pointer-variable
primary
read-parameter-list
readln-parameter-list
readstr-parameter-list
record-variable
schema-discriminant
string-variable
with-element
variable-conformant-array-specification .....
conformant-array-parameter-specification
171
ISO/IEC 10206:1990(E)
{w{
while-statement ...................... repetitive-statement
with-element ......................... with-list
with-list ............................ with-statement
with-statement ....................... structured-statement
word-symbol .......................... special-symbol
write-parameter ...................... write-parameter-list
writeln-parameter-list
writestr-parameter-list
write-parameter-list ................. procedure-statement
writeln-parameter-list ............... procedure-statement
writestr-parameter-list .............. procedure-statement
172
ISO/IEC 10206:1990(E)
Annex B
(Informative)
173
ISO/IEC 10206:1990(E)
Annex C
(Informative)
174
ISO/IEC 10206:1990(E)
175
ISO/IEC 10206:1990(E)
Annex D
(Informative)
The execution of any action, operation, or function, dened to operate on a variable, is an error
if the variable is bindable and, as a result of the binding, the execution cannot be completed
as dened.
D.8 6.5.3.2
It is an error if for an indexed-variable closest-containing an array-variable and a single
index-expression, the value of the index-expression is assignment-compatibility-erroneous with
respect to the index-type of the array-type.
D.9 6.5.3.2
It is an error if the value of the index-expression in an indexed-variable closest-containing a
string-variable is less than one or greater than the length of the value of the string-variable.
D.10 6.5.3.2
It is an error to alter the length of the value of a string-variable when a reference to a component
of the string-variable exists.
D.11 6.5.3.2
It is an error to access an indexed-variable when the string-variable, if any, of the indexed-
variable is undened.
D.12 6.5.3.3
It is an error unless a variant is active for the entirety of each reference and access to each
component of the variant of a record-variable.
D.13 6.5.4
It is an error if the pointer-variable of an identied-variable either denotes a nil-value or is
undened.
D.14 6.5.4
It is an error to remove from its pointer-type the identifying-value of an identied-variable
when a reference to the identied-variable exists.
D.15 6.5.5
It is an error to alter the value of a le-variable f when a reference to the buer-variable
f"exists.
D.16 6.5.6
It is an error if the string-variable of the substring-variable is undened, or if the value of an
index-expression in a substring-variable is less than 1 or greater than the length of the value
of the string-variable of the substring-variable, or if the value of the rst index-expression is
greater than the value of the second index-expression.
D.17 6.5.6
It is an error to alter the length of the value of a string-variable when a reference to a substring
of the string-variable exists.
D.18 6.7.3.2
It is an error if the value of any actual value parameter is assignment-compatibility-erroneous
with respect to the type possessed by the corresponding formal-parameter.
177
ISO/IEC 10206:1990(E)
D.19 6.7.3.2
It is an error if the actual-parameters contained by the activation-point of an activation
corresponding to formal-parameters that occur in a single value-parameter-specication containing
a schema-name that denotes the schema denoted by the required schema-identier string are
string-type or char-type values with diering lengths.
D.20 6.7.3.2
It is a dynamic-violation if the underlying-types of the types of the actual-parameters corresponding
to a parameter-form, that is in a value-parameter-specication and that contains a schema-
name not denoting the schema string, are not produced from a schema with the same tuple.
D.21 6.7.3.3
It is a dynamic-violation if the underlying-types of the types possessed by the formal-parameter
and actual-parameter are produced from the same schema, but not with the same tuple.
D.22 6.7.3.5
It is a dynamic-violation if the type denoted by the result-type closest-contained by the formal-
parameter-section and the type of the function are produced from the same schema, but not
with the same tuple.
D.23 6.7.3.6
It is a dynamic-violation if the type-name in the parameter-form of each value-parameter-
specication denotes a type produced from the same schema but not with the same tuple.
D.24 6.7.3.6
It is a dynamic-violation if the type-name in the parameter-form of each variable-parameter-
specication denotes a type produced from the same schema but not with the same tuple.
D.25 6.7.3.7.1
It is an error if the conformant-actual-variables corresponding to formal-parameters that occur
in a single value-conformant-array-specication possess xed-string-types that have dierent
capacities or that are not conformable with the conformant-array-form.
D.26 6.7.3.7.2
It is an error if the value parameter is assignment-compatibility-erroneous with respect to the
type possessed by the conformant-actual-variable.
D.27 6.7.3.8
At any place where the rule of conformability is used, it is an error if the smallest or largest
value specied by the index-type of an array-type with a single index-type lies outside the closed
interval specied by the type denoted by the ordinal-type-name of the index-type-specication
of a conformant-array-form closest-containing a single index-type-specication.
D.28 6.7.5.2
When extend(f) is activated, it is an error if either f0.L or f0.R is undened.
D.29 6.7.5.2
When put(f) is activated, it is an error if f0.M is not Generation or Update; if either f0.L or
f0.R is undened; if f0" is undened; or if f0.R <> S( ), and f is not a direct-access le-type.
178
ISO/IEC 10206:1990(E)
D.30 6.7.5.2
When update(f) is activated, it is an error if f0.M is not Generation or Update, if either f0.L
or f0.R is undened, if f0" is undened, or if f is not a direct-access le-type.
D.31 6.7.5.2
When reset(f) is activated, it is an error if either f0.L or f0.R is undened.
D.32 6.7.5.2
When get(f) is activated, it is an error if f0.M is not Inspection or Update, if either f0.L or
f0.R is undened, or if f0.R = S( ).
D.33 6.7.5.2
When SeekWrite(f,n) is activated, it is an error if either f0.L or f0.R is undened, if (ord(n)-
ord(a)) < 0, if length(f0.L~f0.R) < (ord(n)-ord(a)), or if n is assignment-compatibility-erroneous
with respect to T.
D.34 6.7.5.2
When SeekRead(f,n) is activated, it is an error if either f0.L or f0.R is undened, if (ord(n)-
ord(a)) < 0, if length(f0.L~f0.R) < (ord(n)-ord(a)), or if n is assignment-compatibility-erroneous
with respect to T.
D.35 6.7.5.2
When SeekUpdate(f,n) is activated, it is an error if either f0.L or f0.R is undened, if (ord(n)-
ord(a)) < 0, if length(f0.L~f0.R) < (ord(n)-ord(a)), or if n is assignment-compatibility-erroneous
with respect to T.
D.36 6.7.5.2
When read(f,v) is activated, with f, a le-variable possessing a type other than that denoted
by text, and v, a variable-access, it is an error if f0.M is not Inspection or Update, if either f0.L
or f0.R is undened, if f0.R = S( ), or if the value of f" is assignment-compatibility-erroneous
with respect to the type of v.
D.37 6.7.5.2
When write(f,e) is activated, with f, a le-variable possessing a type other than that denoted
by text, and e, an expression, it is an error if f0.M is not either Generation or Update; if either
f0.L or f0.R is undened; if e is undened; if f0.R <> S( ), and f is not a direct-access le;
or if the value of the expression e is assignment-compatibility-erroneous with respect to the
component-type of the le-type of f.
D.38 6.7.5.3
When new(p,c1 ,...,cn ) is activated, it is an error if a variant of a variant-part within the new
variable becomes active, and a dierent variant of the variant-part is one of the specied
variants.
D.39 6.7.5.3
When new(p,d1 ,...,ds ) is activated, it is a dynamic-violation if the tuple consisting of the values
of the expressions d1 ,...,ds taken in textual order is not in the domain of the schema denoted
by the schema-identier of the domain-type of the pointer-type possessed by p.
D.40 6.7.5.3
179
ISO/IEC 10206:1990(E)
When dispose(q) is activated, it is an error if the identifying-value had been created using the
form new(p,c1 ,...,cn ).
D.41 6.7.5.3
When dispose(q,k1 ,...,km ) is activated, it is an error unless the variable had been created using
the form new(p,c1 ,...,cn ) and m is equal to n.
D.42 6.7.5.3
When dispose(q,k1 ,...,km ) is activated, it is an error if the variants in the variable identied
by the pointer value of q are dierent from those specied by the values denoted by the
case-constants k1 ,...,km .
D.43 6.7.5.3
When either dispose(q) or dispose(q,k1,...,km ) is activated, it is an error if q has a nil-value or
is undened.
D.44 6.7.5.3
It is an error if a variable created using the form new(p,c1 ,...,cn ) is accessed by the identied-
variable of the variable-access of a primary, of an assignment-statement, or of an actual-
parameter.
D.45 6.7.5.4
When pack(a,i,z) is activated, it is an error if the value of i is assignment-compatibility-
erroneous with respect to the index-type of the type of a.
D.46 6.7.5.4
When pack(a,i,z) is activated, it is an error if any of the components of a are both undened
and accessed.
D.47 6.7.5.4
When pack(a,i,z) is activated, it is an error if the index-type of the type of a is exceeded.
D.48 6.7.5.4
When unpack(z,a,i) is activated, it is an error if the value of i is assignment-compatibility-
erroneous with respect to the index-type of the type of a.
D.49 6.7.5.4
When unpack(z,a,i) is activated, it is an error if any of the components of z are undened.
D.50 6.7.5.4
When unpack(z,a,i) is activated, it is an error if the index-type of the type of a is exceeded.
D.51 6.7.5.5
When readstr(e,v1,...,vn ) is activated, it is an error if the equivalent of eof(f) is true upon
completion.
D.52 6.7.5.5
When writestr(s,p1 ,...,pn ) is activated, it is an error if any of the write-parameters accesses
the referenced string-variable.
D.53 6.7.5.5
180
ISO/IEC 10206:1990(E)
When writestr(s,p1 ,...,pn ) is activated, it is an error if the equivalent of eoln(f) is false upon
completion.
D.54 6.7.5.6
When bind(f,b) is activated, it is a dynamic-violation if the variable f is already bound to an
external entity.
D.55 6.7.5.6
When bind(f,b) is activated, it is a dynamic-violation if the variable f, which possesses a
le-type, does not possess the bindability that is bindable.
D.56 6.7.5.6
When unbind(f) is activated, it is a dynamic-violation if the variable f, which possesses a
le-type, does not possess the bindability that is bindable.
D.57 6.7.6.2
From the value of integer-type or real-type of the expression x, sqr(x) computes a value, if any,
of the same type, for the square of x. When sqr(x) is activated, it is an error if no such value
exists.
D.58 6.7.6.2
From the value of real-type of the expression x, ln(x) computes a value of real-type for the
natural logarithm of x, if x is greater than zero. When ln(x) is activated, it is an error if the
value of the expression x is not greater than zero.
D.59 6.7.6.2
From the value of complex-type of the expression x, ln(x) computes a value of complex-type
for the natural logarithm of x, if x is not equal to zero. When ln(x) is activated, it is an error
if the value of the expression x is equal to zero.
D.60 6.7.6.2
From the value of real-type of the expression x, sqrt(x) computes a value of real-type for the
non-negative square root of x, if x is not negative. When sqrt(x) is activated, it is an error if
the value of the expression x is negative.
D.61 6.7.6.3
From the value of real-type of the expression x, trunc(x) computes a value, if any, of integer-
type, such that if x is positive or zero then 0 <= x;trunc(x) < 1; otherwise, ;1 < x;trunc(x)
<= 0. When trunc(x) is activated, it is an error if no such value exists.
D.62 6.7.6.3
From the value of real-type of the expression x, round(x) computes a value, if any, of integer-
type, such that if x is positive or zero then round(x) is equivalent to trunc(x+0.5); otherwise,
round(x) is equivalent to trunc(x;0.5). When round(x) is activated, it is an error if no such
value exists.
D.63 6.7.6.3
From the value of unpacked-canonical-set-of-T-type or packed-canonical-set-of-T-type of the
expression x, card(x) computes a value of integer-type for the number of members in x. When
card(x) is activated, it is an error if no such value exists.
181
ISO/IEC 10206:1990(E)
D.64 6.7.6.4
From the value of integer-type of the expression x, chr(x) computes a value, if any, of char-type
that is the value whose ordinal number is equal to the value of the expression x. When chr(x)
is activated, it is an error if no such value exists.
D.65 6.7.6.4
From the value of ordinal-type of the expression x, and the value of integer-type of the
expression k, succ(x,k) computes a value, if any, of the same ordinal-type whose ordinal number
is ord(x) + k. When succ(x,k) is activated, it is an error if no such value exists.
D.66 6.7.6.5
When eof(f) is activated, it is an error if f is undened.
D.67 6.7.6.5
When eoln(f) is activated, it is an error if f is undened or if eof(f) is true.
D.68 6.7.6.5
When empty(f) is activated, it is an error if f is undened.
D.69 6.7.6.6
When position(f) is activated, it is an error if f is undened or if the value of position(f) does
not exist.
D.70 6.7.6.6
When LastPosition(f) is activated, it is an error if f is undened or if the value of LastPosition(f)
does not exist.
D.71 6.7.6.7
When substr(s,i,j) is activated, it is an error if the value of i is less than or equal to zero, if the
value of j is less than zero, or if the value of (i)+(j);1 is greater than the length of the value
of s.
D.72 6.7.6.8
When binding(f) is activated, it is a dynamic-violation if the variable f, which possesses a
le-type, does not possess the bindability that is bindable.
D.73 6.7.6.9
When date(t) is activated, it is an error if the values of the elds Day, Month, and Year of
the value of t do not represent a valid calendar date.
D.74 6.8.1
It is an error to compute the value of an expression that contains a variable denoted by a
variable-access of a primary that is undened at the time of its use.
D.75 6.8.3.2
For a term of the form x/y, it is an error if the value of y is zero.
D.76 6.8.3.2
For a term of the form i div j, it is an error if the value of j is zero.
D.77 6.8.3.2
182
ISO/IEC 10206:1990(E)
For a term of the form i mod j, it is an error if the value of j is zero or negative.
D.78 6.8.3.2
For a factor of the form x**y, it is an error if x is zero and y is less than or equal to zero.
D.79 6.8.3.2
For a factor of the form x**y, where x is of integer-type or real-type, it is an error if x is
negative.
D.80 6.8.3.2
For a factor of the form x pow y, it is an error if x is zero and y is less than or equal to zero.
D.81 6.8.5
It is an error if the value of the result of an activation of a function is undened upon completion
of the algorithm of the activation.
D.82 6.8.6.2
It is an error if for an indexed-function-access closest-containing an array-function and a single
index-expression, the value of the index-expression is assignment-compatibility-erroneous with
respect to the index-type of the array-type possessed by the result of the array-function.
D.83 6.8.6.2
It is an error if the value of the index-expression in an indexed-function-access closest-containing
a string-function is less than one or greater than the length of the value of the string-function.
D.84 6.8.6.3
It is an error to denote a component of an inactive variant of a variant-part of a record-function.
D.85 6.8.6.4
It is an error if the pointer-function of a function-identied-variable denotes the nil-value.
D.86 6.8.6.5
It is an error if the value of an index-expression in a substring-function-access is less than one or
greater than the length of the value of the string-function of the substring-function-access or if
the value of the rst index-expression is greater than the value of the second index-expression.
D.87 6.8.7.1
It is an error if the value denoted by an expression in a component-value is assignment-
compatibility-erroneous with respect to the type of the component-value of a structured-value-
constructor.
D.88 6.8.8.2
It is an error if for an indexed-constant closest-containing an array-constant and a single
index-expression, the value of the index-expression is assignment-compatibility-erroneous with
respect to the index-type of the array-type.
D.89 6.8.8.2
It is an error if the value of the index-expression in an indexed-constant closest-containing a
string-constant is less than one or greater than the length of the value of the string-constant.
D.90 6.8.8.3
183
ISO/IEC 10206:1990(E)
184
ISO/IEC 10206:1990(E)
185
ISO/IEC 10206:1990(E)
Annex E
(Informative)
186
ISO/IEC 10206:1990(E)
E.11 6.4.2.2 d)
The value of char-type denoted by the required constant-identier maxchar is implementation-
dened.
E.12 6.4.2.2 e)
The values of complex-type are implementation-dened approximations to an implementation-
dened subset of the complex numbers.
E.13 6.4.2.2 e)
The results of the complex arithmetic operators and required functions are approximations to
the corresponding mathematical results. The accuracy of this approximation is implementation-
dened.
E.14 6.4.3.4
The variable-string-type of the eld associated with the required eld-identier name in the
required record-type denoted by the required type-identier BindingType is implementation-
dened.
E.15 6.7.5.2
The activities on external entities to which le-variables are bound and the point at which
they are actually performed are implementation-dened.
E.16 6.7.5.6
The binding as a result of the statement bind(f,b) of a variable denoted by f to an entity that
is external to the program and that is designated by b is implementation-dened.
E.17 6.7.5.8
The meaning of "current date" returned by the procedure GetTimeStamp is implementation-
dened.
E.18 6.7.5.8
The meaning of "current time" returned by the procedure GetTimeStamp is implementation-
dened.
E.19 6.7.6.8
The value returned by binding(f), where f is a variable, is implementation-dened.
E.20 6.7.6.9
The length of the string returned by the function date is implementation-dened.
E.21 6.7.6.9
The representation that is returned by date(t) of the calendar date denoted by t is implementation-
dened.
E.22 6.7.6.9
The length of the string returned by the function time is implementation-dened.
E.23 6.7.6.9
The representation that is returned by time(t) of the time denoted by t is implementation-
dened.
187
ISO/IEC 10206:1990(E)
E.24 6.10.3.1
The default value of TotalWidth for integer-type is implementation-dened.
E.25 6.10.3.1
The default value of TotalWidth for real-type is implementation-dened.
E.26 6.10.3.1
The default value of TotalWidth for Boolean-type is implementation-dened.
E.27 6.10.3.4.1
The value of ExpDigits is implementation-dened.
E.28 6.10.3.4.1
The value of the exponent character (`e' or `E') is implementation-dened.
E.29 6.10.3.5
The case of each letter of 'True' and 'False' for output of Boolean values is implementation-
dened.
E.30 6.10.5
The eect of the statement page(f) on the textle f is implementation-dened.
E.31 6.11.1
The binding of variables denoted by the module parameters to entities external to the program
is implementation-dened.
E.32 6.11.4.2
The eect of the application of either of the required procedures reset, rewrite, or extend
to the required textle input is implementation-dened.
E.33 6.11.4.2
The eect of the application of either of the required procedures reset, rewrite, or extend
to the required textle output is implementation-dened.
E.34 6.12
The binding of variables denoted by the program parameters to entities external to the program
is implementation-dened.
188
ISO/IEC 10206:1990(E)
Annex F
(Informative)
Implementation-dependent features
A complying processor is required to provide documentation concerning its treatment of all the
implementation-dependent features of the language (see 5.1 j) and 5.1 g)). To facilitate the
production of this denition, all the implementation-dependent features specied in clause 6 are
listed again in this annex.
F.1 6.4.8
A discriminant-value that is an expression shall denote the current value of the expression upon
activation of the block closest-containing the discriminant-value. The order of evaluation of
all such expressions contained in that block is implementation-dependent.
F.2 6.5.3.2
The order of both the evaluation of the index-expressions of, and the access to the array-
variable or string-variable of, an indexed-variable is implementation-dependent.
F.3 6.5.6
The order of both the evaluation of the index-expressions of, and the access to the string-
variable of, a substring-variable is implementation-dependent.
F.4 6.7.5.3
The order of evaluation of the expressions d1 , ...,ds in new(p,d1 , ...,ds ) is implementation-
dependent.
F.5 6.8.1
The order of evaluation of the expressions of a member-designator is implementation-dependent.
F.6 6.8.1
The order of evaluation of the member-designators of a set-constructor is implementation-
dependent.
F.7 6.8.3.1
Except for and then and or else, the order of evaluation of the operands of a dyadic operator
is implementation-dependent.
F.8 6.8.5
The order of evaluation, accessing, and binding of the actual-parameters of the actual-parameter-
list, if any, of a function-designator is implementation-dependent.
F.9 6.8.6.2
The order of evaluation both of the index-expressions of, and of the array-function or string-
function of, an indexed-function-access is implementation-dependent.
F.10 6.8.6.5
The order of evaluation both of the index-expressions of, and of the string-function of, a
substring-function-access is implementation-dependent.
189
ISO/IEC 10206:1990(E)
F.11 6.8.7.1
The order of evaluation of the component-values contained by a structured-value-constructor
is implementation-dependent.
F.12 6.8.8.2
The order of evaluation of the index-expressions of an indexed-constant is implementation-
dependent.
F.13 6.8.8.4
The order of evaluation of the index-expressions of a substring-constant is implementation-
dependent.
F.14 6.9.2.2
The order of accessing the variable and evaluating the expression of an assignment-statement
is implementation-dependent.
F.15 6.9.2.3
The order of evaluation, accessing, and binding of the actual-parameters of the actual-parameter-
list, if any, of a procedure-statement is implementation-dependent.
F.16 6.9.3.9.3
In a set-member-iteration, the order of selection of members of the value of a set-expression is
implementation-dependent.
F.17 6.10.1
When reading an integer or real representation from a textle f, it is implementation-dependent
whether the rst character examined is the value of the buer-variable or the value of the rst
component of f.R.
F.18 6.10.5
The eect of inspecting a textle to which the page procedure was applied during generation
is implementation-dependent.
190
ISO/IEC 10206:1990(E)
Annex G
(Informative)
Bibliography
ANSI X3.30-1985, Representation of Calendar Date and Ordinal Date for Information Interchange.
ANSI/IEEE770X3.97-1983, American National Standard Pascal Computer Programming Language.
BS6192:1982, British Standard Specication for Computer programming language Pascal.
ISO 646:1983, Information processing | ISO 7-bit coded character set for information interchange.
ISO 6903:1985, Information processing | Representation of numerical values in character strings
for information interchange.
ISO 7185:1983, Programming languages | PASCAL.
ISO 8601:1988, Data elements and interchange formats | Information interchange | Representation
of dates and times.
191
ISO/IEC 10206:1990(E)
Index
abs 6.7.6.2
access-qualier 6.11.3
accuracy 6.4.2.2, 6.8.2
activation 5.1, 6.2, 6.2.1, 6.2.3,
6.2.3.2, 6.2.3.3, 6.2.3.4, 6.2.3.5,
6.2.3.6, 6.2.3.7, 6.2.3.8, 6.3.1,
6.4.1, 6.4.2.3, 6.4.7, 6.4.8,
6.5.1, 6.6, 6.7.1, 6.7.2,
6.7.3.1, 6.7.3.2, 6.7.3.3, 6.7.3.4,
6.7.3.5, 6.7.3.7.1, 6.7.3.7.2, 6.7.3.7.3,
6.7.5.3, 6.7.5.7, 6.7.6.8, 6.8.5,
6.8.6.1, 6.9.2.2, 6.9.2.3, 6.9.2.4,
6.9.4, 6.10.5, 6.11.4.2
activation order 6.2.3.6
activation-point 6.2.3.4, 6.7.3.2, 6.7.3.3, 6.7.3.4,
6.7.3.5, 6.9.2.4
active (non-) 6.4.3.4, 6.5.3.3, 6.7.5.3, 6.8.6.3,
6.8.7.3, 6.8.8.3
actual-discriminant-part 6.2.3.8, 6.4.8, 6.8.1
actual-parameter 6.2.3.8, 6.4.2.2, 6.4.3.3.1, 6.7.3.1,
6.7.3.2, 6.7.3.3, 6.7.3.4, 6.7.3.5,
6.7.3.6, 6.7.3.7.1, 6.7.3.7.2, 6.7.3.7.3,
6.7.5.3, 6.8.5, 6.9.2.3, 6.9.4
actual-parameter-list 6.7.6.5, 6.8.5, 6.9.2.3, 6.9.4,
6.10.5
adding-operator 6.8.1, 6.8.3.1
algorithm 6.2.1, 6.2.3.2, 6.2.3.4, 6.2.3.5,
6.2.3.8, 6.8.5
allocation 6.7.5.1, 6.7.5.3
allowed 6.4.7
and 6.1.2, 6.8.3.1, 6.8.3.3
and then 6.1.2, 6.8.1, 6.8.3.1, 6.8.3.3
apostrophe-image 6.1.9
applied occurrence 6.2.1, 6.2.2.8, 6.2.2.9, 6.2.2.11,
6.2.2.13, 6.3.1, 6.4.1, 6.4.2.3,
6.4.7, 6.5.1, 6.7.1, 6.7.2,
6.7.3.1, 6.8.2, 6.8.7.3, 6.9.3.10,
6.11.3, 6.11.4.2
approximation 6.4.2.2, 6.7.6.3, 6.8.3.2
arctan 6.3.2, 6.7.6.2
arg 6.7.6.2
argument 6.7.6.2, 6.7.6.3
arithmetic operator 6.4.2.2, 6.8.3.2
array 6.1.2, 6.4.3.2, 6.7.3.7.1
192
ISO/IEC 10206:1990(E)
array-constant 6.8.8.2
array-function 6.8.6.2
array-type 6.2.4, 6.4.1, 6.4.3.1, 6.4.3.2,
6.4.3.3.2, 6.5.3.2, 6.7.3.7.1, 6.7.3.8,
6.7.5.4, 6.8.6.2, 6.8.7.2, 6.8.8.2
array-type-name 6.4.1, 6.8.7.1
array-value 6.4.7, 6.6, 6.8.7.1, 6.8.7.2
array-value-completer 6.8.7.2
array-value-element 6.8.7.2
array-variable 6.5.3.2, 6.9.4
assignment 6.4.2.5, 6.9.4
assignment-compatible (-ility) 6.4.4, 6.4.6, 6.5.3.2, 6.6,
6.7.3.2, 6.7.3.7.2, 6.7.5.2, 6.7.5.4,
6.8.1, 6.8.6.2, 6.8.7.1, 6.8.7.4,
6.8.8.2, 6.9.2.2, 6.9.3.9.2, 6.9.3.9.3,
6.10.1
assignment-statement 6.7.2, 6.7.5.3, 6.9.2.1, 6.9.2.2,
associate (-ed) 6.2.2.12, 6.2.3.2, 6.2.3.7, 6.3.1,
6.4.1, 6.4.2.2, 6.4.2.5, 6.4.3.4,
6.4.7, 6.4.8, 6.5.1, 6.5.3.3,
6.5.5, 6.7.1, 6.7.2, 6.7.3.1,
6.7.3.2, 6.7.3.3, 6.7.3.4, 6.7.3.5,
6.7.3.7.1, 6.7.3.7.2, 6.7.3.7.3, 6.7.5.2,
6.7.5.3, 6.8.6.3, 6.8.7.3, 6.8.8.3,
6.9.2.2, 6.9.3.10, 6.11.1, 6.11.3,
6.11.4.2
attribute (de-, -ed, -tion) 6.2.3.8, 6.2.4, 6.4.1, 6.4.2.5,
6.4.3.4, 6.4.3.6, 6.5.1, 6.5.3.3,
6.6, 6.7.3.2, 6.7.3.7.2, 6.7.5.3,
6.7.5.4, 6.7.5.8, 6.7.6.7, 6.8.1,
6.9.2.2, 6.9.3.9.1, 6.9.3.9.3, 6.10.1
base-type 6.4.1, 6.4.3.5, 6.4.5, 6.4.6,
6.6,
bear (-ing, -s, borne) 6.2.4, 6.4.3.4, 6.5.1, 6.6,
6.7.5.3
begin 6.1.2, 6.9.3.2, 6.11.1
bind 6.4.3.4, 6.7.5.6, 6.7.6.8, 6.9.4,
6.11.6
bindability 6.2.2.7, 6.2.3.2, 6.4.1, 6.4.2.1,
6.4.2.5, 6.4.3.1, 6.4.3.2, 6.4.3.3.3,
6.4.3.4, 6.4.3.5, 6.4.3.6, 6.4.4,
6.4.6, 6.4.7, 6.4.8, 6.4.9,
6.5.1, 6.5.3.1, 6.5.5, 6.5.6,
6.7.2, 6.7.3.2, 6.7.3.3, 6.7.3.6,
6.7.3.7.1, 6.7.3.8, 6.7.5.3, 6.7.5.6,
6.7.6.8, 6.11.2, 6.11.3
193
ISO/IEC 10206:1990(E)
case-list-element 6.9.3.5
case-range 6.4.3.4, 6.8.7.2, 6.9.3.5
case-statement 6.9.3.3, 6.9.3.5
case-statement-completer 6.9.3.5
char 6.4.2.2, 6.4.3.3.2, 6.4.3.5, 6.4.3.6,
6.4.10, 6.5.1, 6.6, 6.7.1,
char-type 6.1.9, 6.4.2.2, 6.4.3.3.1, 6.4.3.3.2,
6.4.3.6, 6.4.5, 6.4.6, 6.5.5,
6.7.3.2, 6.7.3.7.2, 6.7.5.5, 6.7.6.4,
6.7.6.7, 6.8.3.5, 6.8.3.6, 6.10.1,
6.10.3.1, 6.10.3.2
character 2, 4, 6.1, 6.1.1,
6.1.3, 6.1.7, 6.1.9, 6.1.10,
6.1.11, 6.4.2.2, 6.4.3.6, 6.7.6.4,
6.7.6.7, 6.10.1, 6.10.3, 6.10.3.2,
6.10.3.3, 6.10.3.4.1, 6.10.3.4.2, 6.10.3.6,
character-string 6.1.1, 6.1.9, 6.1.10, 6.4.3.3.1,
6.8.1, 6.10.3.5
chr 6.7.6.4
closest-contain (-s, -ed, -ing) 4
cmplx 6.7.6.3
commencement 6.2.3.2, 6.2.3.5, 6.2.3.6, 6.2.3.8,
6.4.8, 6.7.3.2, 6.7.3.3, 6.7.3.7.2,
6.7.3.7.3, 6.9.2.4
comment 6.1.10
comparison 6.7.6.7, 6.8.3.5
compatible (-ibility) 6.1.4, 6.1.5, 6.4.2.4, 6.4.3.4,
6.4.4, 6.4.5, 6.4.6, 6.4.8,
6.4.10, 6.6, 6.7.3.8, 6.7.5.3,
6.8.1, 6.8.3.5, 6.9.3.9.2, 6.9.3.9.3,
6.10.1, 6.13
complete (-ed, -tion) 3.2, 5.1, 6.2.3.2, 6.2.3.6,
6.2.3.8, 6.5.1, 6.7.5.5, 6.8.5,
6.9.2.4, 6.9.3.7
complex 6.4.2.2, 6.4.6, 6.5.1, 6.7.6.3
complex-type 6.4.2.1, 6.4.2.2, 6.4.6, 6.7.6.2,
6.7.6.3, 6.8.2, 6.8.3.2, 6.8.3.5
complex-type-name 6.4.2.1
comply (-ies, -ing, -iant, -iance) 1.1, 3.3, 5, 5.1,
5.2, 6.7.5.3
component 6.2.4, 6.4.1, 6.4.2.5, 6.4.3.1,
6.4.3.2, 6.4.3.3.1, 6.4.3.3.3, 6.4.3.4,
6.4.3.6, 6.4.6, 6.5.1, 6.5.3.1,
6.5.3.2, 6.5.3.3, 6.5.6, 6.6,
6.7.2, 6.7.3.2, 6.7.3.3, 6.7.3.6,
6.7.3.7.1, 6.7.3.7.3, 6.7.5.2, 6.7.5.3,
195
ISO/IEC 10206:1990(E)
196
ISO/IEC 10206:1990(E)
197
ISO/IEC 10206:1990(E)
6.7.6.6
directive 6.1.4, 6.1.5, 6.1.6
discriminant 6.4.3.3.3, 6.4.7, 6.4.8, 6.7.5.3,
6.8.4, 6.9.3.10
discriminant-identier 6.4.2.4, 6.4.3.3.2, 6.4.3.3.3, 6.4.3.4,
6.4.7, 6.8.1, 6.8.2, 6.8.4,
6.9.3.10, 6.11.2
discriminant-specication 6.4.7
discriminant-specier 6.2.2.6, 6.8.4
discriminant-value 6.4.7, 6.4.8, 6.11.1
discriminated-schema (-ata) 6.4.1, 6.4.2.1, 6.4.8, 6.7.2
dispose 6.4.1, 6.7.5.3, 6.11.6
div 6.1.2, 6.8.3.1, 6.8.3.2, 6.9.3.5,
6.9.3.8, 6.11.5
do 6.1.2, 6.9.3.8, 6.9.3.9.1, 6.9.3.10,
6.11.1
domain 6.4.3.3.3, 6.4.7, 6.4.8, 6.7.3.2,
6.7.3.3, 6.7.5.3
domain-type 6.2.2.9, 6.4.1, 6.4.4, 6.4.7,
6.7.5.3
downto 6.1.2, 6.9.3.9.2
dyadic 6.4.2.2, 6.8.3.1, 6.8.3.2
dynamic-violation 3.1, 3.2, 5.1, 6.4.2.4,
6.4.3.4, 6.4.6, 6.4.8, 6.7.3.2,
6.7.3.3, 6.7.3.5, 6.7.3.6, 6.7.5.3,
6.7.5.6, 6.7.6.8, 6.9.2.4, 6.9.3.5
else 6.1.2, 6.9.3.4
else-part 6.9.3.4
empty (non-) 6.4.3.3.1, 6.4.3.4, 6.4.3.6, 6.4.7,
6.7.5.2, 6.7.6.5, 6.8.2, 6.10.1,
6.10.5, 6.11.6
empty-statement 6.2.3.2, 6.9.2.1
end 6.1.2, 6.4.3.4, 6.9.3.2, 6.9.3.5,
6.11.1
end-of-le 6.4.3.6, 6.10.2
end-of-line 6.4.3.6, 6.7.5.2, 6.7.6.5, 6.10.1,
6.10.4, 6.10.5
entire-function-access 6.8.6.1
entire-variable 6.5.1, 6.5.2, 6.9.3.9.1
enumerated-type 6.4.2.1, 6.4.2.3, 6.11.2, 6.11.7
eof 6.7.1, 6.7.5.5, 6.7.6.5, 6.8.2,
6.8.5, 6.9.3.8, 6.12
eoln 6.7.5.5, 6.7.6.5, 6.8.2, 6.10.1,
6.10.2, 6.12
epsreal 6.4.2.2, 6.7.1, 6.7.2
EQ 6.7.6.7
198
ISO/IEC 10206:1990(E)
200
ISO/IEC 10206:1990(E)
le-type-name 6.4.1
le-variable 6.5.5, 6.7.5.2, 6.7.6.5, 6.7.6.6,
6.10.1, 6.10.2, 6.10.3, 6.10.4
nal-value 6.9.3.9.2
nalization 6.2.3.2, 6.2.3.4, 6.2.3.5, 6.2.3.6
nalization-part 6.2.3.2, 6.11.1
rst-constant-name 6.11.2
xed-component-initial-state 6.7.3.7.1
xed-component-type 6.7.3.7.1, 6.7.3.7.2
xed-part 6.4.3.4, 6.8.7.3
xed-part-value 6.8.7.3
xed-point 6.4.2.2, 6.10.3.4.2
xed-string-index-type 6.4.3.3.2
xed-string-type 6.4.2.2, 6.4.3.3.1, 6.4.3.3.2, 6.4.6,
6.5.3.2, 6.5.6, 6.7.3.3, 6.7.3.7.1,
6.7.3.7.2, 6.7.5.5, 6.8.6.2, 6.8.8.2,
6.10.1
oating-point 6.4.2.2, 6.10.3.4.1
for 6.1.2, 6.9.3.9.1
for-statement 6.9.3.6, 6.9.3.9, 6.9.3.9.1, 6.9.3.9.2,
6.9.3.9.3, 6.9.4
formal-discriminant-part 6.2.3.2, 6.4.7
formal-parameter 6.2.3.2, 6.2.3.5, 6.2.3.8, 6.4.2.5,
6.7.1, 6.7.2, 6.7.3.1, 6.7.3.2,
6.7.3.3, 6.7.3.4, 6.7.3.5, 6.7.3.6,
6.7.3.7.1, 6.7.3.7.2, 6.7.3.7.3, 6.8.5,
6.9.2.3
formal-parameter-list 6.2.3.2, 6.4.9, 6.7.1, 6.7.2,
6.7.3.1, 6.7.3.4, 6.7.3.5, 6.7.3.6,
6.7.3.7.1
formal-parameter-section 6.7.3.1, 6.7.3.4, 6.7.3.5, 6.7.3.6,
6.7.3.7.1
forward 6.1.4, 6.2.1, 6.7.1, 6.7.2
FracDigits 6.10.3.1, 6.10.3.4.2
fractional-part 6.1.7
function 6.1.2, 6.2.2.7, 6.2.2.10, 6.2.3.2,
6.2.3.3, 6.2.3.5, 6.4.2.2, 6.4.2.5,
6.4.3.4, 6.4.3.6, 6.5.1, 6.7,
6.7.1, 6.7.2, 6.7.3.5, 6.7.3.6,
6.7.4, 6.7.5.3, 6.7.5.6, 6.7.6,
6.7.6.1, 6.7.6.2, 6.7.6.3, 6.7.6.4,
6.7.6.5, 6.7.6.6, 6.7.6.7, 6.7.6.8,
6.7.6.9, 6.8.2, 6.8.5, 6.8.6.1,
6.9.2.2, 6.10.3.3, 6.10.3.4.1, 6.10.3.4.2,
6.11.2, 6.11.3, 6.11.5, 6.11.6,
6.11.7
201
ISO/IEC 10206:1990(E)
202
ISO/IEC 10206:1990(E)
if 6.1.2, 6.9.3.4
if-statement 6.9.3.3, 6.9.3.4
im 6.7.6.2
implementation 1.2, 3.2, 5.1, 6.1.6,
6.4.2.5, 6.8.2, 6.11.1, 6.11.5,
6.11.6, 6.13
implementation-dened 3.2, 3.4, 5.1, 5.2,
6.1.9, 6.1.11, 6.4.2.2, 6.4.3.4,
6.4.3.6, 6.7.5.2, 6.7.5.6, 6.7.5.8,
6.7.6.8, 6.7.6.9, 6.8.2, 6.10.2,
6.10.3, 6.10.3.1, 6.10.3.4.1, 6.10.3.5,
6.10.5, 6.11.1, 6.11.4.2, 6.12
implementation-dependent 3.5, 5.1, 5.2, 6.2.3.6,
6.4.3.6, 6.4.8, 6.5.3.2, 6.5.6,
6.7.5.3, 6.7.5.6, 6.8.1, 6.8.3.1,
6.8.5, 6.8.6.2, 6.8.6.5, 6.8.7.1,
6.8.8.2, 6.8.8.4, 6.9.2.2, 6.9.2.3,
6.9.3.9.3, 6.10.1, 6.10.5
implementation-directive 6.1.1, 6.1.6, 6.11.1
implicitly accessible 6.2.3.2, 6.7.6.5, 6.10.1, 6.10.2,
6.10.3, 6.10.4, 6.10.5, 6.11.4.2
import (-s, -ed) 6.1.2, 6.2.1, 6.2.2.6, 6.2.2.7,
6.2.2.13, 6.3.1, 6.4.1, 6.4.2.5,
6.4.7, 6.5.1, 6.7.1, 6.7.2,
6.11.1, 6.11.3, 6.11.6, 6.11.7,
6.12
import-clause 6.11.3
import-list 6.11.3
import-part 6.2.1, 6.11.1
import-qualier 6.2.2.6, 6.11.3
import-renaming-clause 6.11.3
import-specication 6.2.1, 6.2.2.6, 6.11.2, 6.11.3,
imported-interface-identier 6.2.2.6, 6.3.1, 6.4.1, 6.4.7,
6.5.1, 6.7.1, 6.7.2, 6.11.3
in 4, 6.1.2, 6.8.3.1, 6.8.3.5,
6.9.3.9.3
index (-ed, -ing) 6.3.2, 6.4.3.3.1, 6.4.3.3.3, 6.4.6,
6.4.7, 6.5.3.2, 6.5.6, 6.7.6.7,
6.8.3.6, 6.8.6.2, 6.8.6.5, 6.8.8.2,
6.8.8.4, 6.10.1
index-domain 6.4.3.3.1, 6.5.3.2, 6.8.6.2, 6.8.8.2
index-expression 6.5.3.2, 6.5.6, 6.8.6.2, 6.8.6.5,
6.8.8.2, 6.8.8.4
index-type 6.4.1, 6.4.3.2, 6.4.3.3.2, 6.4.3.6,
6.4.7, 6.5.3.2, 6.7.3.7.1, 6.7.3.8,
6.7.5.2, 6.7.5.4, 6.7.6.6, 6.8.6.2,
203
ISO/IEC 10206:1990(E)
6.8.7.2, 6.8.8.2
index-type-specication 6.7.3.6, 6.7.3.7.1, 6.7.3.8
indexed-constant 6.8.8.1, 6.8.8.2
indexed-function-access 6.8.6.1, 6.8.6.2
indexed-variable 6.5.3.1, 6.5.3.2, 6.7.3.7.2
initial state 6.2.2.7, 6.2.3.2, 6.2.3.5, 6.2.3.8,
6.2.4, 6.4.1, 6.4.2.1, 6.4.2.5,
6.4.3.1, 6.4.3.2, 6.4.3.3.3, 6.4.3.4,
6.4.3.5, 6.4.3.6, 6.4.4, 6.4.7,
6.4.8, 6.4.9, 6.4.10, 6.5.1,
6.5.3.3, 6.5.5, 6.7.1, 6.7.2,
6.7.3.2, 6.7.3.3, 6.7.3.7.1, 6.7.5.3,
6.11.2, 6.11.3
initial-state-specier 6.4.1, 6.4.3.2, 6.4.7, 6.6
initial-value 6.9.3.9.2
initialization 6.2.3.2, 6.2.3.4, 6.2.3.8, 6.11.6
initialization-part 6.2.3.2, 6.11.1
input 3.6, 6.1.4, 6.2.2.10, 6.5.5,
6.7.5.2, 6.7.6.5, 6.10, 6.10.1,
6.10.2, 6.11.1, 6.11.4.2, 6.12
inspection 6.4.3.6, 6.7.5.2, 6.10.3
integer 6.2.2.6, 6.4.2.1, 6.4.2.2, 6.4.2.5,
6.4.3.3.2, 6.4.3.4, 6.4.6, 6.4.7,
6.4.10, 6.5.1, 6.7.1, 6.7.3.1,
6.7.5.3, 6.8.3.2, 6.8.8.1, 6.10.3.3,
6.10.3.4.1, 6.10.3.4.2, 6.11.5, 6.11.6,
6.12
integer-type 6.1.7, 6.4.2.2, 6.4.3.3.3, 6.4.6,
6.5.3.2, 6.5.6, 6.7.5.5, 6.7.6.2,
6.7.6.3, 6.7.6.4, 6.7.6.5, 6.7.6.7,
6.8.3.2, 6.8.3.5, 6.8.6.2, 6.8.6.5,
6.8.8.2, 6.8.8.4, 6.10.1, 6.10.3.1,
6.10.3.3
interface 6.1.5, 6.2.2.2, 6.2.2.10, 6.2.2.13,
6.4.2.5, 6.11.1, 6.11.2, 6.11.3,
6.11.4, 6.11.4.2, 6.11.5, 6.11.6,
6.11.7, 6.13
interface-directive 6.1.1, 6.1.5, 6.11.1
interface-identier 6.2.2.6, 6.2.2.13, 6.11.2, 6.11.3,
6.11.4.1, 6.11.4.2
interface-specication-part 6.11.1, 6.11.2
iteration 6.8.8.1
iteration-clause 6.9.3.9.1, 6.9.3.9.2, 6.9.3.9.3
label 6.1.1, 6.1.2, 6.1.8, 6.1.10,
6.2.1, 6.2.2.1, 6.2.2.5, 6.2.2.7,
6.2.2.8, 6.2.2.9, 6.2.2.11, 6.2.3.2,
204
ISO/IEC 10206:1990(E)
206
ISO/IEC 10206:1990(E)
207
ISO/IEC 10206:1990(E)
209
ISO/IEC 10206:1990(E)
re 6.7.6.2
read 6.7.5.2, 6.7.5.5, 6.9.2.3, 6.9.4,
6.10.1, 6.10.2, 6.12
read-parameter-list 6.9.2.3, 6.9.4, 6.10.1
readln 6.7.5.2, 6.7.6.8, 6.9.2.3, 6.9.4,
6.10.2, 6.12
readln-parameter-list 6.9.2.3, 6.9.4, 6.10.2
readstr 6.7.5.5, 6.9.2.3, 6.9.4
readstr-parameter-list 6.7.5.5, 6.9.2.3, 6.9.4
real 6.4.2.2, 6.4.2.5, 6.4.3.2, 6.4.3.4,
6.4.3.6, 6.4.6, 6.4.10, 6.5.1,
6.7.1, 6.7.2, 6.7.5.5, 6.7.6.2,
6.7.6.3, 6.8.3.2, 6.10.3.4.1, 6.11.5,
6.12
real-type 6.1.7, 6.4.2.1, 6.4.2.2, 6.4.6,
6.7.5.5, 6.7.6.2, 6.7.6.3, 6.8.2,
6.8.3.2, 6.8.3.5, 6.10.1, 6.10.3.1,
6.10.3.4
real-type-name 6.4.2.1
record 6.1.2, 6.4.2.5, 6.4.3.4, 6.4.7,
6.4.10, 6.5.1, 6.11.5, 6.11.6
record-constant 6.8.8.3
record-function 6.8.6.3
record-function-access 6.2.2.6, 6.8.6.1, 6.8.6.3
record-section 6.4.3.4
record-type 6.2.4, 6.4.3.1, 6.4.3.4, 6.5.3.3,
6.7.5.3, 6.7.6.8, 6.8.6.3, 6.8.7.3,
6.8.8.3, 6.9.3.10, 6.11.2
record-type-name 6.4.1, 6.8.7.1
record-value 6.6, 6.8.7.1, 6.8.7.3
record-variable 6.4.3.4, 6.5.3.3, 6.8.6.1, 6.9.4
reference (-ed, -es, -ing) 6.2.3.2, 6.2.3.5, 6.5.3.1, 6.5.3.2,
6.5.3.3, 6.5.4, 6.5.5, 6.5.6,
6.7.3.3, 6.7.3.7.1, 6.7.3.7.3, 6.7.5.2,
6.7.5.4, 6.7.5.5, 6.7.6.8, 6.9.2.2,
6.9.3.10, 6.10.1, 6.10.2, 6.10.3,
6.10.4, 6.11.1
reference representation 6.1.11
region 6.2.1, 6.2.2.2, 6.2.2.3, 6.2.2.4,
6.2.2.5, 6.2.2.6, 6.2.2.7, 6.2.2.10,
6.2.2.12, 6.2.3.1, 6.3.1, 6.4.1,
6.4.2.3, 6.4.3.4, 6.4.7, 6.5.1,
6.5.3.3, 6.7.1, 6.7.2, 6.7.3.1,
6.7.3.7.1, 6.8.4, 6.8.6.3, 6.8.7.3,
6.8.8.3, 6.9.3.10, 6.11.1, 6.11.2,
6.11.3, 6.12
210
ISO/IEC 10206:1990(E)
scale-factor 6.1.7
schema (-ata) 6.2.2.7, 6.2.2.10, 6.2.3.2, 6.2.3.5,
6.4, 6.4.1, 6.4.3.3.3, 6.4.3.4,
6.4.4, 6.4.6, 6.4.7, 6.4.8,
6.7.3.2, 6.7.3.3, 6.7.3.5, 6.7.3.6,
6.7.5.3, 6.8.4, 6.9.3.10, 6.11.2,
6.11.3
schema-denition 6.2.1, 6.2.3.2, 6.2.3.8, 6.4.1,
6.4.7, 6.8.1
schema-discriminant 6.2.2.6, 6.8.1, 6.8.2, 6.8.4
schema-discriminant-identier 6.8.4, 6.9.3.10
schema-identier 6.2.2.6, 6.2.2.9, 6.4.1, 6.4.3.3.3,
6.4.7, 6.7.3.2, 6.7.5.3, 6.11.2,
6.11.3
schema-name 6.2.2.6, 6.4.4, 6.4.7, 6.4.8,
6.7.3.1, 6.7.3.2, 6.7.3.3, 6.7.3.6,
6.11.2
schematic 6.7.3.3
scope 1, 6.2, 6.2.2, 6.2.2.2,
6.2.2.4, 6.2.2.5, 6.2.2.6, 6.2.2.8,
6.11.2
second 6.4.2.4, 6.4.2.5, 6.4.3.4, 6.4.7,
6.5.6, 6.7.3.7.1, 6.7.5.8, 6.8.6.5,
6.8.8.4, 6.11.5
SeekRead 6.7.5.2
SeekUpdate 6.7.5.2
SeekWrite 6.7.5.2
selective-import-option 6.11.3
selector 6.4.3.4, 6.4.3.6, 6.5.1, 6.5.3.3,
6.7.3.3, 6.7.5.3, 6.8.7.3
selector-type 6.4.1, 6.4.3.4
separate compilation see program-component
sequence 6.4.3.6
sequence-iteration 6.9.3.9.1, 6.9.3.9.2
sequence-type 6.4.3.6, 6.10.1
set 6.1.2, 6.4.3.5
set operator 6.8.3.2, 6.8.3.4
set-constructor 6.8.1, 6.8.7.4
set-expression 6.9.3.9.3
set-member-iteration 6.9.3.9.1, 6.9.3.9.3
set-type 6.4.1, 6.4.3.1, 6.4.3.5, 6.4.5,
6.4.6, 6.7.3.2, 6.8.1, 6.8.3.5,
6.8.7.4
set-type-name 6.4.1, 6.8.7.1
set-value 6.8.7.1, 6.8.7.4
sign 6.1.7, 6.8.1, 6.8.3.2, 6.10.3.3,
212
ISO/IEC 10206:1990(E)
6.10.3.4.1
signed-integer 6.1.7, 6.4.2.2, 6.10.1
signed-number 6.1.7
signed-real 6.1.7, 6.4.2.2
simple-expression 6.8.1, 6.8.3.1, 6.8.3.3
simple-statement 6.9.1, 6.9.2, 6.9.2.1
simple-type 6.4.1, 6.4.2, 6.4.2.1, 6.4.2.2,
6.8.3.5
simple-type-name 6.4.1
sin 6.7.6.2, 6.8.1, 6.8.5
special-symbol 6.1.1, 6.1.2
spelling 3.3, 6.1.3, 6.1.8, 6.2.2.5,
6.2.2.7, 6.2.2.8, 6.4.2.3, 6.11.1,
6.11.3, 6.12
sqr 6.7.6.2, 6.9.2.2, 6.9.3.8
sqrt 6.7.2, 6.7.6.2, 6.8.5
StandardInput 6.2.2.10, 6.11.4.2
StandardOutput 6.2.2.10, 6.4.2.5, 6.11.4.2
statement 3.1, 5.1, 6.2.1, 6.2.3.2,
6.4.5, 6.4.6, 6.5.1, 6.7.2,
6.7.3.6, 6.7.3.8, 6.7.5.2, 6.7.5.4,
6.7.5.5, 6.7.5.6, 6.8.7.2, 6.9,
6.9.1, 6.9.2.1, 6.9.3.1, 6.9.3.4,
6.9.3.5, 6.9.3.6, 6.9.3.8, 6.9.3.9.1,
6.9.3.9.2, 6.9.3.9.3, 6.9.3.10, 6.9.4,
6.10.1, 6.10.2, 6.10.3, 6.10.4,
6.11.1
statement-part 6.2.1, 6.2.3.2, 6.9.1
statement-sequence 6.9.1, 6.9.3.1, 6.9.3.2, 6.9.3.5,
6.9.3.7
state 6.2, 6.2.2.7, 6.2.3.2, 6.2.3.5,
6.2.3.8, 6.2.4, 6.4.1, 6.4.2.1,
6.4.2.5, 6.4.3.1, 6.4.3.2, 6.4.3.3.3,
6.4.3.4, 6.4.3.5, 6.4.3.6, 6.4.4,
6.4.7, 6.4.8, 6.4.9, 6.4.10,
6.5.1, 6.5.3.1, 6.5.3.3, 6.5.5,
6.6, 6.7.1, 6.7.2, 6.7.3.1,
6.7.3.2, 6.7.3.3, 6.7.3.7.1, 6.7.5.2,
6.7.5.3, 6.7.5.6, 6.11.2, 6.11.3
string 6.1.9, 6.4.2.2, 6.4.3.3.1, 6.4.3.3.3,
6.4.8, 6.4.10, 6.7.3.2, 6.7.5.1,
6.7.5.3, 6.7.5.5, 6.7.6.1, 6.7.6.7,
6.8.3.2, 6.8.3.6, 6.11.6
string operator 6.8.3.2, 6.8.3.6
string-character 6.1.9
string-constant 6.8.8.2, 6.8.8.4
213
ISO/IEC 10206:1990(E)
214
ISO/IEC 10206:1990(E)
6.11.4.2, 6.12
then 6.1.2, 6.9.3.4
threaten (-ing) 6.5.1, 6.7.2, 6.9.3.9.1, 6.9.4
time 6.1.3, 6.4.3.1, 6.4.3.4, 6.5.1,
6.7.5.1, 6.7.5.6, 6.7.5.8, 6.7.6.1,
6.7.6.9, 6.11.6
TimeStamp 6.4.3.4, 6.7.2, 6.7.5.8, 6.7.6.9,
6.11.6
TimeValid 6.4.3.4, 6.7.5.8
to 6.1.2, 6.9.3.9.2, 6.11.1
token 4, 6.1, 6.1.1, 6.1.2,
6.1.10, 6.1.11, 6.4.3.1, 6.4.4,
6.9.3.4
totally-undened 6.2.4, 6.4.1, 6.4.2.1, 6.4.3.4,
6.4.3.5, 6.4.3.6, 6.4.4, 6.4.8,
6.5.1, 6.5.3.3, 6.5.5, 6.6,
6.7.3.2, 6.7.5.2, 6.7.5.6, 6.7.6.8,
6.10.1, 6.10.4, 6.10.5
TotalWidth 6.10.3.1, 6.10.3.2, 6.10.3.3, 6.10.3.4.1,
6.10.3.4.2, 6.10.3.5, 6.10.3.6
trim 6.7.6.7
true 6.4.2.2, 6.10.3.5
trunc 6.7.6.3
tuple (triple, k-tuples, m-tuples) 6.4.3.2, 6.4.3.3.3, 6.4.3.4, 6.4.6,
6.4.7, 6.4.8, 6.7.3.2, 6.7.3.3,
6.7.3.5, 6.7.3.6, 6.7.5.3, 6.8.1,
6.8.4, 6.9.3.10
type 6.2.3.2, 6.4
type-denition 6.2.1, 6.4.1
type-denition-part 6.2.1, 6.2.2.9, 6.4.1, 6.4.7,
6.4.10, 6.11.1
type-denoter 6.2.4, 6.4.1, 6.4.3.2, 6.4.3.4,
6.4.3.6, 6.4.7, 6.5.1, 6.6,
6.7.2
type-identier 6.2.2.6, 6.2.2.7, 6.2.2.9, 6.2.2.11,
6.3.2, 6.4.1, 6.4.2.2, 6.4.3.4,
6.4.3.6, 6.7.5.2, 6.7.5.3, 6.7.5.6,
6.7.5.8, 6.7.6.8, 6.7.6.9, 6.11.2,
6.11.3
type-inquiry 6.4.1, 6.4.2.1, 6.4.9, 6.7.3.1,
6.7.3.2, 6.7.3.3, 6.7.3.6
type-inquiry-object 6.4.9
type-name 6.2.2.6, 6.4.1, 6.4.2.1, 6.4.2.5,
6.4.4, 6.7.2, 6.7.3.1, 6.7.3.2,
6.7.3.3, 6.7.3.6, 6.7.3.7.1, 6.7.3.8,
6.8.2, 6.11.2
215
ISO/IEC 10206:1990(E)
216
ISO/IEC 10206:1990(E)
217
ISO/IEC 10206:1990(E)
218