《BS-5905-1980.pdf》由会员分享,可在线阅读,更多相关《BS-5905-1980.pdf(42页珍藏版)》请在三一文库上搜索。
1、BRITISH STANDARD BS 5905:1980 Incorporating Amendment No. 1 Specification for Computer programming language CORAL 66 UDC 681.3.06CORAL 66 Licensed Copy: sheffieldun sheffieldun, na, Mon Dec 04 13:12:06 GMT+00:00 2006, Uncontrolled Copy, (c) BSI BS 5905:1980 This British Standard, having been prepare
2、d under the direction of the Data Processing Standards Committee, was published under the authority of the Executive Board and comes into effect on 31 October 1980 BSI 04-2000 The following BSI references relate to the work on this standard: Committee reference IST/5 Draft for comment 78/63605 DC IS
3、BN 0 580 11442 2 Cooperating organizations The Data Processing Standards Committee, under whose direction this British Standard was prepared, consists of representatives from the following Government departments and scientific and industrial organizations: British Computer Society Ltd.* British Pape
4、r and Board Industry Federation (PIF) British Printing Industries Federation Business Equipment Trade Association* Central Computer Agency (Civil Service Department)* Committee of London Clearing Bankers on behalf of the Committee of Scottish Clearing Bankers, Co-operative Bank, Central Trustee Savi
5、ngs Bank and Yorkshire Bank Department of Industry (Computers Systems and Electronics) Department of Industry (National Physical Laboratory)* Electricity Supply Industry in England and Wales* Government Communications Headquarters HM Customs and Excise Institute of Cost and Management Accountants In
6、stitute of Purchasing and Supply Institution of Electrical Engineers Institution of Mechanical Engineers Inter-university Committee on Computing London Transport Executive Ministry of Defence* National Computer Users Forum National Computing Centre Ltd.* National Research Development Corporation Pos
7、t Office* Society of British Aerospace Companies Limited The organizations marked with an asterisk in the above list, together with the following, were directly represented on the committee entrusted with the preparation of this British Standard: Association for Literary and Linguistic Computing Ass
8、ociation of Computer Units in Colleges of Higher Education (ACUCHE) British Gas Corporation Computing Services Association Control and Automation Manufacturers Association (BEAMA) Edinburgh Regional Computing Centre Engineering Equipment Users Association Hatfield Polytechnic University of London Am
9、endments issued since publication Amd. No.Date of issueComments 5079October 1986Indicated by a sideline in the margin Licensed Copy: sheffieldun sheffieldun, na, Mon Dec 04 13:12:06 GMT+00:00 2006, Uncontrolled Copy, (c) BSI BS 5905:1980 BSI 04-2000i Contents Page Cooperating organizationsInside fro
10、nt cover Forewordii 1Scope1 2References1 3Definitions1 4Syntactic metalanguage1 5Compliance2 5.1Implementations2 5.2Programs8 6Requirements8 6.1The CORAL 66 program8 6.2Scoping9 6.3References to data10 6.4Place references: switches15 6.5Expressions15 6.6Statements19 6.7Procedures23 6.8Communicators2
11、6 6.9Names and constants27 6.10 Processing text in a program29 6.11 List of language symbols and character set30 6.12 Permissible options31 Appendix A Unspecified features33 Appendix B Implementation33 Table 1 Alphabetical list of syntax rules2 Table 2 Parameters of procedures24 Table 3 Language wor
12、ds30 Table 4 Other symbols31 Publications referred toInside back cover Licensed Copy: sheffieldun sheffieldun, na, Mon Dec 04 13:12:06 GMT+00:00 2006, Uncontrolled Copy, (c) BSI BS 5905:1980 ii BSI 04-2000 Foreword This British Standard has been prepared under the direction of the Data Processing St
13、andards Committee and is based on the “Official definition of CORAL 66”, first published in 1970 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 that the standa
14、rd 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 standard. Two exce
15、ptions have, however, been made in this first edition: a) the number denotation HEX has been included (see 6.9.2); b) the language words CORAL and SEGMENT have been included to give a formal syntax to a multisegment program (see 6.1.3). Future revisions may make fuller provision for byte-addressable
16、 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 in Appendix B. This standard aims to achieve an overall economy, in terms of human effort,
17、 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 environments where t
18、he input/output communication requirements may not have been standardized and that are time-critical. CORAL 66 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 should be clear
19、ly understood as being unspecified. These unspecified items result from an original design objective that CORAL 66 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 promote the us
20、e 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 cost of red
21、uced 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. CORAL 66 therefore aims to
22、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 computer
23、and in any applications. Much of the design of CORAL 66 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-point arithm
24、etic 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 level. Major
25、 features that may be omitted are listed in 6.12. Licensed Copy: sheffieldun sheffieldun, na, Mon Dec 04 13:12:06 GMT+00:00 2006, Uncontrolled Copy, (c) BSI BS 5905:1980 BSI 04-2000iii A clear distinction needs to be made between general-purpose languages and more limited languages designed to incor
26、porate the inbuilt assumptions of specialized applications or to make direct computer access practical for the non-specialist user. CORAL 66 belongs to the first category. Languages in this class are suitable for writing compilers and interpreters as well as for direct application. Special-purpose l
27、anguages can therefore be implemented by means of software written in CORAL 66, backed up as required with 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 CORAL 66 p
28、rocedures and those of ALGOL 60 lie in the replacement of the ALGOL 60 dynamic “name parameter” by the more 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
29、 and structure of programming for real-time computer applications has not yet advanced to a point where a 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 programm
30、ers or compiler writers. This does not imply that real-time programs cannot yet be written in high-level language. The use of CORAL 66 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.
31、 The programmers control over external events, and the computers reaction to them, is expressed by the use 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
32、action of such calls on the supervisor. Editorial note. It is normal convention in British Standards to use 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 ad
33、opted in this standard. A British Standard does not purport to include all the necessary provisions of a contract. 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
34、This document comprises a front cover, an inside front cover, pages i to iv, pages 1 to 34, an inside back cover 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. Li
35、censed Copy: sheffieldun sheffieldun, na, Mon Dec 04 13:12:06 GMT+00:00 2006, Uncontrolled Copy, (c) BSI iv blank Licensed Copy: sheffieldun sheffieldun, na, Mon Dec 04 13:12:06 GMT+00:00 2006, Uncontrolled Copy, (c) BSI BS 5905:1980 BSI 04-20001 1 Scope This British Standard specifies the semantics
36、 and syntax of the computer programming language CORAL 66 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
37、additional information regarding 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 liste
38、d on the inside back cover. 3 Definitions For the purposes of this British Standard, the following definitions, together with those for other terms given in BS 3527, apply. 3.1 layout characters the six “layout characters” and the space character specified in BS 4730 3.2 printing characters the grap
39、hic characters specified in BS 4730 NOTETo draw attention to the language concepts, some terms are printed in italics on their first mention in this standard. 4 Syntactic metalanguage1) The widespread use of syntax-driven methods of compilation lends increasing importance to syntax methods of langua
40、ge description. This standard specifies the syntax of CORAL 66, 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
41、 left-hand side a class name, 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
42、“or”, as appropriate. Where a 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 c
43、lass names or terminal symbols, 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 it
44、s first appearance in a rule. Certain constructs are defined informally in this standard; these are underlined. The syntax rules are listed in Table 1. 1) A British Standard syntactic metalanguage is at an early stage of preparation. Specimen= ALPHA Sign BETA Sign Sign= + p Void Licensed Copy: sheff
45、ieldun sheffieldun, na, Mon Dec 04 13:12:06 GMT+00:00 2006, Uncontrolled Copy, (c) BSI BS 5905:1980 2 BSI 04-2000 5 Compliance 5.1 Implementations 5.1.1 Any implementation of CORAL 66 that can accept all of the features of the language specified in clause 6 and with the meanings defined in clause 6
46、complies with the requirements of this standard. 5.1.2 Except as specifically allowed by 6.12, an implementation that omits any of the features of the language specified in clause 6 or that includes such a feature, but with a meaning altered in any way from that specified in clause 6, does not compl
47、y with the requirements of this standard. Table 1 Alphabetical list of syntax rules Syntax ruleReference Absolutecommunicator=defined in a particular implementation to conform to the style of the commoncommunicator 6.8.5 Actual=Expression6.6.4 Wordreference Destination Name Actuallist=Actual6.6.4 Ac
48、tual, Actuallist Addoperator=+6.5.2 p Alternative=Statement6.6.10 Answerspec=Numbertype6.7.2 Void Answerstatement=ANSWER Expression6.6.5 Arraydec=Numbertype ARRAY Arraylist Presetlist6.3.3 Arrayitem=Idlist Sizelist6.3.3 Arraylist=Arrayitem6.3.3 Arrayitem, Arraylist Assignmentstatement=Variable D Exp
49、ression6.6.2 Base=Id6.3.8 Id Signedinteger Bitposition=Integer6.3.4.3.1 Block=BEGIN Declist; Statementlist END6.2.1 Booleanword=Booleanword26.5.4 Booleanword4 DIFFER Booleanword5 Booleanword2=Booleanword36.5.4 Booleanword5 UNION Booleanword6 Booleanword3=Booleanword6 MASK Typedprimary6.5.4 Booleanword4=Booleanword6.5.4 Typedprimary Booleanword5=Booleanword26.5.4 Typedprimary Booleanword6=Booleanword36.5.4 Typedprimary Bracketedcomment=(any sequence of characters in which round brackets are matched) 6.10.3 Codesequence=defined in a particular implementation6.6.6
链接地址:https://www.31doc.com/p-3772404.html