ISBinding.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
edit by Ayers 19-Dec-84 11:11:17
Rick Beach, August 1, 1985 2:57:18 pm PDT
MKaplan, September 13, 1985 2:10:56 pm PDT
ISBinding: CEDAR DEFINITIONS
= BEGIN
BindingFailureReason: TYPE = { noBindingFound, inappropriateType, spare };
BindingFailure: SIGNAL [reason: BindingFailureReason];
StackHandle: TYPE = REF StackObject;
StackObject:
TYPE =
RECORD [
top: Handle ← NIL ];
Handle: TYPE = REF Object;
Object:
TYPE =
RECORD [
-- defined in defs (rather than impl) to aid debugging --
previous: Handle ← NIL,
name: ATOM ← NIL,
value: ISToken.TVHandle ← NIL ];
Anchors are pointers to positions on the binding stack. They are dropped at the beginning of a new scope (new node) and restored to previous value at end.
Anchor: TYPE = StackObject;
AnchorBindings: PROCEDURE [StackHandle] RETURNS [Anchor];
PruneBindings: PROCEDURE [StackHandle, Anchor];
CreateStack: PROCEDURE [useEnvironment: BOOLEAN ← TRUE]
RETURNS [ISBinding.StackHandle];
DestroyStack: PROCEDURE [REF ISBinding.StackHandle];
EnvironmentHandle: TYPE = REF EnvironmentObject;
EnvironmentObject:
TYPE =
RECORD [
stack: StackHandle ← NIL ];
CreateEnvironment: PROCEDURE [StackHandle] RETURNS [EnvironmentHandle];
DestroyEnvironment:
PROCEDURE [
REF EnvironmentHandle];
UseEnvironment: PROCEDURE [EnvironmentHandle];
UnuseEnvironment: PROCEDURE RETURNS [EnvironmentHandle];
AugmentBindings: PROCEDURE [name: ATOM, value: ISToken.TVHandle,
stack: StackHandle];
ObtainBinding: PROCEDURE [name: ATOM, stack: StackHandle]
RETURNS [ISToken.TVHandle]; -- ← must copy before prune --
ObtainBindingIntegerOrZero: PROCEDURE [name: ATOM, stack: StackHandle]
RETURNS [INTEGER];
END.