CreateBooleanType:
PROC[cc:
CC, bti: BasicTypeInfo]
RETURNS[Type];
implemented in CedarOtherPureTypesImpl
CirioCode.GetTypeClass[type] = $Boolean
CCTypes.GetTypeRepresentation will return bti.
CreateCharType:
PROC[cc:
CC, bti: BasicTypeInfo]
RETURNS[Type];
implemented in CedarOtherPureTypesImpl
CirioCode.GetTypeClass[type] = $char
CCTypes.GetTypeRepresentation will return bti.
Internal error types
CreateUnknownType:
PROC[cc:
CC, explanation:
ROPE ←
NIL]
RETURNS[Type];
CirioCode.GetTypeClass[type] = $unknown
CCTypes.GetTypeRepresentation will return the ROPE.
CreateTransparentType:
PROC[cc:
CC, tti: TransparentTypeInfo]
RETURNS[Type];
CirioCode.GetTypeClass[type] = $transparent
CCTypes.GetTypeRepresentation will return tti.
TransparentTypeInfo: TYPE ~ REF TransparentTypeInfoBody;
TransparentTypeInfoBody:
TYPE ~
RECORD [
createIndirectNode: PROC [tti: TransparentTypeInfo, cc: CC, indirectType, targetType: Type, mem: Mem] RETURNS [Node],
intro: ROPE,
bits: INT,
data: REF ANY];
Enumerated types
at some point, we have to collect the pure types into a single interface. For the moment, Enumerated types are here.
EnumeratedTypeProcs:
TYPE =
RECORD[
createIndirectNode: PROC [procsData: REF ANY, cc: CC, indirectType, targetType: Type, mem: Mem] RETURNS [Node],
getBitSize: PROC[procsData: REF ANY, cc: CC, indirectType, targetType: Type] RETURNS[CARD],
getPaint: PROC[procsData: REF ANY] RETURNS[REF ANY],
comparePaint: PROC[procsData: REF ANY, otherPaint: REF ANY] RETURNS[BOOLEAN],
idToIndex: PROC[id: ROPE, procsData: REF ANY] RETURNS[INT],
indexToId:
PROC[index:
INT, procsData:
REF
ANY]
RETURNS[
ROPE]];
index belongs to [0..nValues)
CreateEnumeratedType:
PROC[nValues:
INT, procs:
REF EnumeratedTypeProcs, procsData:
REF
ANY, cc:
CC]
RETURNS[Type];
exported from CedarOtherPureTypesImpl
Supports CCTypes.GetTypeRepresentation[type, cc], which returns procsData.
CirioCode.GetTypeClass[type] = $enumerated
CreateEnumeratedSubtype:
PROC[baseType: Type, bottomIndex, topIndex:
INT, cc:
CC]
RETURNS[Type];
exported from CedarOtherPureTypesImpl
Supports CCTypes.GetTypeRepresentation[type, cc], which returns CCTypes.GetTypeRepresentation[baseType, cc].
CirioCode.GetTypeClass[type] = $enumerated
CreateBooleanNode:
PROC[val:
BOOLEAN, cc:
CC]
RETURNS[Node];
exported from CedarOtherPureTypesImpl. CedarCode.GetNodeRepresentation returns a REF BOOLEAN, where the BOOLEAN is equal to val.
CreateCharNode:
PROC[val:
CHAR, cc:
CC]
RETURNS[Node];
exported from CedarOtherPureTypesImpl. CedarCode.GetNodeRepresentation returns a REF CHAR, where the CHAR is equal to val.
CreateUnknownTypeNode: PROC[type: Type, explanation: ROPE, cc: CC] RETURNS[Node];
CreateIndirectToAnUnknownType: PROC[type: Type, explanation: ROPE, cc: CC] RETURNS[Node];
CreateTransparentTypeNode:
PROC[type: Type, tni: TransparentNodeInfo, cc:
CC]
RETURNS[Node];
CedarCode.GetNodeRepresentation returns the TNI.
TransparentNodeInfo: TYPE ~ REF TransparentNodeInfoBody;
TransparentNodeInfoBody:
TYPE ~
RECORD [val:
ROPE, lpad, rpad:
INT];
We abuse the ROPE type here to hold a sequence of bytes.
lpad+rpad+type.bits = val.Length*8.
CreateEnumeratedTypeNode:
PROC[type: Type, id:
ROPE, cc:
CC]
RETURNS[Node];
exported from CedarOtherPureTypesImpl.
CedarCode.GetNodeRepresentation returns a REF CARD, where the CARD is equal to the index of the value.
CreateEnumeratedTypeNodeFromIndex:
PROC[type: Type, index:
CARD, cc:
CC]
RETURNS[Node];
exported from CedarOtherPureTypesImpl.
CedarCode.GetNodeRepresentation returns a REF CARD, where the CARD is equal to index.
CreateParseTreeNode:
PROC[parseTree: CirioSyntacticOperations.ParseTree, cc:
CC]
RETURNS[Node];
exported from CedarOtherPureTypesImpl
CreateRopeNode:
PROC[val:
ROPE, cc:
CC, addr:
REF
ANY ←
NIL]
RETURNS[Node];
exported from CedarOtherPureTypesImpl
CedarCode.GetNodeRepresentation returns the supplied val and address as a REF RopeInfo.
RopeInfo:
TYPE ~
RECORD [val:
ROPE, addr:
REF
ANY];
addr=NIL means doesn't exist (yet) in target world.