DFUtilitiesExtras.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Created by Bertrand Serlet, August 28, 1986 4:31:08 pm PDT
Bertrand Serlet September 27, 1986 5:15:26 pm PDT
This interface adds one more function to DFUtilities, one that parses a DF file and DOES CACHING! Eventually, it should be added in DFUtilities.
DIRECTORY DFUtilities, Rope;
DFUtilitiesExtras: CEDAR DEFINITIONS ~ BEGIN OPEN DFUtilities, Rope;
ParseFromFile: PROC [df: ROPE, proc: ProcessItemProc, filter: Filter ← []];
Opens the df file 'df', using the function FS.StreamOpen.
For each item parsed, 'filter' is examined and, if the item "passes" the filter, as in ParseFromStream, 'proc' is invoked with the item as a parameter.
Extremely fast when df is a full path name in the bracket format (including a version number) previously cached.
Might raise FS.ERROR or FileSyntaxError.
FileSyntaxError: ERROR [reason: ROPE, position: INT];
This error is raised by ParseFromFile when a syntax error is detected in the input DF. The precise position cannot be guaranteed. 'reason' is a brief prose description of the error and is intended for human, not program, interpretation.
END.