InterpreterPrivate.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Russ Atkinson, April 11, 1985 3:10:59 pm PST
Paul Rovner, November 1, 1983 9:51 pm
DIRECTORY
AMTypes USING [Class, TV],
InterpreterOps USING [EvalHead, Tree],
Rope USING [ROPE],
SafeStorage USING [Type],
SymTab USING [Ref],
WorldVM USING [World];
InterpreterPrivate: CEDAR DEFINITIONS
= BEGIN OPEN AMTypes, InterpreterOps, Rope, SafeStorage, WorldVM;
GetGlobalSymTab: PROC RETURNS [SymTab.Ref];
GetNilTV: PROC RETURNS [TV];
GetTypeOfSafeStorageDotType: PROC RETURNS [Type];
EvalNoProps: PROC [tree: Tree, head: EvalHead, target: Type] RETURNS [TV];
... is like InterpreterOps.Eval, but no attempt is made to add process properties. This is useful when it is already known that the properties have been added, for example.
EnableBlock: PROC [head: InterpreterOps.EvalHead, handler: ErrorHandler, data: REF];
... alters EvalHead such that whenever there is an interpreted procedure call using the given EvalHead that raises any error or signal, a call is made to the handler (must be a storable proc) with the handler data and the tree for the call and the catch phrase. Note that head.specials must be # NIL for this call to work.
ErrorHandler: TYPE = PROC [inner: PROC, data: REF, call: Tree, catch: Tree, head: InterpreterOps.EvalHead];
This is the type of the client's procedure. A client procedure is expected to call the inner procedure and handle errors arising from its interpretation. The data is as given to EnableBlock, and the other arguments describe the call.
ErrorHandlerObj: TYPE = RECORD [handler: ErrorHandler, data: REF];
The type of object used to store the ErrorHandler information. Used internally.
RecordSearch: PROC [record: TV, name: ROPE] RETURNS [TV];
EvalRecord: PROC [args: Tree, head: EvalHead, target: Type, parent: Tree, targetWorld: World ← NIL] RETURNS [TV];
... evaluates a record constructor. IF targetWorld # NIL THEN the constructor should be made for the given world, even though the arguments get looked up according to the given head.
EnumeratedValueFromRope: PROC [name: ROPE, type: Type] RETURNS [val: TVNIL];
NumberedMsg: PROC [r1: ROPE, num: INT, r2: ROPENIL] RETURNS [ROPE];
TestAbort: PROC [head: EvalHead, parent: Tree];
GetDefault: PROC [head: EvalHead, parent: Tree, type: Type, index: CARDINAL] RETURNS [defval: TV];
LocalCoerce: PROC [head: EvalHead, parent: Tree, current: TV, target: Type, index: CARDINAL ← 0, msg: ROPENIL] RETURNS [val: TV];
CoerceTV: PROC [arg: TV, fullType: Type] RETURNS [rtn: TV];
takes a TV and the full type of the expected TV and tries to
return a TV assignable to a TV for the full type
handles cases that RTTypes.Coerce does not handle
also may call RTTypes.Coerce
may raise RTTypes.IncompatibleTypes
UnderTypeAndClass: PROC [type: Type] RETURNS [under: Type, class: Class];
NewInt: PROC [int: INT] RETURNS [tv: TV];
NewReal: PROC [real: REAL] RETURNS [TV];
NewType: PROC [type: Type] RETURNS [TV];
END.