<<>> <> <> <> DIRECTORY IO, Rope; M3Scan: CEDAR DEFINITIONS = BEGIN GetM3Token: PROC [stream: IO.STREAM, buffer: REF TEXT, flushComments: BOOL ¬ TRUE] RETURNS [tokenKind: TokenKind, token: REF TEXT, charsSkipped: INT, error: TokenError]; <> <> TokenKind: TYPE = { tokenERROR, -- token.error describes the scanning error tokenID, -- an identifier or reserved word tokenDECIMAL, -- a whole number literal expressed in decimal tokenBASED, -- a whole number literal with explicit base tokenREAL, -- a REAL literal tokenTEXT, -- a TEXT literal tokenCHAR, -- a CHAR literal tokenSINGLE, -- a single-character token tokenDOUBLE, -- a double-character token tokenCOMMENT, -- a comment tokenPRAGMA, -- a pragma tokenEOF -- the end-of-file marker }; TokenError: TYPE = { none, -- no error extendedChar, -- error following backslash in char or string literal numericLiteral, charLiteral, stringLiteral, -- error in parsing indicated type singleChar -- first non-whitespace char is not legal as first char of token }; GetM3TokenRope: PROC [stream: IO.STREAM, flushComments: BOOL ¬ TRUE] RETURNS [tokenKind: TokenKind, token: Rope.ROPE, charsSkipped: INT]; <> <> <> ScanBack: PROC [base: Rope.ROPE, from: INT] RETURNS [start: INT]; <> <> <> END.