Arrays.mesa
Copyright Ó 1991 by Xerox Corporation. All rights reserved.
Sturgis, January 27, 1989 4:03:29 pm PST
Last changed by Theimer on July 16, 1989 4:42:54 pm PDT
Spreitze, May 21, 1991 8:21 am PDT
DIRECTORY
CirioTypes USING[CompilerContext, Mem, Node, Type];
Arrays: CEDAR DEFINITIONS =
BEGIN
CC: TYPE = CirioTypes.CompilerContext;
Node: TYPE = CirioTypes.Node;
Mem: TYPE = CirioTypes.Mem;
Type: TYPE = CirioTypes.Type;
ArrayTypeProcs: TYPE = RECORD [
createIndirectNode: PROC [cc: CC, data: REF ANY, indirectType, targetType: Type, mem: Mem] RETURNS [Node],
getBitSize: PROC[indirectType: Type, cc: CC, data: REF ANY] RETURNS[CARD],
getEntryType: PROC[cc: CC, data: REF ANY] RETURNS[Type]
];
CreateArrayType: PROC[indexSet: Type, procs: REF ArrayTypeProcs, cc: CC, data: REF ANY] RETURNS[Type];
CirioCode.GetTypeClass[type] = $array
CCTypes.GetTypeRepresentation will return NIL.
ArrayIndirectNodeInfo: TYPE = REF ArrayIndirectNodeInfoBody;
ArrayIndirectNodeInfoBody: TYPE = RECORD[
selectEntry: PROC[index: CARD, cc: CC, data: REF ANY] RETURNS[Node],
getPointer: PROC[data: REF ANY, cc: CC] RETURNS[CirioTypes.Node],
data: REF ANY];
Note: selectEntry[0, data] selects the first entry in the array.
CreateArrayIndirectNode: PROC[type: Type, info: ArrayIndirectNodeInfo] RETURNS[Node];
ArrayIndirect nodes support the getRepresentation object procedure (CedarCode.GetNodeRepresentation). They return the info parameter supplied to the Create call.
END.