<> <> <> DIRECTORY TiogaNode; TiogaTreeOps: CEDAR DEFINITIONS = BEGIN Ref: TYPE = TiogaNode.Ref; RefBranchNode: TYPE = TiogaNode.RefBranchNode; TreeLoc: TYPE = RECORD [node: Ref, where: TiogaNode.Offset]; nullLoc: TreeLoc = [NIL, TiogaNode.NodeItself]; TreeSpan: TYPE = RECORD [start, end: TreeLoc _ nullLoc]; nullSpan: TreeSpan = [nullLoc, nullLoc]; BranchLoc: TYPE = RECORD [node: RefBranchNode, where: TiogaNode.Offset]; nullBranchLoc: BranchLoc = [NIL, TiogaNode.NodeItself]; BranchSpan: TYPE = RECORD [start, end: BranchLoc _ nullBranchLoc]; nullBranchSpan: BranchSpan = [nullBranchLoc, nullBranchLoc]; <> <<>> <> <<>> Parent: PROC [n: Ref] RETURNS [Ref]; -- do you really want TiogaPathOps instead? Root: PROC [n: Ref] RETURNS [RefBranchNode]; -- do you really want TiogaPathOps instead? Next: PROC [n: Ref] RETURNS [Ref]; -- do you really want TiogaPathOps instead? Contents: PROC [n: Ref] RETURNS [Ref] ; -- do you really want TiogaPathOps instead? BranchChild: PROC [n: RefBranchNode] RETURNS [RefBranchNode] ; -- do you really want TiogaPathOps instead? FirstSibling: PROC [n: Ref, parent: Ref _ NIL] RETURNS [sib: Ref]; LastSibling: PROC [n: Ref] RETURNS [sib: Ref]; Previous: PROC [n: Ref, parent: Ref _ NIL] RETURNS [sib: Ref]; LastWithin: PROC [n: Ref] RETURNS [Ref]; ContainingStatement: PROC [n: Ref] RETURNS [RefBranchNode]; <> <<>> StepForwardNode: PROC [node: Ref] RETURNS [nxt: Ref]; Forward: PROC [node: RefBranchNode] RETURNS [nx: RefBranchNode, levelDelta: INTEGER]; StepBackwardNode: PROC [node: Ref, parent: Ref _ NIL] RETURNS [back, backparent: Ref]; Backward: PROC [node: RefBranchNode, parent: Ref _ NIL] RETURNS [back: RefBranchNode, backparent: Ref, levelDelta: INTEGER]; <<>> <> <<>> LastBranchWithin: PROC [n: RefBranchNode] RETURNS [RefBranchNode]; Level: PROC [n: Ref] RETURNS [INTEGER]; MakeTreeLoc: PROC [n: Ref] RETURNS [TreeLoc]; MakeTreeSpan: PROC [first, last: Ref] RETURNS [TreeSpan]; MakeBranchLoc: PROC [n: RefBranchNode] RETURNS [BranchLoc]; MakeBranchSpan: PROC [first, last: RefBranchNode] RETURNS [BranchSpan]; BackLoc: PROC [loc: TreeLoc] RETURNS [new: TreeLoc]; ForwardLoc: PROC [loc: TreeLoc] RETURNS [new: TreeLoc]; END.