MPTree.mesa
Copyright Ó 1985, 1986, 1987, 1991 by Xerox Corporation. All rights reserved.
Russ Atkinson (RRA) January 19, 1987 7:18:59 pm PST
Michael Plass, September 5, 1991 8:36 pm PDT
A Mimosa parse tree
MPTree: CEDAR DEFINITIONS = BEGIN
data structures
Link: TYPE = REF ANY;
Null: Link = NIL;
SubInfo: TYPE ~ {null, packedOption, msbitOption, lsbitOption, nativeOption, word8Option, word16Option, word32Option, word64Option}; -- used in the optionTC case
Node: TYPE = PACKED RECORD [
name: NodeName,
attr: PACKED ARRAY AttrId OF BOOL ¬ ALL[FALSE],
subInfo: SubInfo ¬ null,
info: CARD ¬ 0,
son: SEQUENCE sonLimit: [1..MaxNSons] OF Link];
MaxNSons: PRIVATE CARDINAL = LAST[INTEGER];
SonId: TYPE = [1..MaxNSons);
AttrId: TYPE = [1..3];
Handle: TYPE = REF Node;
NullHandle: Handle = NIL;
NodeName: TYPE = {
general tree constructors
list, item,
declarations
decl, typedecl,
basicTC, enumeratedTC, recordTC, monitoredTC, variantTC,
refTC, pointerTC, listTC, arrayTC, arraydescTC, sequenceTC,
procTC, processTC, portTC, signalTC, errorTC, programTC,
anyTC, definitionTC, unionTC, relativeTC,
subrangeTC, longTC, opaqueTC, zoneTC, linkTC, varTC,
implicitTC, frameTC, discrimTC,
paintTC, optionTC, spareTC,
unit, diritem, module, body, inline, lambda, block,
statements
assign, extract,
if,
case, casetest, caseswitch,
bind,
do, forseq, upthru, downthru,
return, result,
goto, exit, loop,
free,
resume, reject, continue, retry, catchmark,
restart, stop,
lock, wait, notify, broadcast, unlock,
null,
label,
open,
enable, catch,
dst, lste, lstf,
syscall, checked, lst, spareS3,
subst, call, portcall, signal, error, syserror, xerror,
start, join,
expressions
apply,
callx, portcallx, signalx, errorx, syserrorx, startx, fork, joinx,
index, dindex, seqindex, reloc,
construct, union, rowcons, sequence, listcons,
substx,
ifx, casex, bindx,
assignx, extractx,
or, and,
relE, relN, relL, relGE, relG, relLE, in, notin,
plus, minus, times, div, mod, power,
dot, cdot, dollar,
create,
not,
uminus,
addr,
uparrow,
min, max, ord, val, abs, all,
size, first, last, pred, succ,
arraydesc, length, base,
loophole,
nil,
new,
void,
clit, llit,
cast, check, float, pad, chop, safen,
syscallx, narrow, istype,
openx,
mwconst, cons,
atom, typecode,
stringinit, textlit, signalinit, procinit,
intOO, intOC, intCO, intCC,
thread,
none,
exlist,
initlist,
ditem,
lengthen, shorten,
self,
gcrt, proccheck,
entry, internal,
invalid};
tree manipulation
Id: TYPE = Link;
Scan: TYPE = PROC [t: Link];
Map: TYPE = PROC [t: Link] RETURNS [v: Link];
Test: TYPE = PROC [t: Link] RETURNS [BOOL];
END.