TiogaLooks.mesa; written by Bill Paxton, February 1981
last edit by Bill Paxton, June 1, 1983 10:09 am
last edit by McGregor, March 31, 1983 11:47 am
DIRECTORY
Rope;
TiogaLooks: CEDAR DEFINITIONS =
BEGIN
Runs: TYPE = REF RunsBody;
Looks: TYPE = PACKED ARRAY Look OF Bit;
Look: TYPE = CHAR [firstLook..lastLook]; -- 32 bits indexed from 'a
firstLook: CHAR = 'a;
lastLook: CHAR = firstLook+31;
Bit: TYPE = BOOLFALSE;
noLooks: Looks = ALL[FALSE];
allLooks: Looks = ALL[TRUE];
Offset: TYPE = INT ← 0;
MaxOffset: Offset = LAST[Offset];
LooksToRope: PROC [looks: Looks] RETURNS [rope: Rope.ROPE];
RopeToLooks: PROC [rope: Rope.ROPE] RETURNS [looks: Looks];
***** Private declarations
RunsBody: TYPE = RECORD [SELECT tag: * FROM
RunsBody is modeled after RopeRep from ROPE.Mesa
base => [runs: SEQUENCE length: NAT OF Run],
node => [SELECT case: * FROM
substr => [size: Offset, base: Runs, start: Offset],
concat => [size: Offset, base,rest: Runs, pos: Offset],
replace => [size: Offset, base,replace: Runs, start,oldPos,newPos: Offset],
change => [size: Offset, base: Runs, remove,add:Looks, start,len: Offset],
ENDCASE],
ENDCASE];
Run: TYPE = RECORD [after: Offset, looks: Looks];
BaseRuns: TYPE = REF Tbase;
Tbase: TYPE = base RunsBody;
Tsubstr: TYPE = substr node RunsBody;
Tconcat: TYPE = concat node RunsBody;
Treplace: TYPE = replace node RunsBody;
Tchange: TYPE = change node RunsBody;
END.