DIRECTORY CirioTypes USING[BasicTypeInfo, CompilerContext, Mem, Node, Type], CirioSyntacticOperations USING[ParseTree], Rope USING[ROPE]; CedarOtherPureTypes: CEDAR DEFINITIONS = BEGIN ROPE: TYPE ~ Rope.ROPE; CC: TYPE = CirioTypes.CompilerContext; Type: TYPE = CirioTypes.Type; Mem: TYPE = CirioTypes.Mem; Node: TYPE = CirioTypes.Node; BasicTypeInfo: TYPE = CirioTypes.BasicTypeInfo; CreateBooleanType: PROC[cc: CC, bti: BasicTypeInfo] RETURNS[Type]; CreateCharType: PROC[cc: CC, bti: BasicTypeInfo] RETURNS[Type]; CreateUnknownType: PROC[cc: CC, explanation: ROPE _ NIL] RETURNS[Type]; CreateTransparentType: PROC[cc: CC, tti: TransparentTypeInfo] RETURNS[Type]; 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]; 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]]; CreateEnumeratedType: PROC[nValues: INT, procs: REF EnumeratedTypeProcs, procsData: REF ANY, cc: CC] RETURNS[Type]; CreateEnumeratedSubtype: PROC[baseType: Type, bottomIndex, topIndex: INT, cc: CC] RETURNS[Type]; CreateRopeType: PROC[cc: CC, bti: BasicTypeInfo] RETURNS[Type]; CreateBooleanNode: PROC[val: BOOLEAN, cc: CC] RETURNS[Node]; CreateCharNode: PROC[val: CHAR, cc: CC] RETURNS[Node]; 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]; TransparentNodeInfo: TYPE ~ REF TransparentNodeInfoBody; TransparentNodeInfoBody: TYPE ~ RECORD [val: ROPE, lpad, rpad: INT]; CreateEnumeratedTypeNode: PROC[type: Type, id: ROPE, cc: CC] RETURNS[Node]; CreateEnumeratedTypeNodeFromIndex: PROC[type: Type, index: CARD, cc: CC] RETURNS[Node]; CreateParseTreeNode: PROC[parseTree: CirioSyntacticOperations.ParseTree, cc: CC] RETURNS[Node]; CreateRopeNode: PROC[val: ROPE, cc: CC, addr: REF ANY _ NIL] RETURNS[Node]; RopeInfo: TYPE ~ RECORD [val: ROPE, addr: REF ANY]; END.. h CedarOtherPureTypes.mesa Copyright Σ 1990 by Xerox Corporation. All rights reserved. Sturgis, July 14, 1989 1:11:38 pm PDT Last changed by Theimer on July 16, 1989 4:12:29 pm PDT Last tweaked by Mike Spreitzer on May 15, 1991 7:07 am PDT Each of the following types has only a single instance. These create routines will return that instance if it has already been created. implemented in CedarOtherPureTypesImpl CirioCode.GetTypeClass[type] = $Boolean CCTypes.GetTypeRepresentation will return bti. implemented in CedarOtherPureTypesImpl CirioCode.GetTypeClass[type] = $char CCTypes.GetTypeRepresentation will return bti. There are more than one instance of the following types Internal error types CirioCode.GetTypeClass[type] = $unknown CCTypes.GetTypeRepresentation will return the ROPE. CirioCode.GetTypeClass[type] = $transparent CCTypes.GetTypeRepresentation will return tti. Enumerated types at some point, we have to collect the pure types into a single interface. For the moment, Enumerated types are here. index belongs to [0..nValues) exported from CedarOtherPureTypesImpl Supports CCTypes.GetTypeRepresentation[type, cc], which returns procsData. CirioCode.GetTypeClass[type] = $enumerated exported from CedarOtherPureTypesImpl Supports CCTypes.GetTypeRepresentation[type, cc], which returns CCTypes.GetTypeRepresentation[baseType, cc]. CirioCode.GetTypeClass[type] = $enumerated We include Rope types here, because they behave somewhat like pure types. On the other hand, we might also consider them to be a special case of Refs, or even not treat them as specific Cirio types at all, but rather by some sort of trap mechanism that would include other types implemented out of ordinary types. Like Boolean types etc, tehre is a single instance of this type. This create routine will return that instance if it has already been created. implemented in CedarOtherPureTypesImpl CirioCode.GetTypeClass[type] = $rope CCTypes.GetTypeRepresentation will return NIL. We have the following node creation routines exported from CedarOtherPureTypesImpl. CedarCode.GetNodeRepresentation returns a REF BOOLEAN, where the BOOLEAN is equal to val. exported from CedarOtherPureTypesImpl. CedarCode.GetNodeRepresentation returns a REF CHAR, where the CHAR is equal to val. CedarCode.GetNodeRepresentation returns the TNI. We abuse the ROPE type here to hold a sequence of bytes. lpad+rpad+type.bits = val.Length*8. exported from CedarOtherPureTypesImpl. CedarCode.GetNodeRepresentation returns a REF CARD, where the CARD is equal to the index of the value. exported from CedarOtherPureTypesImpl. CedarCode.GetNodeRepresentation returns a REF CARD, where the CARD is equal to index. exported from CedarOtherPureTypesImpl exported from CedarOtherPureTypesImpl CedarCode.GetNodeRepresentation returns the supplied val and address as a REF RopeInfo. addr=NIL means doesn't exist (yet) in target world. Κv•NewlineDelimiter ™codešœ™K™