<> <> <> DIRECTORY Basics USING [Comparison], Rope USING [ROPE], Rosary USING [ROSARY]; IndexProps: CEDAR DEFINITIONS = BEGIN ROPE: TYPE ~ Rope.ROPE; IndexEntryList: TYPE ~ Rosary.ROSARY; -- immutable list of index entries IndexEntry: TYPE = REF IndexEntryRec; IndexEntryRec: TYPE = RECORD [ kindOfIndex: ATOM, -- for example: $Index, $AuthorIndex, $InterfaceIndex, $CommandIndex kindOfEntry: ATOM, -- for example: $Ordinary, $See, $SeeAlso, $Definition, $Example phrases: Phrases, seePhrases: Phrases _ NIL, sortAsPhrases: Phrases _ NIL ]; Phrases: TYPE = LIST OF ROPE; <> <> EntryToRope: PROCEDURE [ix: IndexEntry] RETURNS [rope: ROPE]; <> RopeToEntry: PROCEDURE [rope: ROPE] RETURNS [ix: IndexEntry]; <> <<>> Compare: PROC [ix1, ix2: IndexEntry] RETURNS [result: Basics.Comparison, unmatched: Phrases]; <> <<>> AddEntryToList: PROCEDURE [ix: IndexEntry, ixList: IndexEntryList] RETURNS [IndexEntryList]; <> IndexEntryProc: TYPE ~ PROC [ix: IndexEntry]; <<>> MapIndexEntryList: PROCEDURE [ixList: IndexEntryList, action: IndexEntryProc]; <> MalformedPropRope: ERROR; KeywordExpectedButMissing: ERROR; UnrecognizedKeyword: ERROR; SuperfluousStuff: ERROR; MalformedIndexPhrases: ERROR; END.