Bindings.mesa
Last Edited by Mitchell, February 7, 1983 3:24 pm
DIRECTORY
Interscript USING [Id, Value];
Bindings: CEDAR DEFINITIONS =
BEGIN
Id: TYPE ~ Interscript.Id;
Value: TYPE ~ Interscript.Value;
BTHandle: TYPE ~ REF BindingTable;
BindingTable: TYPE;
Binding: TYPE ~ REF BindingRec;
BindingRec: TYPE ~ RECORD[id: Id, m: BindingMode, v: Value];
BindingMode: TYPE ~ {local, global} ← local;
InitBindingTable: PROCEDURE [z: ZONE] RETURNS [bt: BTHandle];
AddBinding: PROCEDURE [self: BTHandle, b: Binding];
adds the binding to the table in the current scope. Any extant binding for the same id in the current scope is overwritten.
GetBinding: PROCEDURE [self: BTHandle, id: Id] RETURNS [binding: Binding];
Returns id's binding, or NIL if unbound
GetBindings: PROCEDURE [self: BTHandle, ids: LIST OF Id] RETURNS [bindings: LIST OF Binding];
for each id in the list, returns its binding, or NIL if unbound
Scope: TYPE ~ RECORD[uid: INT];
NewScope: PROCEDURE [self: BTHandle] RETURNS [s: Scope];
pushes a new scope and returns a handle for it
PopScope: PROCEDURE [self: BTHandle, s: Scope];
Pops the current scope, which s must identify (else error ScopeError[inputError] is generated).
END.
Change Log
Created by Mitchell, February 7, 1983 11:07 am