DIRECTORY CirioTypes USING[BasicTypeInfo, CompilerContext, Node, Type]; RefTypes: CEDAR DEFINITIONS = BEGIN CC: TYPE = CirioTypes.CompilerContext; Type: TYPE = CirioTypes.Type; Node: TYPE = CirioTypes.Node; BasicTypeInfo: TYPE = CirioTypes.BasicTypeInfo; CreateRefAnyType: PROC[cc: CC, bti: BasicTypeInfo] RETURNS[Type]; CreateRefType: PROC[cc: CC, bti: BasicTypeInfo] RETURNS[Type]; SetReferent: PROC [refType, clientTargetType: Type, codeForClientTargetType: INT, cc: CC]; CreateNilRefType: PROC[cc: CC] RETURNS[Type]; RefNodeInfo: TYPE = REF RefNodeInfoBody; RefNodeInfoBody: TYPE = RECORD[ clientTargetType: Type, codeForClientTargetType: INT, indirectToClientTarget: Node, data: REF ANY]; CreateRefNode: PROC[type: Type, info: RefNodeInfo, cc: CC] RETURNS[Node]; CreateNilRefNode: PROC[cc: CC] RETURNS[Node]; END.. ¨ RefTypes.mesa Sturgis, November 20, 1988 Sturgis, September 5, 1989 9:48:36 am PDT Last changed by Theimer on July 16, 1989 4:40:24 pm PDT Spreitze, December 16, 1991 10:52 am PST We do not include a CreateIndirectRefNode procedure, because a RefNode value is atomic, hence is covered by the general mechanism for indirects to atomic values. Note: The clientTargetType is INT in REF INT. (We use the phrase ClientTarget to distinguish this type from the type of the (virtual) pair . Note: The codeForClientTargetType is the type code that appears in the header for the records. It is not clear that this is the route by which Cirio should learn this number. Perhaps it should have been part of the clientTargetType already. Currently (March 4, 1989) it is used only in the CheckFamilyInclusion routine. Perhaps there is some better way to perform the same check. (We are only interested in whether then numbers agree, we don't care about their actual values.) There are three classes of REF type: REF ANY, REF T, and NIL REF. All ref values belong to REF ANY, NIL REF is a subset of all REF types, and the only value in NIL REF is NIL. Thus, NIL belongs to all REF types. In the following: CreateRefAnyType and CreateNilRefType always return the same type (respectively). If the type doesn't exist, it is created. CirioCode.GetTypeClass[type] = $refAny CCTypes.GetTypeRepresentation will return bti. CirioCode.GetTypeClass[type] = $ref CCTypes.GetTypeRepresentation will return bti. Call SetReferent to specify referent. CirioCode.GetTypeClass[type] = $nilRef CCTypes.GetTypeRepresentation will return NIL. Ref nodes support the getNodeRepresentation object procedure (CedarCode.GetNodeRepresentation). They return the info parameter supplied to the Create call. (Nodes for a NIL ref must be created using the following procedure.) If node _ CreateNilRefNode[cc], then GetNodeRepresentation[node, cc] returns NIL. Κ•NewlineDelimiter ™Icodešœ ™ šœ™Kšœ)™)K™7K™(—šΟk ˜ Kšœ œ-˜=—K˜šΟnœœ œ˜Kš˜Kšœœ˜&Kšœœ˜Kšœœ˜Kšœœ˜/K˜˜Kšœ‘™‘K™Kšœ‘™‘K™K™Kšœα™α—™KšœΥ™ΥK™KšœŽ™Ž—K™šžœœœœ˜AKšœ&™&Kšœ.™.—K˜šž œœœœ˜>Kšœ#™#Kšœ.™.Kšœ%™%—K™šž œœ<œœ˜ZK˜—šžœœœœ˜-Kšœ&™&Kšœ*œ™.—K˜Kšœ œœ˜(šœœœ˜K˜Kšœœ˜K˜Kšœœœ˜—K˜šž œœ$œœ˜IKšœβ™βK™—šžœœœœ˜-KšœQ™Q—K˜K˜Kšœ˜——…—>