CedarNumericTypes.mesa
Copyright Ó 1991 by Xerox Corporation. All rights reserved.
Sturgis, January 27, 1989 4:00:02 pm PST
Last changed by Theimer on July 16, 1989 4:09:31 pm PDT
Spreitze, May 24, 1991 3:23 pm PDT
DIRECTORY
CCTypes USING[NumericDescriptor],
CirioTypes USING[BasicTypeInfo, CompilerContext, Node, Type],
Rope USING[ROPE];
CedarNumericTypes: CEDAR DEFINITIONS =
BEGIN
CC: TYPE = CirioTypes.CompilerContext;
At the moment, the numeric stuff is Cedar specific (not Mimosa)
NumericDescriptor: TYPE = CCTypes.NumericDescriptor;
CreateNumericType: PROC[desc: NumericDescriptor, cc: CC, bti: CirioTypes.BasicTypeInfo] RETURNS[CirioTypes.Type];
CirioCode.GetTypeClass[type] = $numeric
CCTypes.GetTypeRepresentation will return NIL.
GetDescriptorFromCedarNumericType: PROC[type: CirioTypes.Type, cc: CC] RETURNS[REF NumericDescriptor];
NDFormat: PROC [NumericDescriptor] RETURNS [Rope.ROPE];
NDEqual: PROC [NumericDescriptor, NumericDescriptor] RETURNS [BOOL];
NDHash: PROC [NumericDescriptor] RETURNS [CARDINAL];
CreateNumericNode: PROC[type: CirioTypes.Type, rep: REF ANY] RETURNS[CirioTypes.Node];
rep must have certain properties. If type is real, then rep must be REF REAL or REF DREAL. If type is full-signed or subRange-signed, then rep must be REF INT or REF DINT. If type is full-unsigned or subRange-unsigned then rep must be REF CARD or REF DCARD. In any case, the client must have placed the intended value of the node in the target of the REF. Finally, CedarCode.GetNodeRepresentation will return rep.
END..