home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / xc212os2.zip / ISODEF / wholecon.def < prev    next >
Text File  |  1994-12-22  |  2KB  |  55 lines

  1. DEFINITION MODULE WholeConv;
  2.  
  3.   (* Low-level whole-number/string conversions *)
  4.  
  5. IMPORT
  6.   ConvTypes;
  7.  
  8. TYPE
  9.   ConvResults = ConvTypes.ConvResults; (* strAllRight, strOutOfRange, strWrongFormat, strEmpty *)
  10.  
  11. PROCEDURE ScanInt (inputCh: CHAR; VAR chClass: ConvTypes.ScanClass;
  12.                    VAR nextState: ConvTypes.ScanState);
  13.   (* Represents the start state of a finite state scanner for signed whole numbers -
  14.      assigns class of inputCh to chClass and a procedure representing the next state to
  15.      nextState.
  16.   *)
  17.  
  18. PROCEDURE FormatInt (str: ARRAY OF CHAR): ConvResults;
  19.   (* Returns the format of the string value for conversion to INTEGER. *)
  20.  
  21. PROCEDURE ValueInt (str: ARRAY OF CHAR): INTEGER;
  22.   (* Returns the value corresponding to the signed whole number string value str if str
  23.      is well-formed; otherwise raises the WholeConv exception.
  24.   *)
  25.  
  26. PROCEDURE LengthInt (int: INTEGER): CARDINAL;
  27.   (* Returns the number of characters in the string representation of int. *)
  28.  
  29. PROCEDURE ScanCard (inputCh: CHAR; VAR chClass: ConvTypes.ScanClass;
  30.                     VAR nextState: ConvTypes.ScanState);
  31.   (* Represents the start state of a finite state scanner for unsigned whole numbers -
  32.      assigns class of inputCh to chClass and a procedure representing the next state to
  33.      nextState.
  34.   *)
  35.  
  36. PROCEDURE FormatCard (str: ARRAY OF CHAR): ConvResults;
  37.   (* Returns the format of the string value for conversion to CARDINAL. *)
  38.  
  39. PROCEDURE ValueCard (str: ARRAY OF CHAR): CARDINAL;
  40.   (* Returns the value corresponding to the unsigned whole number string value str if
  41.      str is well-formed; otherwise raises the WholeConv exception.
  42.    *)
  43.  
  44. PROCEDURE LengthCard (card: CARDINAL): CARDINAL;
  45.   (* Returns the number of characters in the string representation of card. *)
  46.  
  47. PROCEDURE IsWholeConvException (): BOOLEAN;
  48.   (* Returns TRUE if the current coroutine is in the exceptional execution state because
  49.      of the raising of an exception in a routine from this module; otherwise returns
  50.      FALSE.
  51.   *)
  52.  
  53. END WholeConv.
  54.  
  55.