<> <> <> <> <> <> <> <> DIRECTORY Rope USING [ROPE], Rosary USING [ROSARY]; TextNode: CEDAR DEFINITIONS = BEGIN MaxLen: INT = LAST[INT]; ROPE: TYPE = Rope.ROPE; ROSARY: TYPE = Rosary.ROSARY; Node: TYPE = REF NodeRep; Ref: TYPE = Node; -- for compatibility NodeRep: TYPE = RECORD [ next: Node, -- points to next sibling, or if last=true, to parent child: Node, -- points to first child, if any, of this node props: NodeProps, -- points to node property list formatName: ATOM _ NIL, -- name of format for the node last: BOOL _ FALSE, -- true if this is last sibling hasstyledef: BOOL _ FALSE, -- true if node has StyleDef prop (accelerator) hasprefix: BOOL _ FALSE, -- true if node has Prefix prop (accelerator) haspostfix: BOOL _ FALSE, -- true if node has Postfix prop (accelerator) hasartwork: BOOL _ FALSE, -- true if node has Artwork prop (accelerator) hasactive: BOOL _ FALSE, -- true if node has Active prop (accelerator) deleted: BOOL _ FALSE, -- true if has been deleted or is root pending delete dirty: BOOL _ FALSE, -- true if has been edited (contents, or children moved, inserted, ...) new: BOOL _ FALSE, -- true if created during this editing session (i.e., not from file) comment: BOOL _ FALSE, -- true if node is a comment rope: ROPE, charSets: ROSARY--OF REF CharSet--, charLooks: ROSARY--OF REF Looks--, charProps: ROSARY--OF PropList-- ]; Location: TYPE = RECORD [node: Node, where: INT]; <= length of text means at end>> <> <> <> NodeItself: INT = -1; nullLocation: Location = [node: NIL, where: NodeItself]; MakeNodeLoc: PROC [n: Node] RETURNS [Location]; Span: TYPE = RECORD [start, end: Location _ nullLocation]; <> <> <> <> <> <> nullSpan: Span = [nullLocation,nullLocation]; MakeNodeSpan: PROC [first, last: Node] RETURNS [Span]; NodeList: TYPE = REF NodeListBody; NodeListBody: TYPE = RECORD [node: Node, next: NodeList]; NodeProps: TYPE = REF NodePropsBody; NodePropsBody: TYPE; -- exported by NodePropsImpl NewTextNode: PROC RETURNS [txt: Node]; Parent: PROC [n: Node] RETURNS [Node]; Root: PROC [n: Node] RETURNS [Node]; Next: PROC [n: Node] RETURNS [Node]; <> <> Previous: PROC [n: Node, parent: Node _ NIL] RETURNS [nx: Node]; <> <> <> Forward: PROC [node: Node] RETURNS [nx: Node, levelDelta: INTEGER]; <> <> <> <> <> Backward: PROC [node: Node, parent: Node _ NIL] RETURNS [back, backparent: Node, levelDelta: INTEGER]; <> <> <> StepForward: PROC [node: Node] RETURNS [Node]; <> StepBackward: PROC [node: Node, parent: Node _ NIL] RETURNS [Node]; <> Level: PROC [node: Node] RETURNS [level: INTEGER]; <> ForwardClipped: PROC [node: Node, maxLevel: INTEGER, nodeLevel: INTEGER _ 0] RETURNS [nx: Node, nxLevel: INTEGER]; <> <> <> BackwardClipped: PROC [node: Node, maxLevel: INTEGER, parent: Node _ NIL, nodeLevel: INTEGER _ 0] RETURNS [back, backparent: Node, backLevel: INTEGER]; <> <> LocRelative: PROC [location: Location, count: INT, break: NAT _ 1, skipCommentNodes: BOOL _ FALSE] RETURNS [Location]; <> < location corresponding to count>> <> <> LocWithin: PROC [n: Node, count: INT, break: NAT _ 1, skipCommentNodes: BOOL _ FALSE] RETURNS [Location]; LocOffset: PROC [loc1, loc2: Location, break: NAT _ 1, skipCommentNodes: BOOL _ FALSE] RETURNS [count: INT]; <> <> <> <> BadArgs: ERROR; LocNumber: PROC [at: Location, break: NAT _ 1, skipCommentNodes: BOOL _ FALSE] RETURNS [count: INT]; <> FirstSibling: PROC [n: Node] RETURNS [Node]; LastSibling: PROC [n: Node] RETURNS [Node]; LastWithin: PROC [n: Node] RETURNS [Node]; <> <> LastLocWithin: PROC [n: Node] RETURNS [Location]; <> FirstChild: PROC [n: Node] RETURNS [Node]; LastChild: PROC [n: Node] RETURNS [Node]; NthChild: PROC [n: Node, location: INT _ 0] RETURNS [child: Node]; NthSibling: PROC [n: Node, cnt: INT _ 0] RETURNS [Node]; CountChildren: PROC [n: Node] RETURNS [count: INT]; CountFollowing: PROC [n: Node] RETURNS [count: INT]; CountToParent: PROC [n: Node] RETURNS [count: INT, parent: Node]; CountToChild: PROC [parent, child: Node] RETURNS [count: INT]; NodeFormat: PROC [n: Node] RETURNS [ATOM]; IsLastSibling: PROC [n: Node] RETURNS [BOOL]; EndPos: PROC [n: Node] RETURNS [INT]; END.