TiogaFind.mesa
Copyright Ó 1991, 1992 by Xerox Corporation. All rights reserved.
Doug Wyatt, March 16, 1992 2:15 pm PST
DIRECTORY
TextFind USING [Direction, Target, Subs],
Tioga USING [Node, Location, Event];
TiogaFind: CEDAR DEFINITIONS ~ BEGIN
Node: TYPE ~ Tioga.Node;
Location: TYPE ~ Tioga.Location;
Event:
TYPE ~ Tioga.Event;
Direction: TYPE ~ TextFind.Direction; -- {forward, backward}
Target: TYPE ~ TextFind.Target;
Subs:
TYPE ~ TextFind.Subs;
TargetFromNode:
PROC [node: Node, start:
INT ¬ 0, len:
INT ¬
INT.
LAST,
pattern:
BOOL ¬
FALSE]
RETURNS [Target];
Match:
TYPE ~ {any, word, def, all};
Search:
PROC [direction: Direction, loc1, loc2: Location,
target: Target ¬
NIL, case:
BOOL ¬
TRUE, match: Match ¬ any,
checkLooks:
BOOL ¬
FALSE, looksExact:
BOOL ¬
FALSE,
checkComment:
BOOL ¬
FALSE, comment:
BOOL ¬
FALSE,
checkFormat:
BOOL ¬
FALSE, format:
ATOM ¬
NIL,
checkStyle:
BOOL ¬
FALSE, style:
ATOM ¬
NIL,
styleProc:
PROC [Node]
RETURNS [
ATOM] ¬
NIL,
interrupt:
REF
BOOL ¬
NIL]
RETURNS [node: Node ¬
NIL,
matchStart, matchEnd:
INT ¬ 0, subs: Subs ¬
NIL];
search in direction through [loc1..loc2)
LiteralSearch:
PROC [direction: Direction, loc1, loc2: Location,
target: Node ¬
NIL, targetStart:
INT ¬ 0, targetLen:
INT ¬
INT.
LAST,
case:
BOOL ¬
TRUE, match: Match ¬ any,
interrupt:
REF
BOOL ¬
NIL]
RETURNS [node: Node ¬
NIL,
matchStart, matchEnd:
INT ¬ 0];
search in direction through [loc1..loc2)
Replace:
PROC [dest: Node, destStart:
INT ¬ 0, destLen:
INT ¬
INT.
LAST,
source: Node, sourceStart:
INT ¬ 0, sourceLen:
INT ¬
INT.
LAST,
pattern:
BOOL ¬
FALSE, subs: Subs ¬
NIL, event: Event ¬
NIL]
RETURNS [resultStart, resultLen:
INT];
ApplyProc:
TYPE ~
PROC [node: Node, matchStart, matchEnd:
INT, subs: Subs]
RETURNS [continue, bumpCount:
BOOL ¬
FALSE, from, delta:
INT ¬ 0];
Apply:
PROC [proc: ApplyProc, loc1, loc2: Location,
target: Target ¬
NIL, case:
BOOL ¬
TRUE, match: Match ¬ any,
checkLooks:
BOOL ¬
FALSE, looksExact:
BOOL ¬
FALSE,
checkComment:
BOOL ¬
FALSE, comment:
BOOL ¬
FALSE,
checkFormat:
BOOL ¬
FALSE, format:
ATOM ¬
NIL,
checkStyle:
BOOL ¬
FALSE, style:
ATOM ¬
NIL,
styleProc:
PROC [Node]
RETURNS [
ATOM] ¬
NIL,
interrupt:
REF
BOOL ¬
NIL]
RETURNS [count:
INT];
END.