ebook img

Pascal ISO 7185:1990 — Pascal language ISO standard PDF

98 Pages·1991·0.51 MB·English
by  ISO/IEC
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Pascal ISO 7185:1990 — Pascal language ISO standard

Pascal ISO 7185:1990 This online copy of the unextended Pascal standard is provided only as an aid to standardization. In the case of di(cid:11)erences between this online version and the printed version, the printed version takes precedence. Donotmodifythisdocument. Donotincludethisdocumentinanothersoftwareproduct. 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 (cid:12)re. Do not operate heavy equipmentafterreading,maycausedrowsiness. Donotreadunderthein(cid:13)uenceofalcohol(although there have been several uncon(cid:12)rmed reports that alcohol actually improves the readability). The standardis written in English. If youhavetrouble understanding a particular section, readit again and again and again... Sit up straight. Eat your vegatables. Do not mumble. (cid:13)cISO/IEC 1991 ISO/IEC 7185:1990(E) ii ISO/IEC 7185:1990(E) Acknowledgements The e(cid:11)orts are acknowledged of all those who contributed to the work of the BSI and ISO Pascal working groups, and in particular: Tony Addyman Harris Hall John Reagan Albrecht Biedl Carsten Hammer Mike Rees Bob Brewer Atholl Hay Arthur Sale Coen Bron Tony Hetherington Paula Schwartz David Burnett-Hall Steve Hobbs Barry Smith David Bustard Mel Jackson John Souter Barry Byrne Scott Jameson Manfred Stadel Klaus Daessler David Jones Bob Tennent Richard De Morgan David Joslin Tom Turba Norman Diamond Katsuhiko Kakehi Eiiti Wada Bob Dietrich Olivier Lecarme Willem Wakker Ken Edwards Jim Miner David Watt Jacques Farr(cid:19)e Wes Munsil Jim Welsh Bill Findlay Bill Price Brian Wichmann The e(cid:11)orts are acknowledged of all those who contributed to the work of JPC, and in particular: Michael Alexander Steven Hobbs David L. Presberg Je(cid:11)rey Allen Albert A. Ho(cid:11)man William C. Price Ed Barkmeyer Robert Hutchins Bruce Ravenal W. Ashby Boaz Rosa C. Hwang David L. Reese Jack Boudreaux Scott Jameson David C. Robbins A. Winsor Brown David Jones Lynne Rosenthal Jerry R. Brookshire Steen Jurs Tom Rudkin Tomas M. Burger Mel Kanner Stephen C. Schwarm David S. Cargo John Kaufmann Rick Shaw Richard J. Cichelli Leslie Klein Carol Sledge Joe Cointment Bruce Knobe Barry Smith Roger Cox Dennis Kodimer Rudeen S. Smith Jean Danver Ronald E. Kole Bill Stackhouse Debra Deutsch Alan A. Kortesoja Marius Troost Bob Dietrich Edward Krall Thomas N. Turba Victor A. Folwarczny Robert Lange Prescott K. Turner G. G. Gustafson Rainer McCown Howard Turtle Thomas Giventer Jim Miner Robert Tuttle Hellmut Golde Eugene N. Miya Richard C. Vile, Jr David N. Gray Mark Molloy Larry B. Weber Paul Gregory William Neuhauser David Weil Michael Hagerty Dennis Nicholson Thomas R. Wilcox Charles E. Haynes Mark Overgaard Thomas Wolfe Christopher Henrich Ted C. Park Harvey Wohlwend iii ISO/IEC 7185:1990(E) Steven Hiebert Donald D. Peckham Kenneth M. Zemrowski Ruth Higgins David Peercy Charles Hill Robert C. B. Poon (The above list is of people acknowledgedin ANSI/IEEE770X3.97-1983.) iv ISO/IEC 7185:1990(E) Introduction This International Standard provides an unambiguous and machine independent de(cid:12)nition of the programminglanguage Pascal. Its purpose is to facilitate portability of Pascal programs for use on a wide variety of data processing systems. Language history ThecomputerprogramminglanguagePascalwasdesignedbyProfessorNiklausWirthtosatisfytwo 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(cid:13)ected by the language; b) to de(cid:12)ne a language whose implementations could be both reliable and e(cid:14)cient on then- available computers. However,it hasbecome apparentthat Pascalhas attributesthat gofarbeyondthese originalgoals. Itisnowbeingincreasinglyusedcommerciallyinthewritingofbothsystemandapplicationsoftware. ThisInternationalStandardisprimarilyaconsequenceofthegrowingcommercialinterestinPascal and the need to promote the portability of Pascalprograms between data processing systems. In draftingthis InternationalStandardthe continuedstabilityof Pascalhasbeen a primeobjective. However, apart from changes to clarify the speci(cid:12)cation, two major changes have been introduced. a) The syntaxused to specify procedural and functional parametershas been changedto require 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(cid:12)fthkindofparameter,theconformant-array-parameter,hasbeenintroduced(see6.6.3.7). With this kind of parameter, the required bounds of the index-type of an actual-parameter are not (cid:12)xed, but are restricted to a speci(cid:12)ed 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 (cid:12)rst draft for public comment being widely published early in 1979. In 1978, BSI’s proposal that Pascalbe added to ISO’s programof work was accepted, and the ISO PascalWorking 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 (cid:12)rst meeting was held in January 1979. InDecemberof1978,X3J9convenedasaresultofaSPARC(StandardsPlanningandRequirements Committee) resolution to form a US TAG (Technical Advisory Group) for the ISO Pascal standardization e(cid:11)ort initiated by the UK. These e(cid:11)orts were performed under X3 project 317. v ISO/IEC 7185:1990(E) In agreement with IEEE representatives,in February of 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 (cid:12)rst meeting as JPC was held in April 1979. The resolution to form JPC clari(cid:12)ed the dual function of the single joint committee to produce a dpANS and a proposed IEEE Pascalstandard, identical in content. ANSI/IEEE770X3.97-1983,AmericanNationalStandardPascalComputerProgrammingLanguage, 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, Speci(cid:12)cation for Computer programming language Pascal, was published in 1982, and International Standard 7185 (incorporatingBS6192byreference)wasapprovedbyISOonDecember1,1983. Di(cid:11)erencesbetween the ANSI and ISO standards are detailed in the Foreword of ANSI/IEEE770X3.97-1983. 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. An Interpretations Subgroup was formed, to interpret doubtful or ambiguous portions of 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/ISO7185 was revised and corrected during 1988/89; it is expected that ANSI/IEEE770X3.97-1983will be replaced by the revised ISO 7185. The major revisions to BS6192:1982to produce the new ISO 7185 are: a) resolution of the di(cid:11)erences with ANSI/IEEE770X3.97-1983; b) relaxation of the syntax of real numbers, to allow \digit sequences" rather than \unsigned integers"for the various components; c) in the handling of \end-of-line characters"in text (cid:12)les; d) in the handling of run-time errors. vi INTERNATIONAL STANDARD ISO/IEC 7185:1990(E) Information technology | Programming languages | Pascal 1 Scope 1.1 This International Standard speci(cid:12)es the semantics and syntax of the computer programming language Pascal by specifying requirements for a processor and for a conforming program. Two levels of compliance are de(cid:12)ned for both processorsand 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 speci(cid:12)c data processing system or the capacity of a particular processor, nor the actions to be taken when the corresponding limits are exceeded; b) theminimalrequirementsofadataprocessingsystemthatiscapableofsupportinganimplementation of a processor for Pascal; c) the method of activating the program-block or the set of commands used to control the environment in which a Pascalprogram is transformed and executed; d) the mechanism by which programs written in Pascal are transformed for use by a data processing system; e) the method for reporting errors or warnings; f) the typographical representation of a programpublished for human reading. 2 Normative reference Thefollowingstandardcontainsprovisionswhich,throughreferenceinthistext,constituteprovisions 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 areencouragedtoinvestigatethepossibilityofapplyingthemostrecenteditionofthestandardlisted 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 7185:1990(E) 3 De(cid:12)nitions For the purposes of this International Standard, the following de(cid:12)nitions apply. NOTE |To draw attention to language concepts, some terms are printed in italics on their (cid:12)rst mention or at their de(cid:12)ningoccurrence(s) in thisInternational Standard. 3.1 Error A violation by a program of the requirements of this International Standard that a processor is permitted to leave undetected. NOTES 1Ifitispossibletoconstructaprograminwhichtheviolationornon-violationofthisInternationalStandard requires knowledge of the data read by the program or the implementation de(cid:12)nition of implementation- de(cid:12)ned features, then violation of that requirement is classi(cid:12)ed as 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 veri(cid:12)edwithout such knowledge are not classi(cid:12)ed 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 detection is provided for implementationsin which the detection would be an excessive burden. 3.2 Extension Amodi(cid:12)cationtoclause6oftherequirementsofthisInternationalStandardthatdoesnotinvalidate any program complying with this International Standard, as de(cid:12)ned by 5.2, except by prohibiting the use of one or more particular spellings of identi(cid:12)ers (see 6.1.2and 6.1.3). 3.3 Implementation-de(cid:12)ned Possibly di(cid:11)ering between processors,but de(cid:12)ned for any particular processor. 3.4 Implementation-dependent Possibly di(cid:11)ering between processors and not necessarily de(cid:12)ned for any particular processor. 3.5 Processor Asystemormechanismthatacceptsaprogramasinput, preparesit forexecution,andexecutesthe process so de(cid:12)ned with data to produce results. NOTE |Aprocessormayconsistofaninterpreter,acompilerandrun-timesystem,oranothermechanism, together with an associated host computing machine and operating system, or another mechanism for achieving thesame e(cid:11)ect. A compilerin itself, for example,does not constitutea processor. 2 ISO/IEC 7185:1990(E) Table 1 | Metalanguage symbols Metasymbol Meaning = Shall be de(cid:12)ned to be > Shall have as an alternative de(cid:12)nition | Alternatively . End of de(cid:12)nition [ x ] 0 or 1 instance of x { x } 0 or more instances of x ( x | y ) Grouping: either of x or y ‘xyz’ The terminal symbol xyz meta-identi(cid:12)er A nonterminal symbol 4 De(cid:12)nitional 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 modi(cid:12)ed 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 speci(cid:12)cation of the constructs is given by prose and, in some cases, by equivalent program fragments. Any identi(cid:12)er that is de(cid:12)ned in clause 6 as a required identi(cid:12)er 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-identi(cid:12)er 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. ThecharactersrequiredtoformPascalprogramsshallbethoseimplicitlyrequiredtoformthetokens and separators de(cid:12)ned 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 de(cid:12)ning 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 indirectly derived; |the y closest-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 speci(cid:12)cations apply. In addition to the normal English rules for hyphenation, hyphenation is used in this International 3 ISO/IEC 7185:1990(E) Standard to form compound words that represent meta-identi(cid:12)ers, semantic terms, or both. All meta-identi(cid:12)ers that contain more than one word are written as a unit with hyphens joining the parts. Semantic terms ending 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. NOTESareincluded inthisInternationalStandard onlyforpurposesofclari(cid:12)cation,andaidin the use of the standard. NOTESare informativeonly and arenot a part of the InternationalStandard. Examples in this International Standard are equivalent to NOTES. 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 processorcomplying with the requirements of this International Standard shall a) if it compliesat level0, acceptallthe featuresof the languagespeci(cid:12)ed in clause 6, except for 6.6.3.6 e), 6.6.3.7,and 6.6.3.8,with the meanings de(cid:12)ned in clause 6; b) if it complies at level 1, accept all the features of the language speci(cid:12)ed in clause 6 with the meanings de(cid:12)ned 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 speci(cid:12)ed in clause 6; d) beaccompaniedbyadocumentthatprovidesade(cid:12)nitionofallimplementation-de(cid:12)nedfeatures; e) beabletodeterminewhetherornottheprogramviolatesanyrequirementsofthisInternational Standard,wheresuchaviolationisnotdesignatedanerror,reporttheresultofthisdetermination totheuseroftheprocessorbeforetheexecutionoftheprogram-block,ifany,andshallprevent execution of the program-block,if any; f) treat each violation that is designated an errorin at least one of the following ways 1) there shall be a statement in an accompanying document that the error is not reported, and a note referencing each such statement shall appear in a separate section of the accompanying document; 2) the processor shall report the error or the possibility of the error 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; 3) the processor shall report the errorduring execution of the program; and if an error is reported during execution of the program, the processor shall terminate execution; if an error occurs within a statement, the execution of that statement shall not be 4

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.