
<<FILE: M2S.mesa>>
<<Modula-2 Scanner>>
<<Last Edited by: Gutknecht, September 18, 1985 0:27:59 am PDT>>
    <<Satterthwaite December 10, 1985 10:04:40 am PST>>
<<>>
DIRECTORY
IO: TYPE USING [STREAM];

M2S: CEDAR DEFINITIONS = BEGIN

IdBufLen: CARDINAL = 8000;

Symbol: TYPE =
{ null,
times, slash, div, rem, 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 };

NumTyp: TYPE = { cardint, longint, char, real, longreal };

<<sym, id, numtyp, intval, dblval, realval, lrlval are implicit results of GetSym>>
<<>>
sym: VAR Symbol;
id: VAR CARDINAL;

numtyp: VAR NumTyp;
intval: VAR LONG INTEGER;
dblval: VAR LONG INTEGER;
realval: VAR REAL;
scanerr: VAR BOOLEAN;
source: VAR IO.STREAM;
sourcepos: VAR LONG CARDINAL;

log: VAR IO.STREAM;

CharArray: TYPE = PACKED ARRAY [0..IdBufLen) OF CHAR;
IdBuf: VAR REF CharArray; --identifier buffer

InitScanner: PROC;

Diff: PROC [i, j: CARDINAL] RETURNS [INTEGER];
Enter: PROC [name: REF TEXT] RETURNS [CARDINAL];
KeepId: PROC;
GetSym: PROC;

Mark: PROC [n: CARDINAL];

END.


