DIRECTORY TiogaNode; NodeAddrs: CEDAR DEFINITIONS = BEGIN Offset: TYPE = TiogaNode.Offset; Ref: TYPE = TiogaNode.Ref; RefTextNode: TYPE = TiogaNode.RefTextNode; RefAddrs: TYPE = REF Body; Body: TYPE = RECORD [addrs: Pair]; Pair: TYPE = REF PairBody; PairBody: TYPE = RECORD [ next: Pair, pinned: BOOL _ FALSE, -- if true, then don't modify location when edits take place addr: REF, movedTo: RefTextNode, -- NIL if hasn't been moved location: Offset ]; AddrsProp: PROC RETURNS [ATOM]; PutTextAddr: PROC [n: RefTextNode, addr: REF, location: Offset]; RemTextAddr: PROC [n: RefTextNode, addr: REF]; PinTextAddr: PROC [n: RefTextNode, addr: REF]; UnpinTextAddr: PROC [n: RefTextNode, addr: REF]; UnpinAll: PROC [n: RefTextNode]; MoveTextAddr: PROC [from, to: RefTextNode, addr: REF, location: Offset]; GetTextAddr: PROC [n: RefTextNode, addr: REF] RETURNS [node: RefTextNode, location: Offset]; TextAddrNotFound: ERROR; TryGetTextAddr: PROC [n: RefTextNode, addr: REF] RETURNS [found: BOOLEAN, node: RefTextNode, location: Offset]; MapTextAddrs: PROC [n: RefTextNode, action: TextAddrsAction] RETURNS [BOOLEAN]; TextAddrsAction: TYPE = PROC [addr: REF, location: Offset] RETURNS [BOOLEAN]; AddNotifyProc, RemoveNotifyProc: PROC [proc: AddrNotifyProc]; AddrNotifyProc: TYPE = PROC [node: RefTextNode, new: PROC [old: Offset] RETURNS [Offset]]; Replace: PROC [node: RefTextNode, start, len, newlen: Offset]; AfterReplace: PROC [initLoc, start, len, newlen: Offset] RETURNS [newLoc: Offset]; END. ¢NodeAddrs.Mesa; written by Paxton. March 1981 edited by Paxton. June 1, 1983 10:21 am edited by McGregor. February 8, 1983 11:46 am edited by: Maxwell, January 5, 1983 8:42 am **** Persistent addressing for characters in text node **** assigns addr to location in text ok if addr was previously assigned elsewhere in the text location automatically updated when text is edited removes the given addr if addr has been moved, does RemTextAddr on new location also don't modify location when edits take place does RemTextAddr[from, addr]; PutTextAddr[to, addr, location]; add leaves forwarding address for use by GetTextAddr generates ERROR TextAddrNotFound if the addr is not in the mapping node may be different than n if addr has been moved apply the action to each addr&location pair for the text returns true if&when an action returns true skips pinned or moved addresses **** notify proc registration **** **** Editing Operations for persistent addrs **** replace chars in [start..start+len) by newlen chars addrs that are in the replaced section move to start add (newlen-len) to addrs that are after the replaced section **** Update Functions for persistent addrs **** Êý˜Jšœ.™.Jšœ'™'Jšœ-™-J™+J˜Jšœ;™;J˜JšÏk ˜ J˜ J˜Jšœ œ˜Jš˜J˜Jšœœ˜ Jšœœ˜Jšœ œ˜*J˜Jšœ œœ˜Jšœœœ˜"J˜Jšœœœ ˜šœ œœ˜Jšœ ˜ JšœœœÏc<˜RJšœœ˜ Jšœž˜1Jšœ˜—J˜JšÏn œœœœ˜J˜šŸ œœœ˜AJšœ ™ Jšœ8™8Jšœ2™2J˜—šŸ œœœ˜.Jšœ™J™>J˜—šŸ œœœ˜.Jšœ+™+J˜—šŸ œœœ˜0J˜—šŸœœ˜ J˜—šŸ œœœ˜HJšœ>™>Jšœ5™5J˜—šŸ œœœœ'˜\JšœB™BJ™4J˜—Jšœœ˜J˜šŸœœœ˜0Jšœ œ'˜>J˜—šŸ œœ*˜Jšœ3™3Jšœ4™4Jšœ=™=J˜—Jšœ/™/J˜JšŸ œœ'œ˜RJ˜Jšœ˜J˜J˜—…—ò ‘