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