StatementInterpreter.Mesa
Last Edited by: Spreitzer, January 7, 1985 10:48:26 pm PST
DIRECTORY AMModel, AMTypes, Interpreter, InterpreterOps, IO, PPTree, Rope, SafeStorage, SymTab;
StatementInterpreter: CEDAR DEFINITIONS =
BEGIN
ROPE: TYPE = Rope.ROPE;
Context: TYPE = AMModel.Context;
SymbolTable: TYPE = SymTab.Ref;
Tree: TYPE = InterpreterOps.Tree;
EvalHead: TYPE = InterpreterOps.EvalHead;
Type: TYPE = SafeStorage.Type;
nullType: Type = SafeStorage.nullType;
TV: TYPE = AMTypes.TV;
InterpretStatement: PROC [blockAsRope: ROPE, context: Context ← NIL, symTab: SymbolTable ← NIL, abort: Interpreter.AbortClosure ← Interpreter.nilAbortClosure] RETURNS [errorRope: ROPE];
blockAsRope should include bracketing BEGIN-END or curly braces.
ParseBlock: PROC [asRope: ROPE, errout: IO.STREAM] RETURNS [asTree: Tree];
ParseModule: PROC [asRope: ROPE, errout: IO.STREAM] RETURNS [asTree: Tree];
Interp: PROC [asTree: Tree, head: EvalHead, nest: BOOLTRUE];
Evaluate a statement.
IF nest THEN top scope will be nested inside scope of head ELSE top scope will be merged with head.
Enable: PROC [catches: REF PPTree.Node, head: EvalHead, inner: PROC];
Call the inner procedure, as if protected by the given catch series in the given context.
END.