MobTree.Mesa
Copyright Ó 1985, 1989, 1991 by Xerox Corporation. All rights reserved.
Satterthwaite, January 10, 1983 12:38 pm
Russ Atkinson (RRA) March 7, 1985 0:51:38 am PST
Andy Litman May 3, 1988 9:42:02 pm PDT
JKF November 28, 1989 3:14:44 pm PST
DIRECTORY
MobDefs USING [treetype],
MobHashTypes USING [HTIndex],
MobSymbols USING [HTIndex, HTNull, STIndex],
Table USING [Base, Finger, Selector];
MobTree: DEFINITIONS = {
treeType: Table.Selector~MobDefs.treetype;
Base: TYPE~Table.Base;
Finger: TYPE~Table.Finger;
LitIndex: TYPE = MobHashTypes.HTIndex;
data structures
Link: TYPE~RECORD [
SELECT tag: * FROM
subtree => [index: Index],
hash => [index: MobSymbols.HTIndex],
symbol => [index: MobSymbols.STIndex],
literal => [index: LitIndex]
ENDCASE];
Node: TYPE ~ MACHINE DEPENDENT RECORD [
free: BOOL, -- reserved for allocator
name: NodeName,
attrs: PACKED ARRAY AttrId OF BOOL ¬ ALL[FALSE],
shared: BOOL,
nSons: [0..maxNSons],
info: Info,
son: SEQUENCE COMPUTED SonId OF Link];
--son: ARRAY [1..1) OF Link];
SonId: TYPE = [1..NAT.LAST);
Info: TYPE~CARD16;
AttrId: TYPE~{codeLinks, explicitLinkLoc, exportsALL};
maxNSons: CARDINAL~177b;
Index: TYPE~Base RELATIVE LONG POINTER TO Node;
nullIndex: Index~Index.FIRST;
null: Link~[subtree[index~nullIndex]];
nullId: Link~[hash[index~MobSymbols.HTNull]];
NodeName: TYPE~{
general tree constructors
list, item,
declarations
source,
config,
expressions
module,
assign,
plus,
then,
file names
dot,
slash,
nil
none
};
tree manipulation
Id: TYPE~RECORD [baseP: Finger, link: Link];
Scan: TYPE~PROC [t: Link];
Map: TYPE~PROC [t: Link] RETURNS [v: Link];
Test: TYPE~PROC [t: Link] RETURNS [BOOL];
sons of config subtree
ConfigSons: TYPE = MACHINE DEPENDENT {
(0), imports(1), exports(2), statics(3), dynamics(4), control(5), name(6), body(7) };
}.