File ParserTypeDefs.mesa
March 5, 1980 4:57 PM
September 5, 1980 4:18 PM by MN
Last Edited by: McCreight, January 27, 1985 5:44:38 pm PST
ParserTypeDefs: CEDAR DEFINITIONS =
BEGIN
Point: TYPE = RECORD [x,y: INT];
PointList: TYPE = LIST OF Point ← NIL;
Path: TYPE = REF PathRecord;
PathRecord: TYPE = RECORD [first, last: PointList, length: CARDINAL];
TEntry: TYPE = REF ANY -- {Mirror, Translate, Rotate} --NIL;
Mirror: TYPE = REF MirrorRec ← NIL;
MirrorRec: TYPE = RECORD [coords: {X,Y}];
Translate: TYPE = REF TranslateRec ← NIL;
TranslateRec: TYPE = RECORD [x, y: INT];
Rotate: TYPE = REF RotateRec ← NIL;
RotateRec: TYPE = RECORD [xRot, yRot: INT];
TList: TYPE = REF TRecord ← NIL;
TRecord: TYPE = RECORD [first, last: LIST OF TEntry, length: CARDINAL];
Should be called once before using any of the path procedures below
InitTypes: PROCEDURE RETURNS [BOOL];
FinishTypes: PROCEDURE RETURNS [BOOL];
The following routines support access to Paths, which are essentially queues. AllocatePath returns a brand new, empty path. FreePath frees all storage used by a path (a path that has been freed can no longer be used, i.e. you must use AllocatePath to get another). AppendPoint and RemovePoint add and delete points from their respective ends.
AllocatePath: PROCEDURE RETURNS [Path];
FreePath: PROCEDURE [Path];
AppendPoint: PROCEDURE [Path, Point];
RemovePoint: PROCEDURE [Path] RETURNS [BOOL, Point];
CopyPath: PROCEDURE[from,to: Path];
PathLength: PROCEDURE [Path] RETURNS [CARDINAL];
The following routines support access to TLists, which are essentially queues. AllocateTList returns a brand new, empty TList. FreeTList frees all storage used by a TList (a TList that has been freed can no longer be used, i.e. you must use AllocateTList to get another). AppendTList and RemoveTList add and delete LinkedTEntries from their respective ends.
AllocateTList: PROCEDURE RETURNS [TList];
FreeTList: PROCEDURE [TList];
AppendTList: PROCEDURE [TList, TEntry];
RemoveTList: PROCEDURE [TList] RETURNS [BOOL, TEntry];
TListLength: PROCEDURE [TList] RETURNS [CARDINAL];
END.