Debian Codegraph @

gcc/m2/gm2-libs-iso/LongConv.def

raw
1 (* Library module defined by the International Standard
2 Information technology - programming languages
3 BS ISO/IEC 10514-1:1996E Part 1: Modula-2, Base Language.
4
5 Copyright ISO/IEC (International Organization for Standardization
6 and International Electrotechnical Commission) 1996-2021.
7
8 It may be freely copied for the purpose of implementation (see page
9 707 of the Information technology - Programming languages Part 1:
10 Modula-2, Base Language. BS ISO/IEC 10514-1:1996). *)
11
12 DEFINITION MODULE LongConv;
13
14 (* Low-level LONGREAL/string conversions *)
15
16 IMPORT
17 ConvTypes;
18
19 TYPE
20 ConvResults = ConvTypes.ConvResults; (* strAllRight, strOutOfRange,
21 strWrongFormat, strEmpty *)
22
23 PROCEDURE ScanReal (inputCh: CHAR; VAR chClass: ConvTypes.ScanClass;
24 VAR nextState: ConvTypes.ScanState);
25 (* Represents the start state of a finite state scanner for real
26 numbers - assigns class of inputCh to chClass and a procedure
27 representing the next state to nextState.
28 *)
29
30 PROCEDURE FormatReal (str: ARRAY OF CHAR): ConvResults;
31 (* Returns the format of the string value for conversion to LONGREAL. *)
32
33 PROCEDURE ValueReal (str: ARRAY OF CHAR): LONGREAL;
34 (* Returns the value corresponding to the real number string value
35 str if str is well-formed; otherwise raises the LongConv exception.
36 *)
37
38 PROCEDURE LengthFloatReal (real: LONGREAL; sigFigs: CARDINAL): CARDINAL;
39 (* Returns the number of characters in the floating-point string
40 representation of real with sigFigs significant figures.
41 *)
42
43 PROCEDURE LengthEngReal (real: LONGREAL; sigFigs: CARDINAL): CARDINAL;
44 (* Returns the number of characters in the floating-point engineering
45 string representation of real with sigFigs significant figures.
46 *)
47
48 PROCEDURE LengthFixedReal (real: LONGREAL; place: INTEGER): CARDINAL;
49 (* Returns the number of characters in the fixed-point string
50 representation of real rounded to the given place relative to the
51 decimal point.
52 *)
53
54 PROCEDURE IsRConvException (): BOOLEAN;
55 (* Returns TRUE if the current coroutine is in the exceptional
56 execution state because of the raising of an exception in a
57 routine from this module; otherwise returns FALSE.
58 *)
59
60 END LongConv.
61