StatementInterpreterPrivate.Mesa
Last Edited by: Spreitzer, May 10, 1986 1:14:32 pm PDT
DIRECTORY AMModel, AMTypes, Interpreter, InterpreterOps, IO, PPLeaves, PPTree, PrincOps, Rope, SafeStorage, StatementInterpreter, SymTab;
StatementInterpreterPrivate: CEDAR DEFINITIONS =
BEGIN
PROCANY: TYPE = UNSAFE PROC ANY RETURNS ANY;
ROPE: TYPE = Rope.ROPE;
Tree: TYPE = InterpreterOps.Tree;
Node: TYPE = REF PPTree.Node;
EvalHead: TYPE = InterpreterOps.EvalHead;
Context: TYPE = AMModel.Context;
Type: TYPE = AMTypes.Type;
TV: TYPE = AMTypes.TV;
nullType: Type = AMTypes.nullType;
SymbolTable: TYPE = SymTab.Ref;
Interval: TYPE = REF IntervalRep;
IntervalRep: TYPE = RECORD [
lowClosed, highClosed: BOOLFALSE,
low, high: TVNIL
];
Lambda: TYPE = REF LambdaRep;
LambdaRep: TYPE = RECORD [
name: ROPENIL,
args, rets: Fields ← NIL,
argsType, retsType: Type ← nullType,
body: Node ← NIL,
head: EvalHead ← NIL];
Fields: TYPE = REF FieldsRep;
FieldsRep: TYPE = RECORD [
named: BOOLEAN,
fields: SEQUENCE length: CARDINAL OF Field];
Field: TYPE = RECORD [
name: ROPENIL,
type: Type ← nullType,
typed, valued: BOOLEANFALSE,
value: REF ANYNIL];
SignalDecision: TYPE = RECORD [
type: SignalDecisionType,
fields: Fields ← NIL, --only if Return or Resume
label: ROPENIL--only if GoTo
];
SignalDecisionType: TYPE = {Reject, Retry, Continue, Resume, Return, Exit, Loop, GoTo};
BasicSignalDecisionType: TYPE = SignalDecisionType[Reject .. Continue];
DummyStuffList: TYPE = LIST OF DummyStuff;
DummyStuff: TYPE = REF DummyStuffPrivate;
DummyStuffPrivate: TYPE = RECORD [
proc: PROCANY,
asTV: TV,
asLambda: Lambda];
empty: TV;
typeType: Type;
Exit: ERROR;
Loop: ERROR;
GetReturnFields: SIGNAL RETURNS [fields: Fields];
Return: ERROR [fields: Fields];
GetResumeFields: SIGNAL RETURNS [fields: Fields];
Resume: ERROR [fields: Fields];
GoTo: ERROR [label: ROPE];
DecideSignal: ERROR [decision: BasicSignalDecisionType];
NarrowToSymbolTable: PROC [ra: REF ANY] RETURNS [st: SymbolTable];
NestHead: PROC [outer: EvalHead, st: SymbolTable ← NIL] RETURNS [inner: EvalHead];
DigestFields: PROC [tree: Tree, eval, mayNIL: BOOLEAN, head: EvalHead, guide: Fields ← NIL] RETURNS [fields: Fields];
ForceType: PROC [tv: TV, head: EvalHead, parent: Tree] RETURNS [Type];
FieldsFromType: PROC [type: Type] RETURNS [fields: Fields];
RecordFromFields: PROC [fields: Fields, type: Type] RETURNS [rec: TV];
InterpNoProps: PROC [tree: Tree, head: EvalHead, nest: BOOLTRUE];
EvalExpr: PROC [tree: Tree, head: EvalHead, target: Type ← nullType] RETURNS [tv: TV];
EvalReturn: PROC [rn: Node, head: EvalHead];
EvalResume: PROC [rn: Node, head: EvalHead];
EvalProcedure: PROC [head: EvalHead, tree: Tree, target: Type ← nullType, data: REFNIL] RETURNS [return: TV] --EvalQuote.EvalQuoteProc--;
GetStuff: PROC [dummy: PROCANY] RETURNS [ds: DummyStuff];
RegisterDummys: PROC [fileName: ROPE, gfh: PrincOps.GlobalFrameHandle];
The procedures in this global frame whose names being with "Dummy" are taken as dummy procedures.
DoDummy: PROC [fh: PrincOps.FrameHandle, hackReturns: BOOLFALSE];
END.