DIRECTORY Rope USING [ROPE], TextNode USING [Node], UndoEvent USING [Event]; AbbrevExpand: CEDAR DEFINITIONS = BEGIN Node: TYPE = TextNode.Node; MaxLen: INT = LAST[INT]; ROPE: TYPE = Rope.ROPE; Event: TYPE = UndoEvent.Event; Load: PROC [fileName, dictName: ROPE, start: INT _ 0, len: INT _ MaxLen] RETURNS [count: NAT]; Clear: PROC [dictName: ROPE]; IllFormedDef: ERROR; Expand: PROC [keyNode: Node, keyEnd: INT, dict: ROPE, event: Event _ NIL] RETURNS [foundIt: BOOL, keyDeterminesDict: BOOL, keyStart, keyLen, resultLen: INT, commands: LIST OF REF ANY]; Validate: PROC [name: ATOM] RETURNS [changed: BOOL _ FALSE]; ValidateAll: PROC RETURNS [changed: BOOL _ FALSE]; END. ‚AbbrevExpand.mesa Copyright Σ 1985, 1986, 1988 by Xerox Corporation. All rights reserved. written by Bill Paxton, August 1981 last edit by Bill Paxton, April 5, 1982 1:35 pm Michael Plass, May 1, 1986 11:55:32 am PDT Doug Wyatt, February 17, 1988 5:28:25 pm PST This is the interface for abbreviation expansion in Tioga the following take an atom as the name of the dictionary to operate on will automatically try to load file with extension "Abbreviations" only tries this once per session must explicitly load it reads the file and adds the abbreviations to the specified dictionary returns number of abbreviations removes all entries from the dictionary if when try to Expand, definition not of form =, then get error key must be 1 or more alphadigits optionally can have blanks (spaces/tabs/cr's) between key and "=" looks in dictionary for entry with matching key match ignores capitalization of keys unless key is of form . in which case it only looks in the specified dictionary and returns with keyDeterminesDict=TRUE if finds a matching entry, then replace key text by text from entry if key in entry is followed by blanks before "=", then skip one blank in text after the "=" if key text was all upper case, force new text uppercase also if key text not all upper but had initial cap, make new text have an initial cap otherwise, don't change capitalization of new text if first character of key had looks, add those looks to new text if entry node has a nonnull type name, set key node type name if entry node has children, insert copies of them as children of key node return start and len of new text can optionally have command list enclosed in ( )'s between key name and '= Checks for a new namefile binding, and reloads if necessary name should be a lower-case atom Returns TRUE if the reload happened Checks for any new namefile bindings, and reloads as required Κ ˜codešœ™KšœH™HKšœ#™#Kšœ/™/K™*K™,—K˜Kšœ9™9K˜šΟk ˜ Kšœœœ˜Kšœ œ˜Kšœ œ ˜—K˜KšΠbl œœ ˜Kšœ˜K˜Kšœœ˜Kšœœœœ˜Kšœœœ˜Kšœœ˜K˜KšœF™FšœB™BKšœ ™ Kšœ™K˜—šΟnœœœ œ œ œ œ˜_KšœE™EKšœ™K˜—šŸœœ œ˜Kšœ'™'K˜—šœœ˜KšœJ™JKšœ!™!KšœA™AK˜—šŸœœœœœœ œœœ œœœœ˜Ήšœ/™/Kšœ$™$—šœ*™*šœ7™7Kšœ'™'——šœ™šœ#™#šœ1™1Kšœ)™)——Kšœ=™=šœ/™/Kšœ!™!—Kšœ2™2Kšœ@™@Kšœ=™=KšœI™IKšœ ™ —KšœJ™JK˜—K˜š Ÿœœœœ œœ˜™>K™—K˜Kšœ˜K˜—…—² Τ