MakeDoParsing.mesa
Copyright Ó 1989, 1991 by Xerox Corporation. All rights reserved.
Eduardo Pelegri-Llopart, August 21, 1989 10:05:57 am PDT
DIRECTORY
IO USING [STREAM],
MakeDo USING [End, notExistTime, Node, Time],
RefTab USING [Ref],
Rope USING [ROPE];
MakeDoParsing: CEDAR DEFINITIONS
~ BEGIN
Time: TYPE ~ MakeDo.Time;
ROPE: TYPE ~ Rope.ROPE;
STREAM: TYPE ~ IO.STREAM;
End: TYPE ~ MakeDo.End;
Node: TYPE ~ MakeDo.Node;
ParserClass: TYPE ~ ATOM;
ParseData: TYPE ~ RefTab.Ref;
ParseEntry: TYPE ~ REF ParseEntryRep; ParseEntryRep: TYPE ~ RECORD [
source: ROPE,
stamp: Time ¬ MakeDo.notExistTime,
parserClass: ParserClass,
parseData: ParseData
];
Parser: TYPE ~ REF ParserRep; ParserRep: TYPE ~ RECORD [
parserClass: ParserClass,
parserName: ROPE,
parserProc: ParserProc,
parserData: REF
];
ParserProc: TYPE ~ PROC [stream: STREAM, parserData: REF] RETURNS [parseData: ParseData];
raises MakeDoParsing.SyntaxError if one is found....
Data includes:
$Directory => List of file names of modules in the directory clause
$StaticRequests => Ditto for static requests (only for $Config)
$Requests => Modules requested in a $Config
$SourceType => one of
$CedarProg, $CedarMonitor, $CedarDefs, $Config, $C
ParserClassFail: ERROR;
raise if the parser class does not exist;
SyntaxError: SIGNAL [synMsg: ROPE];
GetParseEntry: PROC [node: Node, class: ParserClass] RETURNS [ParseEntry];
Returns non-NIL if the file described by the node exists and can be parsed by the given class
Raisses ParserClassFail if the class is not registered
AddParser: PROC [parser: Parser, end: End];
Registers a new parser at end.
GetParser: PROC [class: ParserClass] RETURNS [parser: Parser];
Get the parser with this class.
EnumerateParsers: PROC [to: PROC [parser: Parser] RETURNS [stop: BOOL ¬ FALSE]];
Enumerate all the parsers.
ClearCache: PROC;
Clear all cached information
END.