TiogaFileOps.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
written by Bill Paxton. June 1982
last written by Paxton. August 12, 1982 3:23 pm
Doug Wyatt, March 3, 1985 2:23:18 pm PST
Rick Beach, March 15, 1985 10:21:11 am PST
=
BEGIN
Ref: TYPE = REF NodeBody;
NodeBody: TYPE;
CreateRoot: PROC RETURNS [root: Ref];
InsertNode:
PROC [x: Ref, child:
BOOL ←
FALSE]
RETURNS [new: Ref];
if ~child then new is immediate next sibling of x
else new is first child of x
InsertAsLastChild:
PROC [x: Ref, prevLast: Ref ←
NIL]
RETURNS [new: Ref];
prevLast is optional accelerator
SetContents: PROC [x: Ref, txt: Rope.ROPE];
AddLooks:
PROC [x: Ref, start, len:
INT, look:
CHAR ['a..'z], root: Ref ←
NIL];
start is char index of first char to get looks added. count from 0
can omit root, but runs faster if you supply it
must set contents before add looks
can add several different looks for any given character
can add looks for overlapping spans of text
SetFormat:
PROC [x: Ref, format: Rope.
ROPE];
e.g., SetStyle[node, "Title"];
SetStyle:
PROC [x: Ref, style: Rope.
ROPE];
e.g., SetStyle[root, "Mesa"];
Store:
PROC [x: Ref, filename: Rope.
ROPE];
x should be from call on CreateRoot
e.g., Store[root, "Foo.Tioga"];