(****************************************
*                                       *
*     MODULA-2 Multi-Pass Compiler      *
*     ****************************      *
*                                       *
*       VAX/VMS Implementation          *
*                                       *
*                                       *
*     MVCIO3:                           *
*                                       * 
*     Input / output handling in Pass 3 *
*                                       * 
*                                       *
*     Version 3.1 of  1-FEB-1983        *
*                                       *
*                                       *
*                                       *
*     Based on PDP11 Implementation     *
*     Version M22 of 06.01.81           *
*                                       *
*     Institut fuer Informatik          *
*     ETH-Zuerich                       *
*     CH-8092 Zuerich                   *
*                                       *
****************************************)

(****************************************
* Updates: see implementation module    *
****************************************)

DEFINITION MODULE MVCIO3;    (* PDP11: LG *)
  (* VAX:   M. Mall *)

  FROM SYSTEM IMPORT WORD;
  FROM MVCompiler IMPORT Idptr, Symbol, Spellix;

  EXPORT QUALIFIED
         sy, val, length, line, spix, nptr,
         PutSy, PutWord,
         Savepos, InitSave, ResetSave, ReleaseSave,
         Error, ErrorLS,
         GetSy, PutGetSy,
         TermInOut;

  TYPE
    Savepos = RECORD
                low, high: CARDINAL;
              END;

  VAR
    sy : Symbol;
    val : CARDINAL;    (* value *)
    length : CARDINAL; (* string length *)
    spix : Spellix;    (* spelling index of identifier *)
    line : CARDINAL;   (* current line no. *)
    nptr : Idptr;      (* pointer to referenced name *)

  PROCEDURE PutSy(s: Symbol);
  (* put symbol s and pos on output-stream *)

  PROCEDURE PutWord(w: WORD);
  (* put word w on output-stream *)

  PROCEDURE InitSave(VAR s: Savepos);

  PROCEDURE ResetSave(s: Savepos);

  PROCEDURE ReleaseSave(s: Savepos);

  PROCEDURE Error(n: CARDINAL);
  (* put error number n to current symbol *)

  PROCEDURE ErrorLS(n: CARDINAL);
  (* put error number n to last symbol *)

  PROCEDURE GetSy;
  (* get next symbol from input-stream *)
  (* symbol is assigned to sy          *)

  PROCEDURE PutGetSy;
  (* put last symbol sy, get next symbol sy *)

  PROCEDURE TermInOut;
  (* termination of input- and output-streams *)

END MVCIO3.
