Information technology — Programming languages — PL/1 general purpose subset

The language defined is different from those of previous PL/I standards, although substantially upward compatible, at the source program and semantic level. The differences are summarized in appendix A. Specifies the syntax and semantics of conforming PL/I programs. Defines a conforming processor (or conforming implementation) only in terms of those conforming programs. The definition is accomplished by specifying a conceptual PL/I machine which translates and interprets intended PL/I programs.

Technologies de l'information — Langages de programmation — Sous-ensemble PL/1 pour usage général

General Information

Status
Published
Publication Date
24-Nov-1992
Current Stage
9093 - International Standard confirmed
Completion Date
29-Jul-2008
Ref Project

Relations

Buy Standard

Standard
ISO/IEC 6522:1992 - Information technology -- Programming languages -- PL/1 general purpose subset
English language
443 pages
sale 15% off
Preview
sale 15% off
Preview

Standards Content (Sample)

INTERNATIONAL
ISO/IEC
STANDARD
6522
Second edition
1992-l l-l 5
Information technology - Programming
languages - PL/l general purpose subset
- Langages de programmation -
Technologies de I’information
Sous-ensemble PL/ I pour usage g&Gral
A
-
___ -
--_
--
ZZ= =
=
=
=
=
ZZ
x
=
Y :
1
E .z
Z
z
.zz Reference number
EL
--
ZIZ=L
--
E
---
__--
ISO/IEC 6522:1992(E)
~~_. PTC

---------------------- Page: 1 ----------------------
ISO/lEC 4522:1992 (E)
Contents
1
.................................................................
1. Scope and Overviews
............................................................................ 1
1.1 Scope
1
.............................................................
1.2 Referenced Publications
2
.................................................................
1.3 GoalsandRationale
3
................................................
1.4 An Informal Guide to the PL/I Definition
3
.............................................................
1.4.1 ASummaryofPL/I
4
.......................................................
1.42 The Form of the Definition
6
.....................................................
1.4.3 Summary of Chapter Structure
10
1.4.4 Introduction to the Metalanguage .
10
1.4.4.1 Tree Concepts .
11
..................................................................
1.4.4.2 Syntaxes
12
1.4.4.3 Algorithm Concepts .
................................ 14
1.5 Relationships between an Implementation and this Definition
15
1.5.1 Flexibilities of Interpretation .
15
.......................................................
1.5.1.1 Rejection of Programs
15
.....................................................
1.5.1.2 Quantitative Restrictions
15
......................................................
1.5.1.3 Addressing Restrictions
16
......................................................
1.5.1.4 Operating Environment
16
.............................................................
1.5.1.5 Character Sets
16
.......................................................
1.5.1.6 Expression Evaluation
17
...................................................
1.5.1.7 Interrupts and Assignment
17
.............................................................
1.5.1.8 Input/Output
17
.................................................................
1.5.1.9 On-units
18
..................................................
1.5.2 Implementation-defined Features
20
1.6 TheMetalanguage .
.......... 21
1.6.1 Trees . .~.~~~~.~~.~.~.~
21
...........................................................
1.6.1.1 TreeDefinitions
22
.............................................................
1.6.1.2 NodeObjects
23
..........................................................
1.6.1.2.1 Unique-names
23
................................................................
1.6.1.2.2 Types
23
............................................................
1.6.1.3 Node Notation
24
.............................................................
1.6.1.4 Tree Notation
24
......................................................
1.6.1.4.1 Enumerated-Trees
25
...............................................................
1.6.1.4.2 Forms
25
...............................................................
1.6.1.5 TreeCopies
25
..............................................................
1.6.2 Production Rules
25
................................................
1.6.2.1 Production Rules and Syntaxes
26
...................................................
1.6.2.2 Complete and Partial Trees
28
........................................
1.6.2.3 Syntactic-expressions and Syntactic-units
28
..................................................
1.6.2.4 Use of the Production Rules
.............. 29
1.6.2.4.1 Subnode-type Sequence with respect to a Syntax and Category-name
29
....................
1.6.2.4.2 Subnode-type Sequence with respect to a Syntactic-expression
30
1.6.3 Operations .
30
......................................................
1.6.3.1 Nature of an Operation
0 ISO/IEC 1992
All rights reserved. No part of this publication may be reproduced or utilized in any form or by
any means, electronic or mechanical, including photocopying and microfilm, without permission
in writing from the publisher.
International Organization for Standardization
Case postale 56 l CH-1211 Geneve 20 l Switzerland
Printed in Switzerland
ii

---------------------- Page: 2 ----------------------
ISOlIEC 6522:1992 (E)
1.6.3.2 Nondeterministic Operations 3 1
..................................................
1.6.3.3 Format of an Operation 31
.....................................................
32
1.6.3.4 Instructions
...............................................................................................................................
1.6.3.5 Convert . 34
1.6.3.6 Additional Notational Conventions 34
.............................................
34
1.6.3.7 Arithmetic .
34
1.6.3.7.1 Properties of Arithmetic in the Metalanguage
.................................
35
1.6.3.7.2 PropertiesofArithmeticinPL/I .
1.6.4 TheProcessor . . 36
: : 37
1.6.5 Mechanization of the Metalanguage
........................................................................................................
..................................................... 39
1.7 InitializationoftheMachine-state
39
1.7.1 TheMachine-state .
39
1.7.2 Initialization .
1.7.3 T&Top-levelOperations. . 39
1.7.3.1 Define-program 39
............................................................
1.7.3.2 Translation-phase 40
..........................................................
1.7.3.3 Interpretation-phase 40
........................................................
41
2. Concrete Syntax .
41
2.1 Introduction .
41
2.2 The Intent of this Definition
.........................................................
41
2.2.1 Concrete and Abstract Syntaxes
...................................................
41
2.3 Organization of the Concrete Syntax
...................................................
42
2.4 The High-level Syntax of PL/I
.......................................................
............................................................... 42
2.4.1 TranslationUnit
42
2.4.2 Package .
42
2.4.3 Procedure .
42
2.4.4 Unit .
42
2.4.5 Executable Units
..............................................................
43
2.4.6 If Statement
..................................................................
43
2.4.7 DoGroup .
43
2.4.8 Select Group .
2.4.9 BeginBlock . 43
44
2.4.10 OnUnit .
44
2.4.10.1 Condition Prefixes
2.4.10.2 StatementNamePref*~es”::::::::::::::::::::::::::::::::::::::::::::::::::: 44
2.4.11 Data Declaration 44
.............................................................
44
2.4.11.1 Dimension Attribute and Dimension Suffix .
45
2.4.11.2 Attributes .
45
2.4.11.3 DataAttributes
...........................................................
46
2.4.11.4 Environment and Options
...................................................
................................................................... 46
2.4.11.5 Initial
46
2.4.12 The Package Statement
........................................................
46
2.4.13 The Procedure Statement
.......................................................
47
2.4.14 The Begin Statement
..........................................................
47
2.4.15 The Do Statement
2.4.16 TheSelectStatemen;‘:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 47
: 47
2.4.17 The End Statement .
........................................................
48
2.4.18 Flow of Control Statements
.....................................................
48
2.4.18.1 The CaIl and Return Statements
..............................................
48
2.4.18.2 The Go To Statement
......................................................
48
2.4.18.3 The Leave Statement
......................................................
48
2.4.18.4 The Null Statement
........................................................
48
2.4.18.5 The Revert and Signal Statements
.............................................
. . .
111

---------------------- Page: 3 ----------------------
ISO/IEC 6522:1992 (E)
48
2.4.18.6 The Stop Statement .
48
2.4.19 Storage Control Statements .
49
.......................................................
2.4.20 Input/Output Statements
49
..............................................
2.4.20.1 The Open and Close Statements
49
2.4.20.2 RecordI/O .
50
..............................................................
2.4.20.3 StreamI/O
50
...............................................
2.4.20.3.1 StreamInput Specification
50
.............................................
2.4.20.3.2 Stream Output Specification
50
..........................
2.4.2.0.3.3 Format Specification Lists and the Format Statement
51
..................................................................
2.4.21 Expressions
52
............................................................
2.4.22 EnquiryFunctions
57
........................................................
2.5 The Low-level Syntax of PL/I
.................................................................... 57
2.5.1 PL/IText
57
....................................................................
2.5.2 Comment.
..................................................................... 57
2.5.3 Identifier
57
............................................................
2.5.4 Arithmetic Constant
58
.....................................................
2.5.5 String Constants and Pictures
58
......................................................................
2.5.6 Include
.................................................................... 59
2.6 Character Sets
60
2.6.1 Language Character Set .
60
2.6.1.1 Letters and Digits .
61
2.6.1.2 Special Characters .
61
2.6.2 Data Character Set .
61
.................................
2.6.3 Secondary Case Characters in Numeric and Bit Values
62
2.7 Abbreviations .
63
3. Abstract Syntax .
63
3.1 Introduction .
63
3.2 Abstract Syntax Rules .
63
3.2.1 Program .
63
3.2.2 Package .
63
3.2.3 Procedure .
64
3.2.4 Declaration .
64
3.2.5 Variable .
64
3.2.6 Data-description .
65
3.2.7 Data-type .
66
3.2.8 Named-constant .
66
3.2.9 Entry-point .
66
3.2.10 Executable-unit .
67
3.2.11 Begin-block .
67
3.2.12 Groups .
67
3.2.13 Selections .
68
3.2.14 OnStatement .
68
3.2.15 If Statement .
68
3.2.16 Flow of Control Statements .
.69
3.2.17 Storage Statements .
69
I/O Statements .
3.2.18
69
Record I/O Statements .
3.2.19
70
.........................................................
3.2.20 Stream I/O Statements
71
..................................................................
3.2.21 Expression
72
TypesofReference .
3.2.22
73
....................................................................
3.2.23 Constant
73
...............................................................
3.2.24 TypesofValue
73
..............................................................
3.2.25 TypesofPicture
1v

---------------------- Page: 4 ----------------------
ISO/IEC 6522:1992 (E)
4. The Translator
.....................................................................
75
4.1 Introduction . 75
4.2 Translate . 75
76
4.3 Forming the Translation Unit .
4.3.1 Low-level-parse 77
...............................................................
4.3.2 High-level-parse 78
...............................................................
80
4.4 Validation of the Translation Unit
.....................................................
4.5 Completion of the External Unit 80
......................................................
4.5.1 Reorganize . 81
4.5.1.1 Complete-options 81
..........................................................
4.5.1.2 Complete-attribute-implications . 8 1
82
4.5.1.3 Defactor-declarations .
83
4.5.2 Construct-explicit-declarations .
4.5.2.1 Declare-parameters 83
.........................................................
4.5.2.2 Declare-statement-names 84
....................................................
4.5.2.3 Construct-statement-name-declarations 85
.........................................
4.5.3 Complete-structure-declarations 87
...................................................
4.5.3.1 Determine-structure 87
........................................................
4.5.3.2 Convert-to-logical-levels 88
.....................................................
4.5.3.3 Propagate-ahgnment 88
........................................................
89
4.5.3.4 Find-applicable-declaration
....................................................
90
4.5.3.5 Find-fully-qualified-name
....................................................
4.5.4 Construct-contextual-declarations 9 1
.................................................
4.5.5 Complete-declarations 93
..........................................................
4.5.5.1 Test-attribute-consistency 94
....................................................
4.5.5.2 Test-invaiid-duplicates 96
......................................................
4.5.5.3 Apply-defaults 96
.............................................................
4.5.5.4 Apply-attribute 98
............................................................
4.5.5.5 Complete-constructed-entry-declaration 98
.........................................
4.5.5.6 Test-name-in-description 101
...................................................
4.5.6 Validate-concrete-declarations 10 1
...................................................
4.5.6.1 Check-attribute-completeness-and-delete-attributes . 102
4.6 Create-abstract-equivalent-tree 103
......................................................
4.6.1 Creation of Blocks and Groups 104
..................................................
4.6.1.1 Create-package 104
...........................................................
4.6.1.2 Create-procedure 105
.........................................................
4.6.1.3 Create-begin-block 106
........................................................
4.6.1.4 Create-block 106
.............................................................
4.6.1.5 Replace-concrete-designators . 107
4.6.1.6 Replace-concrete-precision-designators . 107
4.6.1.7 Replace-concrete-named-constant-designators . 108
4.6.1.8 Create-group . 108
4.6.1.9 Create-selection . 109
4.6.1.10 Create-executable-unit-list . 110
4.6.1.11 Create-executable-unit . 110
.......................................................
4.6.1.12 Create-entry-point 110
....................................................
4.6.1.13 Create-statement-name 111
4.6.1.14 Create-condition-prefix-list 1 112
............... .................................
4.6.1.15 Create-condition . 112
4.6.1.16 Test-descriptor-extent-expressions . 113
.........................................................
4.6.2 CreationofStatements 113
4.6.2.1 Create-assignment-statement . 113
4.6.2.2 Data-descriptions Proper for Assignment . 114

---------------------- Page: 5 ----------------------
ISO/IEC 6522:1992 (E)
114
4.6.2.3 Create-allocation .
114
4.6.2.4 Create-format-statement .
115
4.6.2.5 Create-remote-format .
4.6.2.6 Create-format-iteration . 115
115
4.6.2.7 Create-freeing. .
4.6.2.8 Create-if-statement . 116
116
4.6.2.9 Create-balanced-unit .
4.6.2.10 Create-leave-statement . 117
118
4.6.2.11 Create-on-statement .
4.6.2.12 Create-open-statement . 119
119
4.63 Create-declaration .
120
4.6.3.1 Create-named-constant .
120
4.6.3.2 Create-variable .
12 1
4.6.3 3 Create-bound-pair-list .
122
4.6.3.4 Create-data-description .
124
4.6.3.5 Create-data-type .
125
4.6.3.6 Create-entry .
126
4.6.3.7 Create-refer-option .
4.6.3.8 Create-identifier . 126
126
4.6.3.9 Create-initial .
4.6.3.10 Create-array&it . 127
127
4.6.3.11 Create-initial-element .
128
4.6.3.12 Create-integer .
128
4.6.3.13 Convert-named-literal .
130
4.6.3.14 Check-arithmetic-type .
. 130
4.6.3.15 Create-precision . .
130
4.6.3.16 Create-number-of-digits .
...................... . ................................. 131
4.6.3.17 Create-scale-factor
13 1
4.6.4 Create-expression .
134
4.6.5 Create-reference .
137
4.6.5.1 Collect-subscripts .
4.6.5.2 Apply-subscripts 138
..........................................................
4.6.5.3 Create-value-reference .
139
4.6.5.4 Trim-dd . 139
4.6.5.5 Create-named-constant-reference . 139
140
4.6.5.6 Create-argument-list .
’ 4.6.5.7 Create-builtin-function-reference . 14 1
4.6.5.8 Create-pseudo-variable-reference . 142
4.6.5.9 Create-entry-reference . 143
144
4.6.5.10 Test-matching .
144
4.6.6 Create-picture .
145
4.6.6.1 Create-numeric-picture .
4.6.7 Create-constant . 147
149
4.6.8 Create-enquiry-reference .
15 1
4.6.8.1 Create-arithmetic-enquiry-reference .
4.7 Validation of the External Unit . 152
4.7.1’ Validate-declaration 152
152
4.7.2 Validate-automatic-de’d;ara;ibh’ l : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
4.7.3 Validate-based-declaration . 153
154
4.7.4 Validate-defined-declaration .
154
4.7.5 Validate-parameter-declaration .
154
4.7.6 Validate-static-declaration .
155
4.7.7 Validate-descriptor .
155
4.7.8 Evaluate-restricted-expression .
156
4.7.9 Apply-constraints .

---------------------- Page: 6 ----------------------
ISO/IEC 6522:1992 (E)
157
.............................................................
4.7.10 Test-constraints
158
.....................................................
4.7.11 Validate-leave-statements
159
4.8 Validate-program .
.................................................... 159
4.8.1 Validate-external-declaration
160
............................................................
4.8.2 Environment-names
161
...............................................................
5. The PL/I Interpreter
161
.....................................................................
5.1 Introduction
161
............................................................
5.2 The Interpretation-state
161
..................................................................
5.2.1 Directories
161
..................................................................
5.2.2 BlockState
.............................................................. 163
5.2.3 File Information
164
............................................................
5.2.4 Storage and Values
....................... 165
5.2.5 Generations, Evaluated Data Descriptions, and Evaluated Targets
165
.....................................................................
5.2.6 Dataset
166
........................................................
5.3 Terminology and Definitions
166
5.3.1 Current .
166
5.3.2 Block .
.............................. 166
5.4 The Interpret Operation and Interpretation State Initialization
166
5.4.1 Interpret .
167
....................................................
5.4.2 Initialize-interpretation-state
167
..............................................
5.4.3 Build-file-directory-and-informations
168
5.4.4 Build-fdi .
168
....................................
5.4.5 Ahocate-static-storage-and-build-static-directory
169
5.4.6 Program-epilogue .
171
6. Flow Of Control .
171
6.1 Introduction .
.................................................. 171
6.2 Program Activation and Termination
.......................................................... 171
6.2.1 Program Termination
..................................................... 172
6.2.1.1 Execute-stop-statement
............................................................ 172
6.2.1.2 Stop-program
.................................................... 172
6.3 Block Activation and Termination
............................................................ 172
6.3.1 Activate-procedure
.......................................................... 173
6.3.1.1 Install-arguments
.......................................................... 173
6.3.2 Activate-begin-block
174
6.3.3 Prologue .
175
6.3.4 Epilogue .
............................................................. 175
6.4 Control within a Block
176
6.4.1 Normal-sequence .
........................................................ 176
6.4.1.1 Advance-execution
........................................................ 176
6.4.2 Execute-executable-unit
........................................................... 177
6.4.3 Execute-begin-block
................................................................ 177
6.4.4 Execute-group
.................................................. 178
6.4.4.1 Establish-controlled-group
...................................................... 178
6.4.4.2 Initiahze-spec-options
180
6.4.4.3 Test-spec .
.................................................. 180 5
6.4.4.4 Advance-controlled-group
............................................................. 182
6.4.5 Execute-selection
182
.....................................................
6.4.5.1 Test-when-enablement
183
.......................................................
6.4.5.2 Test-when-matching
184
..........................................................
6.4.6 Execute-if-statement
184
.......................................................
6.4.6.1 Establish-truth-value
......................................................... 185
6.4.7 Execute-caU-statement
vii

---------------------- Page: 7 ----------------------
ISO/IEC 6522:1992 (E)
185
..........................................................
6.4.7.1 Entry-references
................................................ 185
6.4.7.1.1 Evaluate-entry-reference
.................................................... 186
6.4.7.1.2 Establish-argument
.......
...

Questions, Comments and Discussion

Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.