BS 5905-1980 Specification for computer programming language CORAL 66《计算机程序设计语言CORAL66规范》.pdf

上传人:lawfemale396 文档编号:545476 上传时间:2018-12-09 格式:PDF 页数:42 大小:651.32KB
下载 相关 举报
BS 5905-1980 Specification for computer programming language CORAL 66《计算机程序设计语言CORAL66规范》.pdf_第1页
第1页 / 共42页
BS 5905-1980 Specification for computer programming language CORAL 66《计算机程序设计语言CORAL66规范》.pdf_第2页
第2页 / 共42页
BS 5905-1980 Specification for computer programming language CORAL 66《计算机程序设计语言CORAL66规范》.pdf_第3页
第3页 / 共42页
BS 5905-1980 Specification for computer programming language CORAL 66《计算机程序设计语言CORAL66规范》.pdf_第4页
第4页 / 共42页
BS 5905-1980 Specification for computer programming language CORAL 66《计算机程序设计语言CORAL66规范》.pdf_第5页
第5页 / 共42页
亲,该文档总共42页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

1、BRITISH STANDARD BS 5905:1980 Incorporating Amendment No. 1 Specification for Computer programming language CORAL 66 UDC 681.3.06CORAL 66BS5905:1980 This British Standard, having been prepared under the directionof the Data ProcessingStandards Committee,was published underthe authority ofthe Executi

2、ve Board and comes into effect on 31October1980 BSI 04-2000 The following BSI references relate to the work on this standard: Committee reference IST/5 Draft for comment 78/63605 DC ISBN 0 580 11442 2 Cooperating organizations The Data Processing Standards Committee, under whose direction this Briti

3、shStandard was prepared, consists of representatives from the following Government departments and scientific and industrial organizations: British Computer Society Ltd.* British Paper and Board Industry Federation (PIF) British Printing Industries Federation Business Equipment Trade Association* Ce

4、ntral Computer Agency (Civil Service Department)* Committee of London Clearing Bankers on behalf of the Committee of Scottish Clearing Bankers, Co-operative Bank, Central Trustee Savings Bank and Yorkshire Bank Department of Industry (Computers Systems and Electronics) Department of Industry (Nation

5、al Physical Laboratory)* Electricity Supply Industry in England and Wales* Government Communications Headquarters HM Customs and Excise Institute of Cost and Management Accountants Institute of Purchasing and Supply Institution of Electrical Engineers Institution of Mechanical Engineers Inter-univer

6、sity Committee on Computing London Transport Executive Ministry of Defence* National Computer Users Forum National Computing Centre Ltd.* National Research Development Corporation Post Office* Society of British Aerospace Companies Limited The organizations marked with an asterisk in the above list,

7、 together with the following, were directly represented on the committee entrusted with the preparation of this British Standard: Association for Literary and Linguistic Computing Association of Computer Units in Colleges of Higher Education (ACUCHE) British Gas Corporation Computing Services Associ

8、ation Control and Automation Manufacturers Association (BEAMA) Edinburgh Regional Computing Centre Engineering Equipment Users Association Hatfield Polytechnic University of London Amendments issued since publication Amd. No. Date of issue Comments 5079 October 1986 Indicated by a sideline in the ma

9、rginBS5905:1980 BSI 04-2000 i Contents Page Cooperating organizations Inside front cover Foreword ii 1 Scope 1 2 References 1 3 Definitions 1 4 Syntactic metalanguage 1 5 Compliance 2 5.1 Implementations 2 5.2 Programs 8 6 Requirements 8 6.1 The CORAL 66 program 8 6.2 Scoping 9 6.3 References to dat

10、a 10 6.4 Place references: switches 15 6.5 Expressions 15 6.6 Statements 19 6.7 Procedures 23 6.8 Communicators 26 6.9 Names and constants 27 6.10 Processing text in a program 29 6.11 List of language symbols and character set 30 6.12 Permissible options 31 Appendix A Unspecified features 33 Appendi

11、x B Implementation 33 Table 1 Alphabetical list of syntax rules 2 Table 2 Parameters of procedures 24 Table 3 Language words 30 Table 4 Other symbols 31 Publications referred to Inside back coverBS5905:1980 ii BSI 04-2000 Foreword This British Standard has been prepared under the direction of the Da

12、ta Processing Standards Committee and is based on the “Official definition of CORAL 66”, first published in1970 by Her Majestys Stationery Office, and reproduces material taken from that publication. This standard follows some ten years after the “Official definition” and the BSI committee believes

13、that the standard should not contain requirements incompatible with the very large number of existing implementations. For this reason, although a number of proposals for extensions of the language have been considered, their adoption has, in general, been reserved until a future revision of the sta

14、ndard. Two exceptions have, however, been made in this first edition: a) the number denotation HEX has been included (see6.9.2); b) the language words CORAL and SEGMENT have been included to give a formal syntax to a multisegment program (see6.1.3). Future revisions may make fuller provision for byt

15、e-addressable machines with a byte-oriented, but otherwise conformable, language definition. The current requirements assume a word-addressable virtual machine, but some provision for such byte-addressable machines is made inAppendix B. This standard aims to achieve an overall economy, in terms of h

16、uman effort, in the development of computer-based systems for real-time applications and to protect the interests of the user by encouraging the use of computers that comply with this standard. CORAL 66 provides a means of increasing the implementation efficiency of computer applications in environm

17、ents where the input/output communication requirements may not have been standardized and that are time-critical. CORAL66 is a kernel high-level computer language intended to replace a high proportion of assembly code in each specific application. Items not explicitly specified in this standard shou

18、ld be clearly understood as being unspecified. These unspecified items result from an original design objective that CORAL66 should favour all computer architectures as equally as possible and should allow implementors to exploit hardware features as efficiently as possible. The objective is to prom

19、ote the use of a common form of expression whenever it is expedient to do so. The language specification thus explicitly includes both the insertion of machine code statements and anonymous referencing, so as to ensure that special machine features and peripherals can be handled efficiently at the c

20、ost of reduced program portability. Furthermore, implementors are thus able to adopt the hardware conventions of the target machine with regard to numeric representation and computation. The parameterized macro facility enables the source text to retain a high level of readability. CORAL66 therefore

21、 aims to minimize, rather than to eliminate, the consequent machine dependency of programs and to maximize the portability of programming and software maintenance staff. It is virtually impossible to design a standard language such that programs will run with equally high efficiency in all types of

22、computer and in any applications. Much of the design of CORAL66 reflects this difficulty. For example, the language permits the use of non-standard “code statements” for any parts of a program where it may be important to exploit particular hardware facilities. A special feature is scaled fixed-poin

23、t arithmetic for use in small fixed-point machines; the floating-point facilities of the language can be omitted when hardware limitations make the use of floating-point arithmetic uneconomical. Other features can also be omitted without reducing the power of the language to an unacceptably low leve

24、l. Major features that may be omitted are listed in6.12.BS5905:1980 BSI 04-2000 iii A clear distinction needs to be made between general-purpose languages and more limited languages designed to incorporate the inbuilt assumptions of specialized applications or to make direct computer access practica

25、l for the non-specialist user. CORAL66 belongs to the first category. Languages in this class are suitable for writing compilers and interpreters as well as for direct application. Special-purpose languages can therefore be implemented by means of software written in CORAL66, backed up as required w

26、ith suites of specialized macros or procedures. It is largely for this reason that the facilities for using procedures have been kept as general as possible. The main differences between CORAL66 procedures and those of ALGOL60 lie in the replacement of the ALGOL60 dynamic “name parameter” by the mor

27、e efficient “location” or reference parameter used in FORTRAN, and the requirement to declare recursive procedures explicitly as such, again in the interest of object-code efficiency. The theory and structure of programming for real-time computer applications has not yet advanced to a point where a

28、particular choice of language facilities is inevitable. Furthermore, the design of real-time languages is handicapped by the lack of agreed standard software interfaces for applications programmers or compiler writers. This does not imply that real-time programs cannot yet be written in high-level l

29、anguage. The use of CORAL66 in real-time applications implies the presence of a supervisory system for the control of communications, which may have been designed independently of the compiler. The programmers control over external events, and the computers reaction to them, is expressed by the use

30、of procedures or macros that communicate with the outside world indirectly through the agency of the supervisory software. No requirements are specified in this standard regarding the names or action of such calls on the supervisor. Editorial note. It is normal convention in British Standards to use

31、 italic type for algebraic quantities. Since the status of such quantities contained in this standard may or may not directly represent true variable quantities, this convention has not been adopted in this standard. A British Standard does not purport to include all the necessary provisions of a co

32、ntract. Users of British Standards are responsible for 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, pages i to iv, pages1to 34, an inside back co

33、ver and a back cover. This standard has been updated (see copyright date) and may have had amendments incorporated. This will be indicated in the amendment table on the inside front cover.iv blankBS5905:1980 BSI 04-2000 1 1 Scope This British Standard specifies the semantics and syntax of the comput

34、er programming language CORAL66 by specifying requirements for a compiler and for a conforming program. NOTE 1Any feature that is not explicitly specified in this standard has been intentionally left unspecified. Appendix A lists some unspecified features. Appendix B gives additional information reg

35、arding implementation. NOTE 2The examples given among the specification requirements are not intended to add to or detract from the requirements, but are included purely to aid understanding. 2 References The titles of the publications referred to in this standard are listed on the inside back cover

36、. 3 Definitions For the purposes of this British Standard, the following definitions, together with those for other terms given in BS3527, apply. 3.1 layout characters the six “layout characters” and the space character specified in BS4730 3.2 printing characters the graphic characters specified in

37、BS4730 NOTETo draw attention to the language concepts, some terms are printed in italics on their first mention in this standard. 4 Syntactic metalanguage 1) The widespread use of syntax-driven methods of compilation lends increasing importance to syntax methods of language description. This standar

38、d specifies the syntax of CORAL66, and therefore starts with broad structure, working downwards to finer detail. For reasons of legibility, the customary Backus notation has been abandoned in favour of a system relying on typographical layout. Each syntax rule has on its left-hand side a class name,

39、 such as “Statement”. Such names appear in lower case without spaces, and with an initial capital letter. On the right-hand side of a rule are the various alternative expansions for the class name. These alternatives are either each printed on a new line or separated by “or”, as appropriate. Where a

40、 single alternative spreads over more than one line of print, the additional lines are inset in relation to the starting position of the alternative. Each alternative expansion consists of a sequence of items separated by spaces. The items themselves are either further class names or terminal symbol

41、s, such as BEGIN. The class name “Void” is used for an empty class. For example, a typical pair of rules might be Examples of specimens complying with these rules are ALPHA+ and BETA. The equals sign is used to separate the left-hand side from the right, except after its first appearance in a rule.

42、Certain constructs are defined informally in this standard; these are underlined. The syntax rules are listed inTable 1. 1) A British Standard syntactic metalanguage is at an early stage of preparation. Specimen = ALPHA Sign BETA Sign Sign = + p VoidBS5905:1980 2 BSI 04-2000 5 Compliance 5.1 Impleme

43、ntations 5.1.1 Any implementation of CORAL66 that can accept all of the features of the language specified in clause6 and with the meanings defined in clause6 complies with the requirements of this standard. 5.1.2 Except as specifically allowed by6.12, an implementation that omits any of the feature

44、s of the language specified in clause6 or that includes such a feature, but with a meaning altered in any way from that specified in clause6, does not comply with the requirements of this standard. Table 1 Alphabetical list of syntax rules Syntax rule Reference Absolutecommunicator = defined in a pa

45、rticular implementation to conform to the style of the commoncommunicator 6.8.5 Actual = Expression 6.6.4 Wordreference Destination Name Actuallist = Actual 6.6.4 Actual, Actuallist Addoperator = + 6.5.2 p Alternative = Statement 6.6.10 Answerspec = Numbertype 6.7.2 Void Answerstatement = ANSWER Exp

46、ression 6.6.5 Arraydec = Numbertype ARRAY Arraylist Presetlist 6.3.3 Arrayitem = Idlist Sizelist 6.3.3 Arraylist = Arrayitem 6.3.3 Arrayitem, Arraylist Assignmentstatement = Variable D Expression 6.6.2 Base = Id 6.3.8 Id Signedinteger Bitposition = Integer 6.3.4.3.1 Block = BEGIN Declist; Statementl

47、ist END 6.2.1 Booleanword = Booleanword2 6.5.4 Booleanword4 DIFFER Booleanword5 Booleanword2 = Booleanword3 6.5.4 Booleanword5 UNION Booleanword6 Booleanword3 = Booleanword6 MASK Typedprimary 6.5.4 Booleanword4 = Booleanword 6.5.4 Typedprimary Booleanword5 = Booleanword2 6.5.4 Typedprimary Booleanwo

48、rd6 = Booleanword3 6.5.4 Typedprimary Bracketedcomment = (any sequence of characters in which round brackets are matched) 6.10.3 Codesequence = defined in a particular implementation 6.6.6 Codestatement = CODE BEGIN Codesequence END 6.6.6BS5905:1980 BSI 04-2000 3 Table 1 Alphabetical list of syntax

49、rules Syntax rule Reference Commentsentence = COMMENT any sequence of characters not including a semicolon; 6.10.3 Commoncommunicator = COMMON (Commonitemlist) 6.8.2 Commonitem = Datadec 6.8.2 Overlaydec Placespec Procedurespec Void Commonitemlist = Commonitem 6.8.2 Commonitem; Commonitemlist Comparator = or s 6.5.6.2 Comparison = Simpleexpression Comparator Simpleexpression 6.5.6.2 Compoundstatement = BEGIN Statementlist END 6.6.7 Condition = Condition OR Subcondition 6.5.6.2 Subcondition Conditionalexpression = IF Condition 6.5.6.1 THEN Expression ELSE Exp

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 标准规范 > 国际标准 > BS

copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
备案/许可证编号:苏ICP备17064731号-1