1、International Standard I 538 INTERNATIONAL ORGANIZATION FOR STANDAROIZATIONOMEWYHAPOAHAfl OPrAHHJAUHfl no CTAHAAFTH3AUHM)RGANlSATlON INTERNATIONALE DE NORMALISATION Programming languages - ALGOL 60 L Langages de programmation ALGOL 60 First edition - 1984-10-15 i 1 ob UDC 681.3.06 : 800.92 Descripto
2、rs : programming languages, algol, specifications. Ref. No. IS0 1538-1984 (E) Price based on 18 pages Foreword IS0 (the International Organization for Standardization) is a worldwide federation of national standards bodies (IS0 member bodies). The work of preparing International Standards is normall
3、y carried out through IS0 technical committees. Every member body interested in a subject for which a technical committee has been established has the right to be represented on that committee. International organizations, govern- mental and non-governmental, in liaison with ISO, also take part in t
4、he work. Draft International Standards adopted by the technical committees are circulated to the member bodies for approval before their acceptance as International Standards by the IS0 Council. They are approved in accordance with IS0 procedures requiring at least 75 % approval by the member bodies
5、 voting. International Standard IS0 1538 was prepared by Technical Committee ISO/TC 97, ln- formation processing systems. This International Standard replaces ISO/R 1538 (withdrawn in 1977) of which it con- stitutes a revision. IS0 Recommendation 1538 was a compilation of several source documents. T
6、he basic one developed under the auspices of the International Federation for Information Pro- cessing (IFIP), whose contributions are acknowledged1 was the Revised Report on the Algorithmic Language ALGOL 60. The text presented in this International Standard is based on the Modified Report on the A
7、lgorithmic Language ALGOL 60, which is a minor technical revision and a textual clarification of the Revised Report, as established by IFIP. For reasons of IS0 editorial policy the original introduction which is irrelevant to an International Standard has been deleted and some introductory clauses h
8、ave been added instead. O International Organization for Standardization, 1984 Printed in Switzerland INTERNATIONAL STANDARD IS0 1538-1984 (E) Programming Languages - ALGOL 60 O Introduction In this International Standard consistent use is made of ALGOL60 as the name of the language, rather than jus
9、t ALGOL, in order to avoid confusion with ALGOL 68 which is a completely different language. It is recommended that the language defined in this International Standard be referred to as STANDARD ALGOL 60. kc Whenever the name ALGOL is used in this International Stan- dard it is to mean ALGOL 60, not
10、 ALGOL 68, unless it is clear from the context that no specific language is indicated. 1 Scope and field of application This International Standard defines the algorithmic program- ming language ALGOL 60. Its purpose is to facilitate inter- change and promote portability of ALGOL 60 programs be- twe
11、en data processing systems. ALGOL 60 is intended for expressing a large class of numerical processes in a form sufficiently concise for direct automatic translation into the language of programmed automatic com- puters. i- This International Standard specifies: a) the syntax and semantics of ALGOL 6
12、0; b) characteristics of programs written in ALGOL 60, and of implementations of that language, required for confor- mance to this International Standard. This International Standard does not specify: a) left undefined or said to be undefined; results of processes or other issues, that are, explicit
13、ly, b) questions of hardware representation (these may be the subject of another International Standard), or of implemen- tation; c) this will be reported; the way non-valid programs are to be rejected, and how d) actual data processing system. requirements and rules for executing programs on an 2 R
14、eference ISOiTR 1672, Hardware representation of ALGOL basic sym- bols in the IS0 7-bit coded character set for information pro- cessing interchange. 3 Definitions For the purpose of this International Standard the following definitions apply: 3.1 valid program: A text written in the ALGOL 60 langua
15、ge that conforms to the rules for a program defined in this International Standard. 3.2 was intended to be a program. non-valid program: A text that does not conform, but 3.3 processor: A compiler, translator or interpreter, in com- bination with a data processing system, that accepts an in- tended
16、program, transcribed in a form that can be processed by that data processing system, reports whether the intended pro- gram is valid or not, and if valid executes it, if that is being requested. 3.4 ments that describe implementation : A processor, accompanied with docu- a) ware) in which it will wo
17、rk; its purpose, and the environment (hardware and soft- b) its intended properties, including - the particular hardware representation of the language, as chosen; the actions taken, when results or issues occur that are undefined in this International Standard; - - conventions for issues said to be
18、 a question of implementation ; 1 IS0 1538-1984 (E) c) with regard to the implemented language, all dif- ferences from, restrictions to, or extensions to the language defined in this International Standard; d) its logical structure; e) the way to put it into use. 3.5 conforming implementation : An i
19、mplementation con- forming to this International Standard by accepting valid pro- grams as being valid, by rejecting non-valid programs as being non-valid and by executing valid programs in accordance with the given rules. 3.6 as defined by the implementation. implemented language: The version of th
20、e language 3.7 conforming language version: A version of the language, defined by a conforming implementation that a) in this International Standard; does not contain any rule conflicting with those defined b) does not contain any rule not provided for in this Inter- national Standard, except such r
21、ules as, either said to be in- tentionally and explicitly a question of implementation, or otherwise being outside the scope of this International Standard. 3.8 extension : A rule in the implemented language that a) is not given in this International Standard; b) does not cause any ambiguity when ad
22、ded to this Inter- national Standard (but may serve to remove a restriction); c) is within the scoDe of this International Standard. 4 Conformance 4.1 Requirements Conformance to this International Standard requires a) for a program, that it shall be a valid program; b) plementation ; for an impleme
23、ntation, that it shall be a conforming im- c) forming language version. for the implemented language, that it shall be a con- 4.2 Quantitative restrictions The requirements specified in 4.1 shall allow for quantitative restrictions to rules stated or implied as having no such restric- tion in this I
24、nternational Standard, but only if they are fully described in the documents with the implementation. 4.3 Extensions An implementation that allows for extensions in the im- plemented language is considered to conform to this Interna- tional Standard, notwithstanding 4.1, if a) it would conform when
25、the extensions were omitted; b) tation ; the extensions are clearly described with the implemen- c) while accepting programs that are non-valid according to the rules given in clause 6 of this International Standard, it provides means for indicating which part, or parts, of a program would have led
26、to its rejection, had no extension been allowed. Valid programs using extensions shall be described as “con- forming to IS0 1538 but for the following indicated parts“. 4.4 Subsets Conformance to a subset specified in this International Stan- dard means conformance to the subset rules as if they wer
27、e the only rules in the language. 5 Tests Whether an implementation is a conforming implementation or the implemented language is a conforming language version may be decided by a sequence of test programs. If there is any uncertainty or doubt regarding acceptance of these programs then the conclusi
28、ons drawn from the actual behaviour of the processor will prevail over those derived from its accompanying documents. 6 Description of the reference language The detailed description of the reference language given herein reproduces, without modification, the text taken from the Modified Report (see
29、 the foreword), the contents of which are the following : 1 Structure of the language 1.1 Formalism for syntactic description -d 2 concepts 2.1 Letters 2.2 Digits and logical values 2.3 Delimiters 2.4 Identifiers 2.5 Numbers 2.6 Strings 2.7 Quantities, kinds and scopes 2.8 Values and types Basic sym
30、bols, identifiers, numbers, and strings. Basic 2 IS0 1538-1984 (E) 3 Expressions 3.1 Variables 3.2 Function designators 3.3 Arithmetic expressions 3.4 Boolean expressions 3.5 Designational expressions 4 Statements 4.1 Compound statements and blocks 4.2 Assignment statements 4.3 GO to statements 4.4
31、Dummy statements 4.5 Conditional statements 4.6 For statements 4.7 Procedure statements 5 Declarations 5.1 Type declarations 5.2 Array declarations 5.3 Switch declarations 5.4 Procedure declarations L Appendix 1 - Subsets Appendix 2 - The environmental block Bibliography Alphabetic index of definiti
32、ons of concepts and syntactic units I. Structure of the language The algorithmic language has two different kinds of representation- reference and hardwars-and the development described in the sequel is in terms of the reference representation. This means that all objects defined within the language
33、 are represented by a given set of symbols-and it is only in the choice of symbols that other repre- sentations may differ. Structure and content must be the same for all representations. Reference language 1. It is the defining language. 2. The characters are determined by ease of mutual understand
34、ing and not by any computer limitations, coders notation, or pure mathematical notation. 3. It is the basic reference and guide for compiler builders. 4. It is the guide for all hardware representations. Hardwure represenfntions Each one of these: 1. is a condensation of the reference language enfor
35、ced by the 2. uses the character set of a particular computer and is the language 3. must be accompanied by a special set of rules for transliterating to It should be particularly noted that throughout the reference language underlining in typescript or manuscript, or boldface type in printed copy,
36、is used to represent certain basic symbo!s (see Sections 2.2.2 and 2.3). These are understood to have no relation to the individual letters of which they are composed. In the reference language underlining or boldface is used for no other purpose. The purpose of the algorithmic language is to descri
37、be compu- tational processes. The basic concept used for the description of calculating rules is the well-known arithmetic expression containing as constituents numbers, variables, and functions. From such expressions are compounded, by applying rules of arithmetic composition, self-contained units
38、of the language-explicit formulae -called assignment statements. To show the flow of computational processes, certain non-arith- metic statements and statement clauses are added which may describe, e.g. alternatives, or iterative repetitions of computing statements. Since it is sometimes necessary f
39、or the function of these statements that one statement refers to another, statements may be provided with labels. A sequence of statements may be enclosed between the statement brackets begin and end to form a compound statement. Statements are supported by declarations which are not themselves comp
40、uting instructions, but inform the translator of the existence and certain properties of objects appearing in statements, such as the class of numbers taken on as values by a variable, the dimension of an array of numbers, or even the set of rules defining a function. A sequence of declarations foll
41、owed by a sequence of statements and enclosed between begin and end constitutes a block. Every decla- ration appears in a block in this way and is valid only for that block. A program is a block or a compound statement that is contained only within a fictitious block (always assumed to be present an
42、d called the environmental block), and that makes no use of statements or declarations not contained within itself, except that it may invoke such procedure identifiers and function designators as may be assumed to be declared in the environmental block. The environmental block contains . procedure
43、declarations of standard functions, input and output operations, and possibly other limited number of characters on standard input equipment; accepted by a translator for that computer; or from reference language. 3 IS0 1538-1984 (E) operations to be made u:.ailable without declaration within the pr
44、ogram. It also contains the fictitious declaration, and initialisation, of own variables (see Section 5). In the sequel the syntax and semantics of the language will be given. Whenever the precision of arithmetic is stated as being in general not specified, or the outcome of a certain process is lef
45、t undefined or said to be undefined, this is to be interpreted in the sense that a program only fully defines a computational process if the accom- panying information specifies the precision assumed, the kind of arithmetic assumed, and the course of action to be taken in all such cases as may occur
46、 during the execution of the computation. 1.1. Formalism for syntactic description The syntax will be described with the aid of metalinguistic formulae (Backus, 1959). Their interpretation is best explained by an example: Sequences of characters enclosed in the brackets ( represent metalinguistic va
47、riables whose values are sequences of symbols. The marks : = and 1 (the latter with the meaning of or) are metalin- guistic connectives. Any mark in a formula, which is not a variable or a connective, denotes itself (or the class of marks which are similar to it). Juxtaposition of marks and/or varia
48、bles in a formula signifies juxtaposition of the sequences denoted. Thus the formula above gives a recursive rule for the formation of values of the vari- able (ab). It indicates that (ab) may have the value ( or or that given some legitimate value of (ab), another may be formed by following it with
49、 the character ( or by following it with some value of the variable (d). If the values of (d) are the decimal digits, some values of (ab) are: (1(37( (12345( ( 186 In order to facilitate the study, the symbols used for distinguishing the metalinguistic variables (i.e. the sequences of characters appear- ing within the brackets () as ab in the above example) have been chosen to be words describing approximately the nature of the corresponding variable. Where words which have appeared in this manner are used elsewhere in the text they will refer to the corres- ponding synta
copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
备案/许可证编号:苏ICP备17064731号-1