<> <> <> DIRECTORY AMModel USING [Context], Rope USING [ROPE], RTBasic USING [TV], SymTab USING [Ref], WorldVM USING [World]; Interpreter: CEDAR DEFINITIONS = BEGIN OPEN AMModel, Rope, RTBasic, WorldVM; <<>> AbortClosure: TYPE = RECORD [proc: AbortProc, data: REF _ NIL]; AbortProc: TYPE = PROC [data: REF] RETURNS [abort: BOOL _ FALSE]; <> Evaluate: PROC [rope: ROPE, context: Context _ NIL, -- NIL means use ContextForWorld[LocalWorld[]] global: Context _ NIL, -- NIL means no global context symTab: SymTab.Ref _ NIL, -- look here first for name to TV lookup abort: AbortClosure _ [NIL, NIL] -- 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 ContextForWorld[LocalWorld[]] global: Context _ NIL, -- NIL means no global context 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.>> <> ContextForLocalFrame: PROC [lf: TV] RETURNS [Context]; <> <> ContextForGlobalFrame: PROC [gf: TV] RETURNS [Context]; <> <> ContextForWorld: PROC [world: World _ NIL] RETURNS [Context]; < LocalWorld[])>> END.