[Indigo]<Rosemary>2.3>SignalTypeRegistrationImpl.Mesa
Last Edited by: Spreitzer, July 11, 1985 10:23:50 pm PDT
DIRECTORY Basics, RedBlackTree, Rope, RoseTranslateTypes, SignalTypeRegistration;
SignalTypeRegistrationImpl:
CEDAR
PROGRAM
IMPORTS RedBlackTree, Rope
EXPORTS SignalTypeRegistration =
BEGIN OPEN RoseTranslateTypes;
defaultNodeType: PUBLIC ROPE ← NIL;
signalTypes: PUBLIC SymbolTable ← RedBlackTree.Create[GetSymbolTableEntryKey, CompareSymbolTableEntries];
GetSymbolTableEntryKey:
PUBLIC
PROC [data:
REF
ANY]
RETURNS [key:
ROPE]
--RedBlackTree.GetKey-- =
{ste: SymbolTableEntry ← NARROW[data]; key ← ste.name};
CompareSymbolTableEntries:
PUBLIC
PROC [k, data:
REF
ANY]
RETURNS [c: Basics.Comparison]
--RedBlackTree.Compare-- =
BEGIN
s1: ROPE ← NARROW[k];
s2: ROPE ← GetSymbolTableEntryKey[data];
c ← s1.Compare[s2, FALSE];
END;
RegisterNodeTypeConstructor:
PUBLIC
PROC [name:
ROPE, stc: NodeTypeConstructor] =
BEGIN
signalTypes.Insert[NEW [SymbolTableEntryRep[nodeTypeConstructor] ← [name: name, value: nodeTypeConstructor[stc: stc]]], name];
END;
SetDefaultNodeType: PUBLIC PROC [rope: ROPE] = {defaultNodeType ← rope};
END.