-- PPTree.Mesa
-- Russ Atkinson, June 8, 1982 3:13 pm

PPTree: CEDAR DEFINITIONS = BEGIN

-- data structures

Link: TYPE = REF ANY;
Null: Link = NIL;

Node: TYPE = RECORD [
name: NodeName,
attr: PACKED ARRAY AttrId OF BOOLALL[FALSE],
info: CARDINAL ← 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, spareTC,
implicitTC, frameTC, discrimTC,
entry, internal,
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, lst, lstf,
syscall, spareS1, spareS2, 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,
dot, cdot, dollar,
create,
not,
uminus,
addr,
uparrow,
min, max, lengthen, 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,

self,
mergecons};

-- 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.