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 ANY ← NIL, --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];
}.