DEFINITION MODULE dry2;

(* Types *)

TYPE
  (* basic types *)
  integer       = INTEGER; (* or CARDINAL *)

  (* other types *)
  Enumeration   = (Ident1, Ident2, Ident3, Ident4, Ident5);
  OneThirty     = [0..30];
  OneFifty      = [0..49];
  CapitalLetter = ['A'..'Z'];
  Str30         = ARRAY OneThirty OF CHAR;
  Arr1Dim       = ARRAY OneFifty OF integer;
  Arr2Dim       = ARRAY OneFifty, OneFifty OF integer;

  RecPointer    = POINTER TO RecType;
  RecType       = RECORD
    PtrComp     : RecPointer;
    CASE Discr  : Enumeration OF
    |Ident1:
      EnumComp  : Enumeration;
      IntComp   : integer;
      StrComp   : Str30;
    |Ident2:
      EComp2    : Enumeration;
      Str2Comp  : Str30;
    |Ident3:
      Ch1Comp   : CHAR;
      Ch2Comp   : CHAR;
    END;
  END;

VAR

  PtrGlob,
  NextPtrGlob   : RecPointer;
  IntGlob       : integer;
  BoolGlob      : BOOLEAN;
  Ch1Glob,
  Ch2Glob       : CHAR;
  Arr1Glob      : Arr1Dim;
  Arr2Glob      : Arr2Dim;

(* Procedures *)

PROCEDURE Proc6 (EnumValPar: Enumeration; VAR EnumRefPar: Enumeration);
PROCEDURE Proc7 (Int1ParVal, Int2ParVal: integer; VAR IntParRef: integer);
PROCEDURE Proc8 (VAR Arr1ParRef: Arr1Dim;
                 VAR Arr2ParRef: Arr2Dim;
                     Int1ParVal, Int2ParVal: integer);
PROCEDURE Func1 (Ch1ParVal, Ch2ParVal: CapitalLetter): Enumeration;
PROCEDURE Func2 (VAR Str1ParRef, Str2ParRef: Str30): BOOLEAN;
PROCEDURE Func3 (EnumParVal: Enumeration): BOOLEAN;

END dry2.
