PASCAL on EMAS -------------- CONTENTS 1. INTRODUCTION 2. COMPILATION 2.1 Compilation Options 2.2 Compilation Listings 3. EXECUTION 3.1 Use of Input and Output Media 3.2 The Standard PASCAL Files INPUT and OUTPUT 3.3 Separate Compilation of PASCAL Procedures and Functions 3.4 Mixed Language Programming 4. BASIC ERROR ACTION 4.1 Error Reporting 4.2 Compile-time Control 4.3 Restrictions and Limitations 5. EMAS 2900 PASCAL 5.1 Lexical Conventions 5.2 Language Restrictions 5.3 Language Extensins 5.4 The Program Heading and External Files 5.5 Hardware Representation 5.6 The Standard Procedure WRITE Appendix 1 Compilation error messages Appendix 2 Execution Error Messages 1. INTRODUCTION The 2900 PASCAL Compiler is based on the "PASCAL User Manual and Report" (2nd Edition) by Kathleen Jensen and Nicklaus Wirth. The language implemented conforms to the standard defined there, subject to the restrictions, extensions and further specifications given in this documentation. The EMAS 2900 PASCAl compiler was developed by Southampton University and is distributed by ICL. PASCAL version 20 is currently in use. 2. COMPILATION The command used to compile a PASCAL source program is PASCAL(,/.NULL,/.NULL) The three parameters are: 1. The name of the source file containing the program or routines to be compiled. Several files can be concatenated with the "+" operator; for example A+B+C. 2. The name of the object file to be generated by the compiler. If a file of the given name exists it will be overwritten, if not a file will be created. The keyword .NULL is a valid alternative if no object file is required. This is a useful facility if the program is known to contain faults, since it reduces the compilation time. Note that this parameter cannot be a member of a partitioned file. An object file can, however, be copied into a partitioned file and used from there. 3. The name of a listing file or device. If this parameter is omitted a file created by the Subsystem with the name T#LIST will be used. Valid alternatives include output devices. Again, .NULL can be used if no listing is required. Note that T#LIST is destroyed when the user logs off, and is overwritten if used in another compilation in the current session. eg. PASCAL(PTEST,PTESTY,.OUT) 2.1 Compilation Options The user can select various options for the PASCAL compilation process, for which default settings are provided. Global options are effective throughout the compilation process. They are specified by the EMAS PARM command (see 'EMAS 2900 Users' Guide', 11-2) or by global PASCAL directives, which override any set by the PARM command. Local options can be changed during the compilation process and are specified by local PASCAL directives. Some local options can be switched on/off al global level, using global directives. If a local option is switched off globally, it is permanently off, i.e. all relevant local directives are ignored. The following table summarises the options available, with defaults specified first. Each option is detailed in 2.1.2 - 2.1.4. GLOBAL OPTIONS %CHARCODE=ISO/EBCDIC or PARM(ISO/EBCDIC) %DIAGLINEMAP=YES/NO or default/PARM(NODIAG) %DIAGNAMETABLE=YES/NO or default/PARM(NODIAG) %SOURCE=YES/NO or default/PARM(NOLIST) %RANGECHECKS=YES/NO or default/PARM(NOCHECK) PARM with no parameters resets the defaults. LOCAL OPTIONS %SOURCE ON/OFF %RANGECHECKS ON/OFF %KEYEDENTRY ON/OFF (see also 3.3) %RHMARGIN where 1<=n<=96 (96 default) 2.1.1 Syntax of PASCAL Directives Each PASCAL directive occupies a single line of the source program and begins with the character % in the first position. A PASCAL directive line is not considered to be part of the source program and syntactically incorrect or misplaced directives are ignored. In a directive line, any text to the right of the directive proper and clearly separated from it, for example by blanks, will be ignored. The syntax of a directive depends on its status as global or local. A global directive takes the form: %