MPTreeOps.mesa
Copyright Ó 1985, 1986, 1987, 1991 by Xerox Corporation. All rights reserved.
Russ Atkinson (RRA) January 19, 1987 7:19:19 pm PST
Michael Plass, September 5, 1991 8:36 pm PDT
DIRECTORY
MPLeaves USING [Leaf, HTIndex, ISEIndex],
MPTree;
MPTreeOps: CEDAR DEFINITIONS = BEGIN OPEN Tree: MPTree, MPLeaves;
tree construction interface
Initialize: PROC;
Reset: PROC;
Finalize: PROC;
PushTree: PROC [v: Tree.Link];
PopTree: PROC RETURNS [Tree.Link];
InsertTree: PROC [Tree.Link, NAT];
ExtractTree: PROC [NAT] RETURNS [Tree.Link];
MakeNode: PROC [name: Tree.NodeName, count: INTEGER] RETURNS [Tree.Link];
MakeList: PROC [size: INTEGER] RETURNS [Tree.Link];
PushNode: PROC [name: Tree.NodeName, count: INTEGER];
PushList: PROC [size: INTEGER];
PushProperList: PROC [size: INTEGER];
PushHash: PROC [hti: Leaf] = INLINE {PushTree[hti]};  -- HTIndex
PushSe: PROC [sei: ISEIndex] = INLINE {PushTree[sei]}; -- ISEIndex
PushLit: PROC [lti: Leaf] = INLINE {PushTree[lti]};  -- LTIndex
PushStringLit: PROC [sti: Leaf] = INLINE {PushTree[sti]}; -- STIndex
SetInfo: PROC [info: CARD];
SetSubInfo: PROC [subInfo: Tree.SubInfo];
SetAttr: PROC [which: Tree.AttrId, value: BOOL];
SetAttrs: PROC[attr1, attr2, attr3: BOOL ¬ FALSE] = INLINE {
SetAttr[1,attr1]; SetAttr[2,attr2]; SetAttr[3,attr3]
};
FreeTree: PROC [t: Tree.Link] RETURNS [Tree.Link] = INLINE {RETURN [Tree.Null]};
tree attributes
GetHash: PROC [t: Tree.Link] RETURNS [HTIndex];
GetNode: PROC [t: Tree.Link] RETURNS [Tree.Handle];
GetSe: PROC [t: Tree.Link] RETURNS [ISEIndex];
NSons: PROC [t: Tree.Link] RETURNS [NAT];
NthSon: PROC [t: Tree.Link, n: Tree.SonId] RETURNS [Tree.Link];
OpName: PROC [t: Tree.Link] RETURNS [Tree.NodeName];
tree manipulation
ScanSons: PROC [root: Tree.Link, action: Tree.Scan];
UpdateLeaves: PROC [root: Tree.Link, map: Tree.Map] RETURNS [v: Tree.Link];
list testing
ListLength: PROC [t: Tree.Link] RETURNS [NAT];
ListHead: PROC [t: Tree.Link] RETURNS [Tree.Link];
ListTail: PROC [t: Tree.Link] RETURNS [Tree.Link];
list manipulation
ScanList: PROC [root: Tree.Link, action: Tree.Scan];
SearchList: PROC [root: Tree.Link, test: Tree.Test];
ReverseScanList: PROC [root: Tree.Link, action: Tree.Scan];
UpdateList: PROC [root: Tree.Link, map: Tree.Map] RETURNS [Tree.Link];
ReverseUpdateList: PROC [root: Tree.Link, map: Tree.Map] RETURNS [Tree.Link];
cross-table tree copying
CopyTree: PROC [root: Tree.Id, map: Tree.Map] RETURNS [v: Tree.Link];
IdentityMap: Tree.Map;
END.