CNumericTypes.mesa
Copyright Ó 1991 by Xerox Corporation. All rights reserved.
Hopcroft, July 25, 1989 10:56:52 am PDT
Spreitze, August 13, 1991 7:45 pm PDT
DIRECTORY
CirioTypes USING[BasicTypeInfo, CompilerContext, Node, Type],
RefTab USING [Ref];
CNumericTypes: CEDAR DEFINITIONS =
BEGIN
CC: TYPE = CirioTypes.CompilerContext;
BasicTypeInfo: TYPE = CirioTypes.BasicTypeInfo;
At the moment, the numeric stuff is Cedar specific (not Mimosa)
NumericDescriptor: TYPE = REF NumericDescriptorBody;
NumericDescriptorBody: TYPE = RECORD[
primary: PrimaryTag,
secondary: SecondaryTag ← null,
enumerationConstants: RefTab.Ref];
PrimaryTag: TYPE = {signed, unsigned, float, double, longDouble};
SecondaryTag: TYPE = {character, shortInteger, integer, enumeration, longInteger, null};
CreateNumericType: PROC[desc: NumericDescriptor, cc: CC, bti: BasicTypeInfo] RETURNS[CirioTypes.Type];
CirioCode.GetTypeClass[type] = $numeric
GetDescriptorFromCNumericType: PUBLIC PROC[type: CirioTypes.Type, cc: CC] RETURNS[NumericDescriptor];
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. If type is full-signed or subRange-signed, then rep must be REF INT. If type is full-unsigned or subRange-unsigned then rep must be REF CARD. In any case, the intended value of the node will be stored in the target of the REF ANY. Further, CedarCode.GetNodeRepresentation will return rep.
END..