1、I N T E R N AT I 0 N A L STANDARD ISO/IEC 7185 Second edition 1990- 10-1 5 (Reaffirmed 2004) Information technology - Programming languages - Pascal (Revision of IS0 7185 : 1983) Technologies de Pin formation - Langages de programmation - Pascal (Revision de IISO 7185 : 19831 National Standard of Ca
2、nada CAN/CSA-ISO/IEC-7185-95 International Standard ISO/IEC 7185:1990 has bet adopt e d, with out rn o di f i c a t i on , as CAN/CSA-ISO/IEl 7185-95, which has been approved as a National Standard Canada by the Standards Council of Canada. Febtllary 19 Reference number ISO/IEC 7185 : 1990 (E) ISO/I
3、EC 7185 : 1990 (E) Contents Page 1 Scope 1 2 Normative reference 1 3 Definitions 1 4 Definitional conventions 2 5 Compliance . 3 5.1 Processors . 3 5.2 Programs 5 6 Requirements . 5 6.1 Lexicaltokens 5 6.2 Blocks. scopes and activations . 8 6.3 Constant . definitions . 11 6.4 Type . definitions . 11
4、 6.5 Declarations and denotations of variables 21 6.6 Procedure and function declarations 24 6.7 Expressions 38 6.8 Statements 42 6.9 Input and output . 49 6.10 Programs . 55 Annexes A Collectedsyntax . 58 B Cross-references 64 C Required identifiers 71 D Errors 72 E Implementation . defined feature
5、s 76 F Implementation . dependent features . 78 0 ISO/IEC 1990 All rights reserved . No par! 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 . Printed in Sw
6、itzerland ISO/IEC Copyright Office e Case postale 56 rn CH-1211 Geneve 20 e Switzerland ISO/IEC 7185 : 1990 (E) Foreword IS0 (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) form the specialized system for worldwide standardiz- ation. Natio
7、nal bodies that are members of IS0 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. IS0 and IEC technical committees collaborate in fields of mutual interest.
8、 Other international organizations, governmental and non-governmental, in liaison with IS0 and IEC, also take part in the work. In the field of information technology, IS0 and IEC have established a joint technical committee, ISO/IEC JTC 1. Draft International Standards adopted by the joint technica
9、l committee are circulated to national bodies for voting. Publication as an International Standard requires approval by at least 75 % of the national bodies casting a vote. International Standard ISO/IEC 7185 was prepared by Joint Technical Committee ISO/IEC JTC 1, /nfurmation technology. This secon
10、d edition cancels and replaces the first edition (IS0 7185 : 1983). Annexes A, B, C, D, E and F are for information . Ill ISODEC 7185:1990(E) Introduction This International Standard provides an unambiguous and machine independent definition of the programming language Pascal. Its purpose is to faci
11、litate portability of 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 systemati
12、c discipline based on b) to define a ianguage whose implementations could be both reliable and efficient on then-available certain fundamental concepts cIearly and naturally reflected by the language; computers. However, it has become apparent that Pascal has attributes that go far beyond these orig
13、inal goals. It is now being increasingly used commercially in the writing of both system and application software. 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 sy
14、stems. In drafting this International Standard the continued stability of Pascal has been a prime objective. However, apart from changes to clarify the specification, two major changes have been introduced. a) The syntax used to specify procedural and functional parameters has been changed to requir
15、e the use of a procedure or function heading, as appropriate (see 6.6.3.1); this change was introduced to overcome a language insecurity. b) A fifth kind of parameter, the conformant-array-parameter, has been introduced (see 6.6.3.7). With this kind of parameter, the required bounds of the index-typ
16、e of an actual-parameter are not fixed, but are restricted to a specified range of values. 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 firs
17、t draft for public comment being widely published early in 1979. In 1978, BSIs proposal that Pascal be added to ISOs program of work was accepted, and the IS0 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,
18、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 first meeting was held in January 1979. In December of 1978, X3J9 c
19、onvened as a result of a SPARC (Standards Planning and Requirements Committee) resolution to form a US TAG (Technical Advisory Group) for the IS0 Pascal standardization effort initiated by the UK. These efforts were performed under X3 project 3 17. In agreement with IEEE representatives, in February
20、 of 1979, an X3 resolution combined the X3J9 and p770 committees into a single committee called the Joint X3J9/IEEE-W70 Pascal Standards Committee. (Throughout, the term Tpc refers to this committee.) The first meeting as JPC was held in April 1979. The resolution to form JPC clarified the dual func
21、tion of the single joint Committee to produce a dpANS and a proposed IEEE Pascal standard, identical in content. ANSI/IEEE77OX3.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 Standa
22、rds IV ISOhEC 7185: 1990(E) Institute on December 16, 1982. British Standard BS6192, Specification for Computer programming language Pascal, was published in 1982, and International Standard 7185 (incorporating BS6192 by reference) was approved by IS0 on December 1, 1983. Differences between the ANS
23、I and IS0 standards are detailed in the Foreword of ANSI/IEEE770X3.97-1983. In 1985, the IS0 Pascal Working Group (then designated ISO/TC97/SC22/WG2, now ISO/IEC JTC1/ SC22/WG2) was reconvened after a long break. An Interpretations Subgroup was formed, to interpret doubtful or ambiguous portions of
24、the Pascal standards. As a result of the work of this subgroup, and also of the work on the Extended Pascal standard being produced by WG2 and JPC, BS6192/IS07185 was revised and corrected during 1988/89; it is expected that ANSI/IEEE770X3.97-1983 wi11 be replaced by the revised IS0 7185. The major
25、revisions to BS61921982 to produce the new IS0 7185 are: a) resolution of the differences with ANSI/lEEE770X3.97-1983; b) relaxation of the syntax of real numbers, to allow “digit sequences” rather than “unsigned integers” c) in the handling of “end-of-line characters” in text files; for the various
26、 components; d) in the handling of run-time errors. V - - INTERNATIONAL STANDARD ISODEC 7185: 1990(E) Information technology - Programming languages - Pascal 1 Scope This International Standard specifies the semantics and syntax of the computer programming language Pascal by specifying requirements
27、for a processor and for a conforming program. Two levels of compliance are defined 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 specific data processing system or the capaci
28、ty 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 a implementation of a processor for Pascal; c) the method of activating the program-block or the set of commands
29、 used to control the environment in which a Pascal program is transformed and executed; system; d) the mechanism by which programs written in Pascal are transformed for use by a data processing e) the method for reporting errors or warnings; f) the typographical representation of a program published
30、 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. AI1 standards are subject to revision, and parties to agreeme
31、nts 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 IS0 maintain registers of currently valid International Standards. IS0 646: 1983, Information processing-ISO 7-bit coded charact
32、er set for information interchange. 3 Definitions For the purposes of this International Standard, the following definitions apply. NOTE - To draw attention to language concepts, some terms are printed in italics OR their first mention or at their defining occurrence(s) in this International Standar
33、d. 1 ISOAEC 7185:1990(E) 3.1 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 International Standard requires knowledge
34、 of the data read by the program or the implementation definition of implementation-defined features, then violation of that requirement is classified as an error. Processors may report on such violations of the requirement without such knowledge, but there always remain some cases that require exec
35、ution, simulated execution, or proof procedures with the required knowledge. Requirements that can be verified without such knowledge are not classified as errors. 2 Processors should attempt the detection of as many errors as possible, and to as complete a degree as possible. Permission to omit det
36、ection is provided for implementations in which the detection would be an excessive burden. 3.2 Extension A modification to clause 6 of the requirements of this International Standard that does not invalidate any program complying with this International Standard, as defined by 5.2, except by prohib
37、iting the use of one or more particular spellings of identifiers (see 6.1.2 and 6.1.3). 3.3 Implement at ion - defined Possibly differing between processors, but defined for any particuIar processor. 3.4 Implementation-dependent Possibly differing between processors and not necessarily defined for a
38、ny particular processor. 3.5 Processor A system or mechanism that accepts a program as input, prepares it for execution, and executes the process so defined with data to produce results. NOTE - A processor may consist of an interpreter, a compiler and run-time system, or another mechanism, together
39、with an associated host computing machine and operating system, or another mechanism for achieving the same effect. A compiler in itself, for example, does not constitute a processor. 4 Definitional conventions The metaIanguage used in this International Standard to specify the syntax of the constru
40、cts is based on Backus-Naur Form. The notation has been modified 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 specification of the constructs is given by
41、 prose and, in some cases, by equivalent program fragments. Any identifier that is defined in clause 6 as a required identifier shall denote the corresponlng required entity by its occurrence in such a program fragment. In all other respects, any such program fragment is bound by any pertinent requi
42、rement of this Internationd Standard. A meta-identifier 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
43、 characters shall intervene. In all other parts of this International Standard the concatenation is in accordance with the rules set out in 6.1. 2 ISO/IEC 7185:1990(E) Metasymbol 0 Meaning Shall be defined to be Shall have as an alternative definition Alternatively End of definition 0 or 1 instance
44、of x 0 or more instances of x Grouping: either of x or y The terminal symbol xyz A nonterminal symbol The characters required to form Pascal programs shall be those implicitly required to form the tokens and separators defined in 6.1. Use of the words of, in, containing, and closest-containing, when
45、 expressing a relationship between terminal or nonterminal symbols, shall have the following meanings -the x ofa y: refers to the x occurring directly in a production defining y; -the x in a y: is synonymous with the x of a y; -a y containing an x: refers to any y from which an x is directly or indi
46、rectly derived; -the y cIosest-containing an x: that y containing an x and not containing another y containing that x. These syntactic conventions are used in clause 6 to specify certain syntactic requirements and also the contexts within which certain semantic specifications apply. In addition to t
47、he normal English rules for hyphenation, hyphenation is used in this International Standard to forrn compound words that represent meta-identifiers, semantic terms, or both. All meta-identifiers that contain more than one word are written as a unit with hyphens joining the parts. Semantic terms endi
48、ng in “type” and “variable” are also written as one hyphenated unit. Semantic terms representing compound ideas are likewise written as hyphenated units, e.g., digit-value, activation-point, assignment-compatible, and identifying-value. NOTES are included in this International Standard only for purp
49、oses of clarification, and aid in the use of the standard. NOTES are informative only and are not a part of the International Standard. Examples in this International Standard are equivalent to NOTES. 5 Compliance There are two levels of compliance, Ievel 0 and Ievel 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 specified in clause 6, except for 6.6.3.6 b) if
copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
备案/许可证编号:苏ICP备17064731号-1