MODULE; IMPORT ObLib, ObValue, Obliq, SynLocation; PROCEDURE ObReal M3ToObliq (val : REAL) : ObValue.Val = BEGIN RETURN NEW (ObValue.ValReal, real := FLOAT (val, LONGREAL)); END M3ToObliq; PROCEDUREObliqToM3 (val : ObValue.Val) : REAL RAISES {ObValue.Error} = BEGIN TYPECASE val OF | ObValue.ValReal (node) => RETURN FLOAT (node.real); | ObValue.ValInt (node) => RETURN FLOAT (node.int); ELSE Obliq.RaiseError ("Expected Real or Int"); RETURN 0.0; (* ... only to suppress compiler warning *) END; END ObliqToM3; PROCEDUREGetArg (args : ObValue.ArgArray; idx : INTEGER; package : ObLib.T; opCode : ObLib.OpCode; loc : SynLocation.T) : REAL RAISES {ObValue.Error} = BEGIN TYPECASE args[idx] OF | ObValue.ValReal (node) => RETURN FLOAT (node.real); | ObValue.ValInt (node) => RETURN FLOAT (node.int); ELSE ObValue.BadArgType (idx, "real", package.name, opCode.name, loc); RETURN 0.0; (* ... only to suppress compiler warning *) END; END GetArg; BEGIN END ObReal.