DEFINITION MODULE Parser;
(* Reads the Source file, and splits each *)
(* line into Label, OpCode & Operand(s).  *)

   FROM FileSystem IMPORT
      File;


   EXPORT QUALIFIED
      TOKEN, OPERAND, STRING, 
      Line, LineCount, OpLoc, SrcLoc, DestLoc, LineParts;


   CONST
      TokenSize = 8;
      OperandSize = 20;

   TYPE
      TOKEN = ARRAY [0..TokenSize] OF CHAR;
      OPERAND = ARRAY [0..OperandSize] OF CHAR;
      STRING = ARRAY [0..80] OF CHAR;

   VAR
      OpLoc, SrcLoc, DestLoc : CARDINAL;
      Line : STRING;
      LineCount : CARDINAL;


   PROCEDURE LineParts (VAR f : File; VAR EndFile : BOOLEAN; 
                        VAR Label, OpCode : TOKEN; 
                        VAR SrcOp, DestOp : OPERAND);
   (* Reads Line, breaks into tokens, on-passes to symbol & code generators *)

END Parser.

