Napier88 Reference Manual Release 2.2.1
Total Page:16
File Type:pdf, Size:1020Kb
Napier88 Reference Manual Release 2.2.1 July 1996 Ron Morrison Fred Brown* Richard Connor Quintin Cutts† Alan Dearle‡ Graham Kirby Dave Munro University of St Andrews, North Haugh, St Andrews, Fife KY16 9SS, Scotland. *Department of Computer Science, University of Adelaide, South Australia 5005, Australia. †University of Glasgow, Lilybank Gardens, Glasgow G12 8QQ, Scotland. ‡University of Stirling, Stirling FK9 4LA, Scotland. This document should be referenced as: “Napier88 Reference Manual (Release 2.2.1)”. University of St Andrews (1996). Contents 1 INTRODUCTION ............................................................................. 5 2 CONTEXT FREE SYNTAX SPECIFICATION.......................................... 8 3 TYPES AND TYPE RULES ................................................................ 9 3.1 UNIVERSE OF DISCOURSE...............................................................................................9 3.2 THE TYPE ALGEBRA..................................................................................................... 10 3.2.1 Aliasing............................................................................................................... 10 3.2.2 Recursive Definitions............................................................................................. 10 3.2.3 Type Operators...................................................................................................... 11 3.2.4 Recursive Operators ............................................................................................... 11 3.3 TYPE EQUIVALENCE..................................................................................................... 12 3.4 TYPE RULES ............................................................................................................... 12 3.5 FIRST CLASS CITIZENSHIP............................................................................................ 13 4 LITERALS....................................................................................14 4.1 INTEGER LITERALS ...................................................................................................... 14 4.2 REAL LITERALS........................................................................................................... 14 4.3 BOOLEAN LITERALS ..................................................................................................... 14 4.4 STRING LITERALS........................................................................................................ 14 4.5 PIXEL LITERALS.......................................................................................................... 15 4.6 PICTURE LITERAL........................................................................................................ 15 4.7 NULL LITERAL ............................................................................................................ 15 4.8 PROCEDURE LITERALS................................................................................................. 15 4.9 IMAGE LITERAL........................................................................................................... 16 4.10 FILE LITERAL............................................................................................................ 16 5 EXPRESSIONS AND OPERATORS .....................................................17 5.1 EVALUATION ORDER.................................................................................................... 17 5.2 BOOLEAN EXPRESSIONS ............................................................................................... 17 5.3 COMPARISON OPERATORS............................................................................................ 18 5.4 ARITHMETIC EXPRESSIONS........................................................................................... 19 5.5 ARITHMETIC PRECEDENCE RULES ................................................................................. 20 5.6 STRING EXPRESSIONS.................................................................................................. 20 5.7 PICTURE EXPRESSIONS ................................................................................................ 21 5.8 PIXEL EXPRESSIONS .................................................................................................... 22 5.9 THE PERSISTENT STORE ............................................................................................... 23 5.10 PRECEDENCE TABLE .................................................................................................. 23 6 DECLARATIONS............................................................................25 6.1 IDENTIFIERS ............................................................................................................... 25 6.2 VARIABLES, CONSTANTS AND DECLARATION OF DATA OBJECTS ....................................... 25 6.3 DECLARATION OF TYPES .............................................................................................. 26 6.4 SEQUENCES................................................................................................................ 26 6.5 BRACKETS.................................................................................................................. 27 6.6 SCOPE RULES ............................................................................................................. 27 6.7 RECURSIVE OBJECT DECLARATIONS.............................................................................. 27 6.8 RECURSIVE TYPE DECLARATIONS.................................................................................. 28 7 CLAUSES.....................................................................................29 7.1 ASSIGNMENT CLAUSE .................................................................................................. 29 7.2 IF CLAUSE.................................................................................................................. 29 7.3 CASE CLAUSE ............................................................................................................. 30 7.4 REPEAT ... WHILE ... DO CLAUSE.................................................................................... 30 7.5 FOR CLAUSE............................................................................................................... 31 8 PROCEDURES...............................................................................32 8.1 DECLARATIONS AND CALLS .......................................................................................... 32 8.2 RECURSIVE DECLARATIONS.......................................................................................... 33 8.3 POLYMORPHISM ......................................................................................................... 33 8.4 EQUALITY AND EQUIVALENCE ....................................................................................... 34 9 AGGREGATES...............................................................................35 9.1 VECTORS ................................................................................................................... 35 9.1.1 Creation of Vectors................................................................................................ 35 9.1.2 upb and lwb.......................................................................................................... 36 9.1.3 Indexing............................................................................................................... 37 9.1.4 Equality and Equivalence......................................................................................... 37 9.2 STRUCTURES.............................................................................................................. 37 9.2.1 Creation of Structures............................................................................................. 37 9.2.2 Indexing............................................................................................................... 38 9.2.3 Equality and Equivalence......................................................................................... 38 9.3 IMAGES...................................................................................................................... 39 9.3.1 Creation of Images................................................................................................. 39 9.3.2 Raster Operations .................................................................................................. 39 9.3.3 Indexing............................................................................................................... 41 9.3.4 Depth Selection..................................................................................................... 41 9.3.5 Equality and Equivalence......................................................................................... 42 10 VARIANTS..................................................................................43 10.1 VARIANT TYPES ........................................................................................................ 43 10.2 VARIANT VALUES ...................................................................................................... 43 10.3 IS AND ISNT............................................................................................................... 43 10.4 PROJECTION OUT OF VARIANTS ..................................................................................