IndexTree.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Created by Rick Beach, July 11, 1983 9:20 am
Rick Beach, April 29, 1985 12:04:52 pm PDT
DIRECTORY
IndexProps USING [IndexEntry],
RedBlackTree USING [Table],
Rope USING [ROPE],
TextNode USING [Span, nullSpan, Ref],
TiogaButtons USING [TiogaButton];
=
BEGIN
Index:
TYPE ~
RECORD[
table: RedBlackTree.Table,
root: TextNode.Ref
];
CreateIndex:
PROC [rootOfIndex: TextNode.Ref]
RETURNS [index: Index];
IxItem: TYPE ~ REF IxItemRec;
IxItemRec:
TYPE ~
RECORD[
ix: IndexProps.IndexEntry,
range: TextNode.Span ← TextNode.nullSpan,
button: TiogaButtons.TiogaButton ← NIL
];
InsertNewIndexEntry: PROCEDURE [ix: IndexProps.IndexEntry, range: TextNode.Span,
index: Index]
RETURNS [ixItem: IxItem];
DuplicateKey: SIGNAL; -- if ix entry already present in the table
RopeForIndexReference: PROCEDURE [ixItem: IxItem,
seenPage, seenSee: BOOLEAN ← FALSE]
RETURNS [reference: Rope.ROPE ← NIL, sawPage, sawSee: BOOLEAN ← FALSE];
DeleteIndexEntry: PROCEDURE [ixItem: IxItem, index: Index];