<> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> < exp fi>> <> <> <.>> <>> <> <>> <> <> <> <> <> <> <> < exp ]>> <> < exp ]>> <> <> <> <> <> <> <> <> <> <> < exp2>> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> DIRECTORY IO USING[ STREAM ] ; RussellSyntax: CEDAR DEFINITIONS = BEGIN TokType: TYPE = { tokId, -- identifier. tokLParen, tokRParen, -- parentheses for grouping: ( ) tokKWtuple, -- keyword for tuple formation with local name tokLTupleBrak, tokRTupleBrak, -- brackets for tuple formation: < > tokLRecTupleBrak, tokRRecTupleBrak, -- brackets for recursive tuple formation: <* *> tokLBrak, tokRBrak, -- general brackets for type formation: [ ] tokKWfunc, -- for function type formation tokKWproc, -- for procedure type formation tokKWref, -- for reference (variable) type formation tokKWprod, -- for product type formation tokKWunion, -- for union type formation tokLUnionBrak, tokRUnionBrak, -- alternative brackets for union type formation: { } tokListSep, -- separator for list of typings/bindings: , tokStmtSep, -- separator for statement sequence: ; tokGuardedExpSep, -- separator for guarded expression list: # tokHasType, -- identifier-has-type glue: : tokSelect, -- component selection infix operator: . tokConcat, -- tuple concatentation operator: | tokQuery, -- component-query glue for guarded expression: ? tokIsBoundTo, -- identifier-is-bound-to glue: ~ tokGuardArrow, -- arrow for guarded list: => tokFunctionArrow, -- parameter-to-result-type arrow for function type: -> tokKWif, tokKWelse, tokKWfi, -- conditional expression tokKWdo, tokKWod, -- loop tokKWopen, tokKWin, tokKWni, -- scope tokKWlambda, -- function constructor tokKWtype, tokKWsafetype, -- builtin constants tokCharConst, -- single-character constant: as in Mesa tokStringConst, -- character string constant: as in Mesa tokIntConst, -- (nonnegative) integer constant: as in Mesa tokError, -- syntax error in token tokEOF }; GetRussellToken: PROCEDURE [source: IO.STREAM, buffer: REF TEXT] RETURNS [tokType: TokType, tokVal: REF ANY, charsRead: INT] ; <> < tokVal: ATOM has print name equal to the name of the identifier. >> < tokVal: Rope.ROPE is equal to the literal text of the token, suitable for passing to the xxxxFromLiteral routines in the Convert interface.>> < tokVal = NIL.>> <> <> END .