DEC Pascal Language Reference Manual

*HyperReader

CONTENTS

  Title Page

  Copyright Page

  Preface

  New and Changed Features

  1      Language Elements
    1.1 Pascal Language Standards
      1.1.1      Unextended Pascal Standards
      1.1.2      Extended Pascal Standard
    1.2 Lexical Elements
      1.2.1      Character Set
      1.2.2      Preprocessor Support (On Digital UNIX systems only)
      1.2.3      Special Symbols
      1.2.4      String Delimiters
      1.2.5      Embedded String Constants
      1.2.6      Reserved Words
      1.2.7      Identifiers
    1.3 Comments
    1.4 Page Breaks and Form Feeds in Programs

  2      Data Types and Values
    2.1 Ordinal Types
      2.1.1      Integer Types
        2.1.1.1      INTEGER and INTEGER64 Types
        2.1.1.2      UNSIGNED and UNSIGNED64 Types
        2.1.1.3      Integer Literals
        2.1.1.4      INTEGER_ADDRESS
      2.1.2      CHAR Type
      2.1.3      BOOLEAN Type
      2.1.4      Enumerated Types
      2.1.5      Subrange Types
    2.2 Real Types
    2.3 Pointer Types
      2.3.0.1      Array Components
      2.3.1      POINTER Type
    2.4 Structured Types
      2.4.1      ARRAY Types
        2.4.1.1      ARRAY Components
        2.4.1.2      ARRAY Constructors
      2.4.2      RECORD Types
        2.4.2.1      Records with Variants
        2.4.2.2      Record Constructors
      2.4.3      SET Type
        2.4.3.1      Set Constructors
      2.4.4      FILE Type
      2.4.5      TEXT Type
      2.4.6      Nonstandard Constructors
        2.4.6.1      Nonstandard Array Constructors
        2.4.6.2      Nonstandard Record Constructors
    2.5 Schema Types
    2.6 String Types
      2.6.1      PACKED ARRAY OF CHAR Types
      2.6.2      VARYING OF CHAR Types
      2.6.3      STRING Schema Type
    2.7 Null-Terminated Strings
    2.8 TIMESTAMP Type
    2.9 Static and Nonstatic Types
    2.10 Type Compatibility
      2.10.1     Structural Compatibility
      2.10.2     Assignment Compatibility

  3      The Declaration Section
    3.1 The CONST Section
    3.2 The LABEL Section
    3.3 The TO BEGIN DO Section
    3.4 The TO END DO Section
    3.5 The TYPE Section
    3.6 The VALUE Section
    3.7 The VAR Section

  4      Expressions and Operators
    4.1 Expressions
    4.2 Operators
      4.2.1      Arithmetic Operators
      4.2.2      Relational Operators
      4.2.3      Logical Operators
      4.2.4      String Operators
      4.2.5      Set Operators
      4.2.6      Type Cast Operator
      4.2.7      Precedence of Operators
    4.3 Structured Function-Return Values
    4.4 Type Conversions

  5      Statements
    5.1 Assignment Statement
    5.2 BREAK Statement
    5.3 CASE Statement
    5.4 Compound Statement
    5.5 CONTINUE Statement
    5.6 Empty Statement
    5.7 FOR Statement
    5.8 GOTO Statement
    5.9 IF Statement
    5.10 Procedure Call
    5.11 REPEAT Statement
    5.12 RETURN Statement
    5.13 WHILE Statement
    5.14 WITH Statement

  6      Procedures and Functions
    6.1 Routine Declarations
    6.2 Routine Calls
    6.3 Parameters
      6.3.1      Value Parameters
      6.3.2      Variable Parameters
      6.3.3      Routine Parameters
      6.3.4      Passing Predeclared Functions To Formal Function Parameters
      6.3.5      Foreign Parameters
      6.3.6      Schema Parameters
      6.3.7      Conformant Parameters
        6.3.7.1      Conformant Array Parameters
        6.3.7.2      Conformant VARYING Parameter
        6.3.7.3      Conformant Parameter Sections
      6.3.8      Parameter Association
      6.3.9      Default Formal Parameters

  7      Program Structure and Scope
    7.1 Blocks
    7.2 Scope of Identifiers
    7.3 Redeclaring Routine Names
    7.4 Modules and Programs
    7.5 Compilation Units and Data Sharing
      7.5.1      Environment Files
      7.5.2      Global and External Identifiers

  8      Predeclared Functions and Procedures
    8.1 ABS Function
    8.2 ADD_ATOMIC Function (On OpenVMS Alpha and Digital UNIX systems only)
    8.3 ADD_INTERLOCKED Function
    8.4 ADDRESS Function
    8.5 AND_ATOMIC Function (On OpenVMS Alpha and Digital UNIX systems only)
    8.6 ARCTAN Function
    8.7 ARGC and ARGV Routines (On Digital UNIX systems only)
      8.7.1      ARGC Function (On Digital UNIX systems only)
      8.7.2      ARGV Procedure (On Digital UNIX systems only)
    8.8 ARGUMENT Function (On OpenVMS systems only)
    8.9 ARGUMENT_LIST_LENGTH Function (On OpenVMS systems only)
    8.10 ASSERT Procedure
    8.11 BARRIER Function (On OpenVMS Alpha and Digital UNIX systems only)
    8.12 BIN Function
    8.13 BITNEXT Function
    8.14 BIT_OFFSET Function
    8.15 BITSIZE Function
    8.16 BYTE_OFFSET Function
    8.17 C_STR Function
    8.18 CARD Function
    8.19 CHR Function
    8.20 CLEAR_INTERLOCKED Function
    8.21 CLOCK Function
    8.22 COS Function
    8.23 CREATE_DIRECTORY Procedure
    8.24 DATE and TIME Functions
    8.25 DATE and TIME Procedures
    8.26 DBLE Function
    8.27 DEC Function
    8.28 DELETE_FILE Procedure
    8.29 DISPOSE Procedure
    8.30 EQ Function
    8.31 ESTABLISH Procedure
    8.32 EXP Function
    8.33 EXPO Function
    8.34 FIND_FIRST_BIT_CLEAR Function
    8.35 FIND_FIRST_BIT_SET Function
    8.36 FIND_MEMBER Function
    8.37 FIND_NONMEMBER Function
    8.38 GE Function
    8.39 GETTIMESTAMP Procedure
    8.40 GT Function
    8.41 HALT Procedure
    8.42 HEX Function
    8.43 IADDRESS Function
    8.44 IN_RANGE Function
    8.45 INDEX Function
    8.46 INT Function
    8.47 INT64 Function
    8.48 LE Function
    8.49 LENGTH Function
    8.50 LN Function
    8.51 LOWER Function
    8.52 LSHIFT Function
    8.53 LT Function
    8.54 MALLOC_C_STR Function
    8.55 MAX Function
    8.56 MFPR Function (On OpenVMS VAX systems only)
    8.57 MIN Function
    8.58 MTPR Procedure (On OpenVMS VAX systems only)
    8.59 NE Function
    8.60 NEW Procedure
    8.61 NEXT Function
    8.62 OCT Function
    8.63 ODD Function
    8.64 OR_ATOMIC Function (On OpenVMS Alpha and Digital UNIX systems only)
    8.65 ORD Function
    8.66 PACK Procedure
    8.67 PAD Function
    8.68 PAS_STR Function
    8.69 PAS_STRCPY Function
    8.70 PRED Function
    8.71 PRESENT Function (On OpenVMS systems only)
    8.72 QUAD Function
    8.73 RANDOM Function
    8.74 READV Procedure
    8.75 RENAME_FILE Procedure
    8.76 REVERT Procedure
    8.77 ROUND Function
    8.78 RSHIFT Function
    8.79 SEED Function
    8.80 SET_INTERLOCKED Function
    8.81 SIN Function
    8.82 SIZE Function
    8.83 SNGL Function
    8.84 SQR Function
    8.85 SQRT Function
    8.86 STATUSV Function
    8.87 SUBSTR Function
    8.88 SUCC Function
    8.89 SYSCLOCK Function
    8.90 TIME Procedure
    8.91 TRUNC Function
    8.92 UAND Function
    8.93 UDEC Function
    8.94 UINT Function
    8.95 UINT64
    8.96 UNDEFINED Function
    8.97 UNOT Function
    8.98 UNPACK Procedure
    8.99 UOR Function
    8.100 UPPER Function
    8.101 UROUND Function
    8.102 UTRUNC Function
    8.103 UXOR Function
    8.104 WALLCLOCK Function
    8.105 WRITEV Procedure
    8.106 XOR Function
    8.107 ZERO Function

  9      Input and Output Processing
    9.1 Files and File Organizations
      9.1.1      Sequential File Organization
      9.1.2      Relative File Organization (On OpenVMS systems only)
      9.1.3      Indexed File Organization (On OpenVMS systems only)
    9.2 Component Formats
      9.2.1      Fixed-Length Component Format
      9.2.2      Variable-Length Component Format
      9.2.3      Stream Component Format
    9.3 Component Access Modes
      9.3.1      Sequential Access
        9.3.1.1      Sequential Access to Sequential Files
        9.3.1.2      Sequential Access to Relative Files
        9.3.1.3      Sequential Access to Indexed Files
      9.3.2      Random Access (On OpenVMS systems only)
        9.3.2.1      Random Access by Relative Component Numbers (Direct Access)
        9.3.2.2      Random Access to Indexed Files (Keyed Access)
    9.4 File Locking (On OpenVMS systems only)
    9.5 TEXT Files
      9.5.1      Carriage Control
      9.5.2      Prompting on a Terminal
      9.5.3      Delayed Device Access to Text Files
      9.5.4      Writing Partial Lines to Terminals
    9.6 Formatting Output
      9.6.1      Specifying the Field Width
      9.6.2      Writing Real Numbers
      9.6.3      Explicitly Specifying the Base
      9.6.4      Specifying the Base with Predeclared Conversion Functions
      9.6.5      Writing Nonnumeric Types
    9.7 Error-Processing Parameter
    9.8 I/O Routines
      9.8.1      CLOSE Procedure
      9.8.2      DELETE Procedure (On OpenVMS systems only)
      9.8.3      EOF Function
      9.8.4      EOLN Function
      9.8.5      EXTEND Procedure
      9.8.6      FIND Procedure (On OpenVMS systems only)
      9.8.7      FINDK Procedure (On OpenVMS systems only)
      9.8.8      GET Procedure
      9.8.9      LINELIMIT Procedure
      9.8.10     LOCATE Procedure (On OpenVMS systems only)
      9.8.11     MESSAGE Procedure
      9.8.12     OPEN Procedure
      9.8.13     PAGE Procedure
      9.8.14     PUT Procedure
      9.8.15     READ Procedure
      9.8.16     READLN Procedure
      9.8.17     RESET Procedure
      9.8.18     RESETK Procedure (On OpenVMS systems only)
      9.8.19     REWRITE Procedure
      9.8.20     STATUS Function
      9.8.21     TRUNCATE Procedure
      9.8.22     UFB Function
      9.8.23     UNLOCK Procedure (On OpenVMS systems only)
      9.8.24     UPDATE Procedure (On OpenVMS systems only)
      9.8.25     WRITE Procedure
      9.8.26     WRITELN Procedure

  10     Attributes
    10.1 Attribute Syntax
    10.2 Attributes
      10.2.1     ALIGN
      10.2.2     ALIGNED
      10.2.3     ASYNCHRONOUS
      10.2.4     AT
      10.2.5     AUTOMATIC
      10.2.6     BIT
      10.2.7     BYTE
      10.2.8     CHECK
      10.2.9     CLASS_A (On OpenVMS systems only)
      10.2.10    CLASS_NCA
      10.2.11    CLASS_S
      10.2.12    COMMON
      10.2.13    ENUMERATION_SIZE
      10.2.14    ENVIRONMENT
      10.2.15    EXTERNAL
      10.2.16    FLOAT
      10.2.17    GLOBAL
      10.2.18    GRANULARITY (On OpenVMS Alpha and Digital UNIX systems only)
      10.2.19    HIDDEN
      10.2.20    IDENT
      10.2.21    IMMEDIATE
      10.2.22    INHERIT
      10.2.23    INITIALIZE
      10.2.24    KEY (On OpenVMS systems only)
      10.2.25    LIST
      10.2.26    LOCAL
      10.2.27    LONG
      10.2.28    MATH_LIBRARY (On OpenVMS Alpha and Digital UNIX systems only)
      10.2.29    NOOPTIMIZE
      10.2.30    OCTA
      10.2.31    OPTIMIZE
      10.2.32    PEN_CHECKING_STYLE Attribute
      10.2.33    POS
      10.2.34    PSECT
      10.2.35    QUAD
      10.2.36    READONLY
      10.2.37    REFERENCE
      10.2.38    STATIC
      10.2.39    TRUNCATE (On OpenVMS systems only)
      10.2.40    UNALIGNED
      10.2.41    UNBOUND
      10.2.42    UNSAFE
      10.2.43    VALUE
      10.2.44    VOLATILE
      10.2.45    WEAK_EXTERNAL (On OpenVMS systems only)
      10.2.46    WEAK_GLOBAL (On OpenVMS systems only)
      10.2.47    WORD
      10.2.48    WRITEONLY
    10.3 Attribute Classes

  11     Directives
    11.1 %INCLUDE Directive
    11.2 %DICTIONARY Directive (On OpenVMS systems only)
    11.3 %TITLE and %SUBTITLE Directives

  A Data Storage and Representation
    A.1 Program Sections
      A.1.1      Establishing Program Sections
      A.1.2      Establishing Program Section Properties
    A.2 Storage Allocation
      A.2.1      Allocation of Variables
      A.2.2      Allocation of Symbolic Constants and Executable Blocks
      A.2.3      Allocation Example
      A.2.4      Allocation Sizes of Variables
      A.2.5      Storage Allocation of Types
      A.2.6      Allocation Size Examples
      A.2.7      Alignment Boundaries
    A.3 Internal Representation of Data Types
      A.3.1      Representation of Varying Data
      A.3.2      Representation of Floating-Point Data
        A.3.2.1      F_floating-Point Numbers
        A.3.2.2      S_floating-Point Numbers
        A.3.2.3      D_floating-Point Numbers
        A.3.2.4      G_floating-Point Numbers
        A.3.2.5      T_floating-Point Numbers
        A.3.2.6      H_floating-Point Numbers
        A.3.2.7      X_floating-Point Numbers
      A.3.3      Representation of Nonstatic Types and Variables
        A.3.3.1      Representation of Nonstatic Types
        A.3.3.2      Representation of Variables of Nonstatic Types
        A.3.3.3      Representation of Nonstatic Record Fields

  B Summary of DEC Pascal Extensions
    B.1 DEC Pascal Extensions to Unextended Pascal
    B.2 DEC Pascal Extensions to Extended Pascal

  C Description of Implementation Features
    C.1 Implementation-Defined Features
    C.2 Implementation-Dependent Features

  D Compliler and Run-time System Error Detection
    D.1 Error Message Information

  Glossary