DIRECTORY TiogaBranchClass, NodeProps, Atom, MessageWindow, RefTab, Rope; TiogaBranchClassImpl: CEDAR PROGRAM IMPORTS Atom, MessageWindow, NodeProps, RefTab EXPORTS TiogaBranchClass = BEGIN OPEN TiogaBranchClass; defaultBranchClass: PUBLIC BranchClass; undefBranchClass: BranchClass; branchClassTable: RefTab.Ref _ RefTab.Create[8]; AlreadyRegistered: PUBLIC SIGNAL = CODE; Lookup: PUBLIC PROC [flavor: BranchFlavor] RETURNS [class: BranchClass] = { classRec: BranchClassRec; IF (class _ NARROW[RefTab.Fetch[branchClassTable, flavor].val])#NIL THEN RETURN; classRec _ undefBranchClass^; classRec.flavor _ flavor; class _ Register[classRec ! AlreadyRegistered => CONTINUE]; MessageWindow.Append[message: "Undefined branch class: ", clearFirst: TRUE]; MessageWindow.Append[Atom.GetPName[flavor]]; MessageWindow.Blink[] }; Register: PUBLIC PROC [classRec: BranchClassRec] RETURNS [class: BranchClass] = { class _ NARROW[RefTab.Fetch[branchClassTable, classRec.flavor].val]; IF class=NIL THEN class _ NEW[BranchClassRec] ELSE SIGNAL AlreadyRegistered; -- ok to continue class^ _ classRec; [] _ RefTab.Store[branchClassTable, classRec.flavor, class] }; branchContentsAtom: PUBLIC ATOM _ $BranchContentsSpecs; UndefGetContents: PROC [br: RefBranchNode] RETURNS [specs: ROPE] = { RETURN [NARROW[NodeProps.GetProp[br, branchContentsAtom]]] }; branchChildrenAtom: PUBLIC ATOM _ $BranchChildrenSpecs; UndefGetChildren: PROC [br: RefBranchNode] RETURNS [specs: ROPE] = { RETURN [NARROW[NodeProps.GetProp[br, branchChildrenAtom]]] }; defaultBranchClass _ Register[[flavor: $Branch]]; undefBranchClass _ Register[[flavor: $UndefBranchClass]]; undefBranchClass.getContents _ UndefGetContents; undefBranchClass.getChildren _ UndefGetChildren; END. ΨTiogaBranchClassImpl.mesa; Written by Paxton, August 1983 Edited by Paxton, August 16, 1983 8:16 pm CreateNode saved the specs on the branch property list CreateNode saved the specs on the branch property list Κ)˜Jšœ9™9Jšœ)™)J˜šΟk ˜ Jšœ˜J˜ Jšœ˜Jšœ˜Jšœ˜Jšœ˜—J˜šœœ˜#Jšœ'˜.Jšœœ˜—J˜Jšœœ˜J˜Iprocšœœ ˜'Kšœ˜Kšœ0˜0K˜Kšœœœœ˜(K˜šΟnœ œœ˜KJšœ˜Jš œ œ.œœœ˜PJšœ˜Jšœ˜Jšœ1œ˜;JšœFœ˜LJšœ,˜,Jšœ˜—J˜šžœ œœ˜QJšœœ6˜DJšœœœ œ˜-JšœœΟc˜0Jšœ˜Jšœ>˜>—J˜Jšœœœ˜7J˜šžœœœ œ˜DJ™6Jšœœ/˜=—J˜Jšœœœ˜7J˜šžœœœ œ˜DJ™6Jšœœ/˜=J˜—Jšœ1˜1Jšœ9˜9Jšœ0˜0Jšœ0˜0J˜Jšœ˜J˜J˜—…—Φ Χ