Language Definition

Language Definition

SIMULA Standard As defined by the SIMULA Standards Group, 25th August 1986. REMARK: This is an unofficial version of Simula Standard. This document is reassembled from various sources, mainly from the archive after Simula as. It is manually checked against several printed versions. If you need an official version please check this document: Swedish Standard: http://simula67.at.ifi.uio.no/Standard-86/SS636114.pdf Oslo 22. october 2018 Øystein Myhre Andersen Table of Contents 0 General Introduction 0.1 Introduction 0.2 Scope and field of application 0.3 References 0.4 Definitions 0.5 Conformity 0.6 Tests 0.7 Appendices 1 Lexical Tokens 1.1 Directive lines 1.2 The character set 1.3 Special symbols 1.4 Identifiers 1.5 Numbers 1.6 Strings 1.7 Character constants 1.8 Corument convention 1.9 Token separators 1.10 Prograrn interchange and lexical alternatives 2 Types, values and references 2.1 Arithrnetic types 2.2 The type Boolean 2.3 The type character 2.4 Object reference 2.5 The type text 2.6 Type conversion 3 Expressions 3.1 Variables 3.2 Boolean expressions 3.3 Relations 3.4 The logical operators 3.5 Arithhlietic expressions 3.6 Character expressions 3.7 Text expressions 3.8 Object expressions 3.9 Designational expressions 4 Statements 4.1 Assignement statement 4.2 Conditional statement 4.3 While statement 4.4 For statement 4.5 Goto statement 4.6 Procedure statement 4.7 Object generator statement 4.8 Connection statement 4.9 Compound statement 4.10 Blocks 4.11 Dummy statement 5 Declarations 5.1 Simple variable declaration 5.2 Array declaration 5.3 Switch declaration 5.4 Procedure declaration 5.5 Class declaration 5.6 Scope and visibility rules 5.7 Initialisation 5.8 Constant declarations 6 Program modules 6.1 External declarations 6.2 The main program 6.3 External procedure declaration 6.4 External class declaration 6.5 Module identification 7 Sequencing 7.1 Block instances and states of execution 7.2 Quasi-parallel systems 7.3 Quasi-parallel sequencing 7.4 Annotated example 8 Attributes of text 8.1 "constant", "start", "length" and "main" 8.2 Character access 8.3 Text generation 8.4 Subtexts 8.5 Numeric text values 8.6 "De-editing" procedures 8.7 Editing procedures 9 The class environment 9.1 Basic operations 9.2 Text utilities 9.3 Scheduling 9.4 Mathematical ifinctions 9.5 Extremum functions 9.6 Environmental enquiries 9.7 Error control 9.8 Array quantities 9.9 Random drawing 9.10 Calendar and tiining utilities 9.11 Miscellaneous 9.12 Standard system classes 10 Input - Output 10.1 The class "file" 10.2 Structure of file subclasses 10.3 Imagefiles 10.4 The class "infile" 10.5 The class "outfile" 10.6 The class "directfile" 10.7 The class "printlile" 10.8 Bytefiles 10.9 The class "inbytefle" 10.10 The class "outbytefile" 10.11 The class "directbytefile" 11 Class Simset 11.1 Class "linkage" 11.2 Class link 11.3 Class head 12 Class Simulation 12.1 Class process 12.2 Activation statement 12.3 Procedure ACTIVATE 12.4 Sequencing procedures 12.5 The main (simlulation) 12.6 The procedure ACCUM App. A: SIMULA Syntax App. B: Implementation aspects App. C: Index of Syntactic Meta-symbols App. D: Statutes of the SIMULA Standards Group Chapter 0 General Introduction 0. General Introduction SIMULA is a general purpose programming language. It inherits the algorithmic properties of ALGOL 60 and introduces methods for structuring data. The main characteristic of SIMULA is that it is easily modelled towards specialized problem areas, and hence can be used as a basis for Special Application Languages. In this Standard the name SIMULA is considered synonymous with SIMULA 67. Although there exists a predecessor, SIMULA I, this latter language has achieved limited use. It is recommended that the language defined in this Standard be referred to as "Standard SIMULA". SIMULA includes most of the ALGOL 60 language. Wherever ALGOL is used in this Standard it relates to the STANDARD ALGOL 60 definition (ISO 1538). 0.2 Scope and field of application This Standard establishes the definition of the programming language SIMULA and specifies conformity rules to related products, such as programs and processors. Its purpose is to facilitate interchange and promote portability of SIMULA programs between data processing systems. This Standard specifies: a.The syntax, semantics and representation of SIMULA, b.Characteristics of processors (see 4.2.1) and their accompanying documents, and of SIMULA programs, required for conformity to this Standard, c.What is left to the discretion of the implementor, or to be specified for each implementation. This Standard does not specify: a.Results or issues that are explicitly left undefined or said to be undefined, b.How non-valid programs are to be rejected and how this will be reported, c.The relationship of the hypothetical computer, used to explain the actions which constitute the elaboration of a program, to an actual data processing system. 0.3 REFERENCES ISO 646-1973: The 7-bit coded character set for information processing interchange. ISO 1538-1984: Programming languages - ALGOL 60 ISO 2022-1982: ISO 7-bit and 8-bit coded character sets "Common Base Language" by O.-J. Dahl, B. Myhrhaug and K. Nygaard Norwegian Computing Center 1984. (ISBN 82-539-0225-5) 0.4 DEFINITIONS For the purpose of this Standard the following definitions apply. Note: Several terms used in this Standard are explained at the appropriate place in Part II (Description of the language). For convenience some of these have been included here too, at times with a simplified definition. It is understood, however, that no difference of meaning is considered to exist, and all definitions of a term are equivalent. 0.4.1 SIMULA Program 0.4.1.1 Potential program: A text, that is a sequence of characters or typographical marks, meant to be a sequence of tokens constituting a SIMULA program. 0.4.1.2 Valid program: A potential program that is a program according to the rules in this Standard. 0.4.1.3 Non-valid program: A potential program that is not a program but can be turned into one by deleting or inserting a number of symbols. 0.4.1.4 Elaboration of a program: A sequence of actions specified by the semantics to be carried out. 0.4.1.5 SIMULA program: A valid program whose elaboration is defined by this Standard for an indicated class of input data. 0.4.2 SIMULA Processors 0.4.2.1 Processor: A compiler, translator or interpreter, in combination with a data processing system, that accepts a potential program, transcribed in a form that can be processed by that data processing system, reports whether the potential program is valid or not, and if so requested is able to execute it, if it has not rejected it. 0.4.3 SIMULA Implementations 0.4.3.1 Implementation: A well-documented processor is said to establish an implementation of the language SIMULA. 0.4.3.2 Implemented language: The version of the language defined by the implementation. 0.4.3.3 Extension: A rule in the implemented language that a.is not given in this Standard b.does not cause any ambiguity when added to this Standard (but may serve to remove a restriction) c.is within the scope of this Standard. 0.4.3.4 Implementation-defined: What is to be specified for each implementation. 0.4.3.5 Implementation-dependent: What is left to the discretion of the implementor. 0.5 CONFORMITY 0.5.1 Requirements 0.5.1.1 Conforming programs Conformity to this Standard requires for a program that a.it shall be a SIMULA program b.a set of input data shall be given for which it has a defined meaning. 0.5.1.2. Conforming processors Conformity to this Standard requires for a processor that a.it shall accept valid programs as being valid, b.it shall reject non-valid programs as being non-valid, c.it shall not elaborate a SIMULA program differently from what is defined in this Standard, d.it shall be accompanied by documents complying with the requirements below. 0.5.1.3. Documentation It is required for the documents accompanying a conforming processor that these shall describe clearly •its purpose, the name of the implemented language, if not SIMULA, and the environment (hardware and software) in which it will work, •its intended properties, including • the actions taken when results or issues occur, left undefined in this Standard, • conventions for issues said to be implementation-defined, • what is provided for issues declared to be implementation dependent, •all differences between the implemented language and the language defined in Part II of this Standard, •its logical structure, •the way to put it into use. 0.5.1.4. Conforming implementations A conforming implementation shall comply with the above requirements for a processor and its accompanying documents. 0.5.2 Quantitative restrictions The requirements specified in 4.1 shall allow for quantitative restrictions to rules stated or implied as having no such restriction in this Standard, but only if they are fully described in the documents with the implementation. These restrictions are to be considered implementation-defined in as far as they are not dependent of any momentary resource restraint during execution of a program. 0.5.3 Extensions An implementation that allows for extensions in the implemented language is considered to conform to this Standard, notwithstanding 4.1 if a.it would be conforming when the extensions were omitted, b.those extensions are clearly described with the implementation, c.while accepting programs that are non-valid according to the rules given in Part II of this Standard, it provides means for indicating which part, or parts, of a program would have led to its rejection, had no extensions been allowed (cf.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    146 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us