Grep.mesa
Copyright Ó 1985, 1986 by Xerox Corporation. All rights reserved.
Jim Donahue July 16, 1985 8:20:20 am PDT
Peter Kessler May 12, 1987 5:31:20 pm PDT
Ken Fishkin, June 19, 1991 4:24 pm PDT
DIRECTORY
IO USING [STREAM],
RegularExpression USING [Finder],
Rope USING [ROPE];
Grep: CEDAR DEFINITIONS = {
Switches: TYPE = {oncePerLine, textOnly, locations, verbose, fileNamesOnly, except, quiet};
SwitchSettings: TYPE = ARRAY Switches OF BOOLEAN;
GetSwitches: PROC[cmdLine: LIST OF Rope.ROPE, prefixLen: INT ← 2] RETURNS[ switches: SwitchSettings, remainder: LIST OF Rope.ROPE ];
RegularOutput: PROC[switches: SwitchSettings] RETURNS[ yes: BOOL ];
TRUE for the default settings of all of the switches
GrepStream: PROC[ pattern: RegularExpression.Finder, inStream, outStream: IO.STREAM, switches: SwitchSettings, fileName: Rope.ROPE, interrupt: REF BOOL ] RETURNS [numberOfHits: INT];
}.