[Indigo]<Rosemary>2.3>SignalTypeRegistrationImpl.Mesa
Last Edited by: Spreitzer, March 10, 1984 1:28:03 pm PST
DIRECTORY OrderedSymbolTableRef, Rope, RoseTranslateTypes, SignalTypeRegistration;
SignalTypeRegistrationImpl:
CEDAR
PROGRAM
IMPORTS OrderedSymbolTableRef, Rope
EXPORTS SignalTypeRegistration =
BEGIN OPEN RoseTranslateTypes;
defaultNodeType: PUBLIC ROPE ← NIL;
signalTypes: PUBLIC SymbolTable ← OrderedSymbolTableRef.CreateTable[CompareSymbolTableEntries];
CompareSymbolTableEntries:
PUBLIC OrderedSymbolTableRef.CompareProc =
BEGIN
s1, s2: ROPE;
s1 ←
WITH r1
SELECT
FROM
r: ROPE => r,
st: SymbolTableEntry => st.name,
ENDCASE => ERROR;
s2 ←
WITH r2
SELECT
FROM
r: ROPE => r,
st: SymbolTableEntry => st.name,
ENDCASE => ERROR;
RETURN [s1.Compare[s2, FALSE]];
END;
RegisterNodeTypeConstructor:
PUBLIC
PROC [name:
ROPE, stc: NodeTypeConstructor] =
BEGIN
signalTypes.Insert[NEW [SymbolTableEntryRep[nodeTypeConstructor] ← [name: name, value: nodeTypeConstructor[stc: stc]]]];
END;
SetDefaultNodeType: PUBLIC PROC [rope: ROPE] = {defaultNodeType ← rope};
END.