File: ParquetInternal.mesa   
Copyright © 1984 by Xerox Corporation. All rights reserved.
Created by: Mayo, July 16, 1984 4:44:25 pm PDT
Last Edited by: Mayo, August 25, 1984 0:37:31 am PDT
-- Internal definitions for Parquet.
DIRECTORY
Rope USING [ROPE],
SymTab USING [Ref],
Parquet USING [Tile, PlacedTile, Mark, Module, Position, Orientation],
CD USING [Design, ObPtr, Position, ApplicationList, Number, lambda],
CDOrient USING [MapPosition];
ParquetInternal: CEDAR DEFINITIONS IMPORTS CDOrient = BEGIN
l: INT ~ CD.lambda;
ShiftedCell: TYPE = REF ShiftedCellRec;
ShiftedCellRec: TYPE = RECORD [ -- like a ChipNDale cell but origin is not at lower-left corner
llCorner: CD.Position ← [LAST[CD.Number], LAST[CD.Number]],
urCorner: CD.Position ← [FIRST[CD.Number], FIRST[CD.Number]],
contents: CD.ApplicationList ← NIL,
name: Rope.ROPENIL,
parent: ShiftedCell ← NIL,
children: LIST OF ShiftedCell ← NIL -- sizes of children not included in llCorner and urCorner
];
Mod: TYPE = REF ModRec;
ModRec: TYPE = RECORD [
-- default marks for convertion to a tile
ur, ul, ll, lr, top, bottom, left, right: REF CD.Position ← NIL,
eventualOwner: CD.Design ← NIL, -- a design that will receive the module
current: ShiftedCell ← NIL,
topCell: ShiftedCell ← NIL,
cellTab: SymTab.Ref ← NIL,
checkTable: VerficationTable ← NIL,
inheritedErrors: CARDINAL ← 0
];
verificationTableSize: INT = 5047;  -- hash table size
VerficationTable: TYPE = REF VerficationTableRec;
VerficationTableRec: TYPE = ARRAY [0..verificationTableSize) OF PlacedCheckList ← ALL[NIL];
PlacedCheckList: TYPE = LIST OF PlacedCheck;
PlacedCheck: TYPE = RECORD [
duplicate: BOOLFALSE,
pos: CD.Position
];
ModuleIntoCell: PROC [module: Parquet.Module, name: Rope.ROPENIL, applicationsPerScreenDot: INT ← -1] RETURNS [CD.ObPtr];
CheckValid: PROC [module: Parquet.Module] RETURNS [Mod];
-- apply an orientation to a point
MapPoint: PUBLIC PROC [p: Parquet.Position, cellSize: Parquet.Position, orient: Parquet.Orientation] RETURNS [Parquet.Position] = INLINE BEGIN
RETURN[CDOrient.MapPosition[
itemInCell: [x1: p.x, y1: p.y, x2: p.x, y2: p.y],
cellSize: cellSize, cellInstOrient: orient]];
END;
-- store one mark into a tile
StoreMark: PROC [t: Parquet.Tile, m: Parquet.Mark];
-- create default marks for a tile
DefaultMarks: PROC [t: Parquet.Tile, m: Mod ← NIL];
-- Procedure to rotate & mirror standard marks by exchanging them with each other.
OrientStdMark: PROC [cell: Parquet.Tile, orient: Parquet.Orientation] RETURNS [left, right, top, bottom, ul, ur, ll, lr: Parquet.Mark];
-- Update the default marks for a module now that a new tile has been placed
SetModDefaults: PUBLIC PROC [m: Mod, pc: Parquet.PlacedTile];
END.