M2S.DEF 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. DEFINITION MODULE M2S; (*NW 17.8.83 / 25.6.86*)
  2. FROM FileSystem IMPORT File;
  3. CONST IdBufLeng = 8000;
  4. TYPE Symbol = (null,
  5. times, slash, div, mod, and,
  6. plus, minus, or,
  7. eql, neq, lss, leq, gtr, geq, in,
  8. arrow, period, comma, colon, ellipsis, rparen, rbrak, rbrace,
  9. of, then, do, to, by,
  10. lparen, lbrak, lbrace, not, becomes, number, string, ident,
  11. semicolon, bar, end, else, elsif, until,
  12. if, while, repeat, loop, with, exit, return, case, for,
  13. array, pointer, record, set,
  14. begin, code, const, type, var, forward, procedure, module,
  15. definition, implementation, export, qualified, from, import, eof);
  16. (*sym, id, numtyp, intval, dblval, realval, lrlval
  17. are implicit results of GetSym*)
  18. VAR sym : Symbol;
  19. id : CARDINAL;
  20. numtyp : CARDINAL;
  21. (* 1 = card/int, 2 = longint, 3 = char, 4 = real, 5 = longreal*)
  22. intval : CARDINAL;
  23. dblval : LONGINT;
  24. realval : REAL;
  25. scanerr : BOOLEAN;
  26. source : File;
  27. IdBuf : ARRAY [0..IdBufLeng-1] OF CHAR; (*identifier buffer*)
  28. PROCEDURE InitScanner(VAR name: ARRAY OF CHAR);
  29. PROCEDURE Diff(i, I: CARDINAL): INTEGER;
  30. PROCEDURE Enter(id: ARRAY OF CHAR): CARDINAL;
  31. PROCEDURE KeepId;
  32. PROCEDURE GetSym;
  33. PROCEDURE Mark(n: CARDINAL);
  34. PROCEDURE CloseScanner;
  35. END M2S.