" *)
TYPE
Store <: REFANY;
T <: REFANY;
PROCEDURE NewStore(): Store RAISES {};
Create new Comment store
PROCEDURE AddToStore(
body: Text.T;
pos: M3CSrcPos.T;
precedingNode: M3AST_AS.SRC_NODE;
VAR store: Store)
: T
RAISES {};
Add a new Comment to a store, giving its body, position and the preceding
source node
PROCEDURE AddFollowingNode(
followingNode: M3AST_AS.SRC_NODE;
store: Store)
RAISES {};
Called after a Comment (or Comments) has been added by 'AddToStore' and
another source node is encountered. Marks all the Comments after the last
source node as having the given 'followingNode'
The Comments in a Comment store can be iterated using 'NewIter' and 'Next'.
The iterator works even while the store is being built up using 'AddToStore'
TYPE
Iter <: REFANY;
PROCEDURE NewIter(ps: Store): Iter RAISES {};
Return iterator for Comments. They will be iterated in ascending positional
order. If 'after' is not null only the Comments whose position is greater than
'after' will be iterated
PROCEDURE Next(VAR iter: Iter; VAR t: T): BOOLEAN RAISES {};
'Next' returns FALSE if 'iter' is NIL
The following enquiry functions can be used on all Comments
PROCEDURE Position(t: T): M3CSrcPos.T RAISES {};
Source position of Comment
PROCEDURE Body(t: T): Text.T RAISES {};
Text of Comment. Includes opening and closing brackets
PROCEDURE PrecedingNode(t: T): M3AST_AS.SRC_NODE RAISES {};
Return the node which immediately precedes the given Comment, or NIL if there
is no such node
PROCEDURE FollowingNode(t: T): M3AST_AS.SRC_NODE RAISES {};
Return the node which immediately follows the given Comment, or NIL if there
is no such node
END M3CComment.