RobotScanner.mesa
Created Monday, May 21, 1984 12:03 pm PDT
Last edited by Eric Nickell, June 10, 1984 0:19:58 am PDT
DIRECTORY
Rope USING [ROPE];
RobotScanner: CEDAR DEFINITIONS ~ {
RTknClass: TYPE = {
time,      --Used as first token, giving edit time of source file
tknID,
tknNum,
tknInstruction,
tknIndirect,
tknImmediate,
tknIF,
tknTHEN,
tknELSE,
tknLParen,
tknRParen,
tknLBracket,
tknRBracket,
tknMulop,
tknAddop,
tknRelop,
tknNOT,
tknColon,
tknSemiColon,
tknComma,
tknAssign,
tknOR,
tknAND,
tknEOF
};
RTkn: TYPE ~ REF RTknRec ← NIL;
RTknRec: TYPE = RECORD [
class: RTknClass,  --Type of token
data: REF ANYNIL, --Type-specific information
pc: INT ← 0    --Pointer into file where found
];
ScannedProgram: TYPE ~ REF ScannedProgramRec;
ScannedProgramRec: TYPE = RECORD [
token: PACKED ARRAY [0..1800) OF RTkn,
count: CARDINAL        --Number of actual tokens returned
];
GetTokensFromFile: PROC [file: Rope.ROPE] RETURNS [scannedProgram: ScannedProgram];
}.