CRS.def 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. DEFINITION MODULE CRS;
  2. (* Scanner generated by Coco/R - assuming FileIO library will be available. *)
  3. IMPORT FileIO;
  4. TYPE
  5. INT32 = FileIO.INT32;
  6. VAR
  7. src, lst: FileIO.File; (*source/list files. To be opened by the main pgm*)
  8. directory: ARRAY [0 .. 255] OF CHAR (*of source file*);
  9. line, col: INTEGER; (*line and column of current symbol*)
  10. len: CARDINAL; (*length of current symbol*)
  11. pos: INT32; (*file position of current symbol*)
  12. nextLine: INTEGER; (*line of lookahead symbol*)
  13. nextCol: INTEGER; (*column of lookahead symbol*)
  14. nextLen: CARDINAL; (*length of lookahead symbol*)
  15. nextPos: INT32; (*file position of lookahead symbol*)
  16. errors: INTEGER; (*number of detected errors*)
  17. Error: PROCEDURE ((*nr*)INTEGER, (*line*)INTEGER, (*col*)INTEGER,
  18. (*pos*)INT32);
  19. PROCEDURE Get (VAR sym: CARDINAL);
  20. (* Gets next symbol from source file *)
  21. PROCEDURE GetString (pos: INT32; len: CARDINAL; VAR name: ARRAY OF CHAR);
  22. (* Retrieves exact string of max length len from position pos in source file *)
  23. PROCEDURE GetName (pos: INT32; len: CARDINAL; VAR name: ARRAY OF CHAR);
  24. (* Retrieves name of symbol of length len at position pos in source file *)
  25. PROCEDURE CharAt (pos: INT32): CHAR;
  26. (* Returns exact character at position pos in source file *)
  27. PROCEDURE Reset;
  28. (* Reads and stores source file internally *)
  29. END CRS.