1、BRITISH STANDARD BS ISO/IEC 10206:1991 Implementation of ISO/IEC 10206:1991 Information technology Programming languages ExtendedPascal UDC 681.3.06:519.682:800.92BSISO/IEC10206:1991 This British Standard, having been prepared under the directionof the Information Systems Technology Standards Policy
2、 Committee, was publishedunder the authority ofthe Standards Board and comesinto effect on 30September1991 BSI 05-2000 The following BSI references relate to the work on this standard: Committee reference IST/5 Draft for comment 90/60810 DC ISBN 0 580 20040 X Committees responsible for this British
3、Standard The preparation of this British Standard was entrusted by the Information Systems Technology Standards Policy Committee (IST/-) to Technical Committee IST/5, upon which the following bodies were represented: British APL Association British Computer Society British Gas plc Department of Trad
4、e and Industry (National Physical Laboratory) EEA (the Association of Electronics, Telecommunications and Business Equipment Industries) Electricity Industry in United Kingdom GAMBICA (BEAMA Ltd.) HM Treasury (Central Computer and Telecommunications Agency) Information Technology Users Standards Ass
5、ociation Institution of Electrical Engineers Loughborough University of Technology National Computing Centre Ltd. Polytechnics and Colleges Computer Committee (PCCC) Science and Engineering Research Council (Rutherford Appleton Laboratory) University of Edinburgh University of Liverpool University o
6、f London User Standards Forum for Information Technology (Institute of Data Processing Management) Amendments issued since publication Amd. No. Date CommentsBSISO/IEC10206:1991 BSI 05-2000 i Contents Page Committees responsible Inside front cover National foreword ii Foreword v Text of ISO/IEC 10206
7、 1BSISO/IEC10206:1991 ii BSI 05-2000 National foreword This British Standard reproduces verbatim ISO/IEC10206:1991 and implements it as the UK national standard. This British Standard is published under the direction of the Information Systems Technology Standards Policy Committee whose Technical Co
8、mmittee IST/5 has the responsibility to: aid enquirers to understand the text; present to the responsible international committee any enquiries on interpretation, or proposals for change, and keep UK interests informed; monitor related international and European developments and promulgate them in t
9、he UK. NOTEInternational and European Standards, as well as overseas standards, are available from BSI Sales Department, BSI, Linford Wood, Milton Keynes, MK146LE. A British Standard does not purport to include all the necessary provisions of a contract. Users of British Standards are responsible fo
10、r their correct application. Compliance with a British Standard does not of itself confer immunity from legal obligations. Summary of pages This document comprises a front cover, an inside front cover, pagesi andii, theISO/IEC title page, pagesii tovi, pages1 to189 and a back cover. This standard ha
11、s been updated (see copyright date) and may have had amendments incorporated. This will be indicated in the amendment table on the inside front cover.ISO/IEC10206:1991 (E) ii BSI 05-2000 Contents Page Foreword v Introduction 1 1 Scope 5 2 Normative reference 5 3 Definitions 6 3.1 Dynamic-violation 6
12、 3.2 Error 6 3.3 Extension 6 3.4 Implementation-defined 6 3.5 Implementation-dependent 6 3.6 Processor 6 4 Definitional conventions 6 5 Compliance 7 5.1 Processors 7 5.2 Programs 8 6 Requirements 9 6.1 Lexical tokens 9 6.1.1 General 9 6.1.2 Special-symbols 9 6.1.3 Identifiers 9 6.1.4 Remote-directiv
13、es 10 6.1.5 Interface-directives 10 6.1.6 Implementation-directives 10 6.1.7 Numbers 10 6.1.8 Labels 11 6.1.9 Character-strings 11 6.1.10 Token separators 12 6.1.11 Lexical alternatives 12 6.2 Blocks, scopes, activations, and states 13 6.2.1 Blocks 13 6.2.2 Scopes 13 6.2.3 Activations 15 6.2.4 State
14、s 17 6.3 Constants 18 6.3.1 General 18 6.3.2 Example of a constant-definition-part 18 6.4 Types and schemata 19 6.4.1 Type-definitions 19 6.4.2 Simple-types 20 6.4.3 Structured-types 24 6.4.4 Pointer-types 31 6.4.5 Compatible types 31 6.4.6 Assignment-compatibility 32 6.4.7 Schema-definitions 32 6.4
15、.8 Discriminated-schemata 34 6.4.9 Type-inquiry 34 6.4.10 Example of a type-definition-part 34 6.5 Declarations and denotations of variables 36 6.5.1 Variable-declarations 36 6.5.2 Entire-variables 37ISO/IEC10206:1991 (E) BSI 05-2000 iii Page 6.5.3 Component-variables 37 6.5.4 Identified-variables 3
16、8 6.5.5 Buffer-variables 39 6.5.6 Substring-variables 39 6.6 Initial states 39 6.7 Procedure and function declarations 40 6.7.1 Procedure-declarations 40 6.7.2 Function-declarations 42 6.7.3 Parameters 45 6.7.4 Required procedures and functions 52 6.7.5 Required procedures 52 6.7.6 Required function
17、s 59 6.8 Expressions 64 6.8.1 General 64 6.8.2 Constant-expressions 65 6.8.3 Operators 65 6.8.4 Schema-discriminants 69 6.8.5 Function-designators 69 6.8.6 Function-accesses 70 6.8.7 Structured-value-constructors 71 6.8.8 Constant-accesses 73 6.9 Statements 75 6.9.1 General 75 6.9.2 Simple-statement
18、s 75 6.9.3 Structured-statements 76 6.9.4 Threats 82 6.10 Input and output 82 6.10.1 The procedure read 82 6.10.2 The procedure readln 84 6.10.3 The procedure write 84 6.10.4 The procedure writeln 87 6.10.5 The procedure page 87 6.11 Modules 88 6.11.1 Module-declarations 88 6.11.2 Export-part 89 6.1
19、1.3 Import-specifications 90 6.11.4 Required interfaces 91 6.11.5 Example of a module 92 6.11.6 Examples of program-components that are module-declarations 94 6.11.7 Example of exporting a range of enumerated-type values 99 6.12 Main-program-declarations 99 6.13 Programs 101 Annex A (informative) Co
20、llected syntax 103 Annex B (informative) Incompatibilities with Pascal standards 154 Annex C (informative) Required identifiers 155 Annex D (informative) Errors and dynamic-violations 156 Annex E (informative) Implementation-defined features 163 Annex F (informative) Implementation-dependent feature
21、s 165ISO/IEC10206:1991 (E) iv BSI 05-2000 Page Annex G (informative) Bibliography 166 Index 167 Table 1 Metalanguage symbols 7 Table 2 Arithmetic functions 59 Table 3 Dyadic arithmetic operations 66 Table 4 Monadic arithmetic operations 66 Table 5 Set operations 67 Table 6 Relational operations 68 T
22、able 7 String operation 69 Descriptors: Data processing, programming (computers), computer programs, programming languages, Pascal.ISO/IEC10206:1991(E) BSI 05-2000 v Foreword ISO (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) form the spe
23、cialized system for worldwide standardization. National bodies that are members of ISO or IEC participate in the development of International Standards through technical committees established by the respective organization to deal with particular fields of technical activity. ISO and IEC technical
24、committees collaborate in fields of mutual interest. Other international organizations, governmental and non-governmental, in liaison with ISO and IEC, also take part in the work. In the field of information technology, ISO and IEC have established a joint technical committee, ISO/IECJTC1. Draft Int
25、ernational Standards adopted by the joint technical committee are circulated to national bodies for voting. Publication as an International Standard requires approval by at least75% of the national bodies casting a vote. International Standard ISO/IEC10206 was prepared by Joint Technical Committee I
26、SO/IECJTC1, Information technology. Annex A toAnnex G are for information only.vi blankISO/IEC10206:1991 (E) BSI 05-2000 1 Introduction This International Standard provides an unambiguous and machine independent definition of the programming language Extended Pascal. Its purpose is to facilitate por
27、tability 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
28、 discipline based on certain fundamental concepts clearly and naturally reflected by the language; b) to define a language whose implementations could be reliable and efficient on then-available computers. However, it has become apparent that Pascal has attributes that go far beyond those original g
29、oals. 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 ISO7185:1983, Programming languages PASCAL. Programs using such extensions attain the benefits of
30、the extended features at the cost of portability with standard Pascal and with other processors supporting different 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 consequen
31、ce 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. Th
32、is group produced several working drafts, the first draft for public comment being widely published early in1979. In1978, BSIs proposal that Pascal be added to ISOs programme of work was accepted, and the ISO Pascal Working Group (then designated ISO/TC97/SC5/WG4) was formed in1979. The Pascal stand
33、ard 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 of1978, application was made to the IEEE Standards Board by the IEEE Computer Society to authorize project770 (Pascal). After approval, the first meeting was h
34、eld in January1979. In December1978, 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 effort initiated by the UK. These efforts were performed underX3 project317. In agreemen
35、t with IEEE representatives, in February1979, anX3 resolution combined theX3J9 andP770 committees into a single committee called the JointX3J9/IEEEP770 Pascal Standards Committee. (Throughout, the term JPC refers to this committee.) The first meeting as JPC was held in April1979. The resolution to f
36、orm JPC clarified 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 September17, 1981, and
37、by the American National Standards Institute on December16, 1982. British StandardBS6192, Specification for Computer programming language Pascal, was published in1982, and International Standard7185 (incorporating BS6192 by reference) was approved by ISO on December1, 1983. Differences between the A
38、NSI and ISO standards are detailed in the Foreword of ANSI/IEEE770X3.97:1983. (BS6192/ISO7185 was revised and corrected during1988/89; it is expected that ANSI/IEEE770X3.97:1983 will be replaced by the revised ISO7185.) Following the decision that the first publication of a standard for the programm
39、ing language Pascal would not contain extensions to the language, JPC prepared a project proposal to SPARC for an Extended Pascal Standard. When approved byX3 in November1980, this proposal formed the charter for Project345. JPC immediately formed the Extension Task Group to receive all proposals fo
40、r 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 Pa
41、scal language.ISO/IEC10206:1991 (E) 2 BSI 05-2000 X3 issued a press release on behalf of JPC in January1980 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 th
42、e priority list. Criteria for evaluating extensions were established and included machine independence, upward compatibility, conceptual integrity, rigorous definition, and existing practice as prime objectives. Extension proposals submitted by the public and by the JPC membership were developed and
43、 refined. JPC procedures guaranteed that proposals would be considered over at least two meetings, affording adequate time for review of the technical merits of each proposal. By June of1983, twelve extensions had been designated by JPC as candidate extensions and were published as a Candidate Exten
44、sion Library. Ongoing work was described in Work in Progress, published with the Candidate Extension Library. This effort served as an interim milestone and an opportunity for the public to review the effort to date. In 1984, BSI also started work on extensions to Pascal, with an initial aim of prov
45、iding extensions in a few areas only. In1985, 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
46、 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 June1986. The process of reconciling individual candidate extensions a
47、mong themselves was begun in September1984 and continued until June1986. During this phase, conflicts 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. The candidate extensi
48、ons 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 unified response on each comment issue, PCTG included members from both WG2 and JPC. Al
49、l responses and recommended changes required final 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 JPCs Project345 was to define 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 L