<> <> <> <> DIRECTORY AMTypes USING [TV], AMModel USING [Context], Rope USING [ROPE], SymTab USING [Ref]; Interpreter: CEDAR DEFINITIONS = BEGIN OPEN AMModel, Rope, AMTypes; <<>> AbortClosure: TYPE = RECORD [proc: AbortProc, data: REF _ NIL]; <<... called by Evaluate at intervals to ask whether it should abort its task and return. >> nilAbortClosure: AbortClosure = [NIL, NIL]; AbortProc: TYPE = PROC [data: REF] RETURNS [abort: BOOL _ FALSE]; <> Evaluate: PROC [rope: ROPE, context: Context _ NIL, -- NIL means use AMModel.RootContext[LocalWorld[]] symTab: SymTab.Ref _ NIL, -- look here first for name to TV lookup abort: AbortClosure _ nilAbortClosure -- default is to never abort ] RETURNS[result: TV, errorRope: ROPE, noResult: BOOL]; <<... parses and interprets the given rope as a Mesa expression, returning a TV for the result (noResult is TRUE if there is no result).>> EvaluateToRope: PROC [rope: ROPE, context: Context _ NIL, -- NIL means use AMModel.RootContext[LocalWorld[]] symTab: SymTab.Ref _ NIL, -- look here first for name to TV lookup abort: AbortClosure _ [NIL, NIL] -- default is to never abort ] RETURNS[result: ROPE, errorRope: ROPE, noResult: BOOL]; <<... is just like Evaluate, except that the result is a ROPE produced by IO.PutTV with defaulted arguments.>> END.