CoreContext.mesa 
Copyright © 1985 by Xerox Corporation. All rights reserved.
Barth, October 15, 1985 3:39:06 pm PDT
Louis Monier October 16, 1985 4:28:05 pm PDT
DIRECTORY Core, Properties;
CoreContext: CEDAR DEFINITIONS = BEGIN
ROPE: TYPE = Core.ROPE;
Theory
Context; scope.
Context
-- A Context is a stack of properties
Context: TYPE = Properties.PropList; -- order is preserved!
PropertyLiteral: TYPE = Properties.KeyVal;
PropertyLiterals: TYPE = Properties.PropList;
GetRef: PROC [context: Context, prop: ATOM] RETURNS [REF];
GetAtom: PROC [context: Context, prop: ATOM] RETURNS [ATOM];
GetRope: PROC [context: Context, prop: ATOM] RETURNS [ROPE];
GetInt: PROC [context: Context, prop: ATOM] RETURNS [INT];
GetReal: PROC [context: Context, prop: ATOM] RETURNS [REAL];
PushRef: PROC [context: Context, prop: ATOM, val: REF];
PushAtom: PROC [context: Context, prop: ATOM, val: ATOM];
PushRope: PROC [context: Context, prop: ATOM, val: ROPE];
PushInt: PROC [context: Context, prop: ATOM, val: INT];
PushReal: PROC [context: Context, prop: ATOM, val: REAL];
RegisterRefProperty: PROC [prop: ATOM];
RegisterAtomProperty: PROC [prop: ATOM];
RegisterRopeProperty: PROC [prop: ATOM];
RegisterIntProperty: PROC [prop: ATOM];
RegisterRealProperty: PROC [prop: ATOM];
CreateContext: PROC [init: Context ← NIL, props: PropertyLiterals] RETURNS [Context];
MarkContext: PROC [context: Context, mark: ATOM];
PopContext: PROC [context: Context, mark: ATOM];
Structure
StructureProc: TYPE = PROC [context: Context] RETURNS [cellType: Core.CellType];
Given a context compute the implementation.
RegisterStructureProc: PROC [name: ROPE, proc: StructureProc] RETURNS [ROPE];
Returns name argument as result.
CreateStructure: PROC [name: ROPE, context: Context] RETURNS [Core.CellType];
END.