SourceMarks.mesa
Copyright Ó 1988, 1991 by Xerox Corporation. All rights reserved.
Russ Atkinson (RRA) February 2, 1988 10:17:24 am PST
SourceMarks: CEDAR DEFINITIONS = BEGIN
NoSuchSource:
ERROR;
Raised for some operations if no such source position exists.
StartSource:
PROC [startPos:
INT, mark:
REF ¬
NIL];
Starts a source range (with optional initial mark). Duplicates are discarded.
EndSource:
PROC [startPos:
INT, endPos:
INT];
Ends a source range. Raises NoSuchSource if startPos was not previously used in a StartSource operation.
MarkSource:
PROC [startPos:
INT, mark:
REF, overWrite:
BOOL];
Sets the mark for the given source position. If overWrite, then always sets the mark, otherwise only sets the mark if it is new. Raises NoSuchSource if startPos was not previously used in a StartSource operation.
GetProps:
PROC [startPos:
INT]
RETURNS [found:
BOOL, endPos:
INT, mark:
REF];
For the given source position, returns the current properties. [FALSE, -1, NIL] is returned if
GetNext:
PROC [startPos:
INT]
RETURNS [
INT];
Returns the smallest source position after the given source position that actually has an associated node. Raises NoSuchSource if startPos was not previously used in a StartSource operation.
Reset:
PROC;
Resets the storage to the ground state.
END.