home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / modu1096.zip / ISOsym / wholeconv.def < prev    next >
Text File  |  1996-08-29  |  2KB  |  68 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;
  10.         (* strAllRight, strOutOfRange, strWrongFormat, strEmpty *)
  11.  
  12. PROCEDURE ScanInt (inputCh: CHAR; VAR chClass: ConvTypes.ScanClass;
  13.                    VAR nextState: ConvTypes.ScanState);
  14. (*
  15.  * Represents the start state of a finite state scanner for signed whole numbers -
  16.  * assigns class of inputCh to chClass and a procedure representing the next state
  17.  * to nextState.
  18.  *)
  19.  
  20. PROCEDURE FormatInt (str: ARRAY OF CHAR): ConvResults;
  21. (*
  22.  * Returns the format of the string value for conversion to INTEGER.
  23.  *)
  24.  
  25. PROCEDURE ValueInt (str: ARRAY OF CHAR): INTEGER;
  26. (*
  27.  * Returns the value corresponding to the signed whole number string value str if
  28.  * str is well-formed; otherwise raises the WholeConv exception.
  29.  *)
  30.  
  31. PROCEDURE LengthInt (int: INTEGER): CARDINAL;
  32. (*
  33.  * Returns the number of characters in the string representation of int.
  34.  *)
  35.  
  36. PROCEDURE ScanCard (inputCh: CHAR; VAR chClass: ConvTypes.ScanClass;
  37.                     VAR nextState: ConvTypes.ScanState);
  38. (*
  39.  * Represents the start state of a finite state scanner for unsigned whole numbers -
  40.  * assigns class of inputCh to chClass and a procedure representing the next state
  41.  * to nextState.
  42.  *)
  43.  
  44. PROCEDURE FormatCard (str: ARRAY OF CHAR): ConvResults;
  45. (*
  46.  * Returns the format of the string value for conversion to CARDINAL.
  47.  *)
  48.  
  49. PROCEDURE ValueCard (str: ARRAY OF CHAR): CARDINAL;
  50. (*
  51.  * Returns the value corresponding to the unsigned whole number string value str if
  52.  * str is well-formed; otherwise raises the WholeConv exception.
  53.  *)
  54.  
  55. PROCEDURE LengthCard (card: CARDINAL): CARDINAL;
  56. (*
  57.  * Returns the number of characters in the string representation of card.
  58.  *)
  59.  
  60. PROCEDURE IsWholeConvException (): BOOLEAN;
  61. (*
  62.  * Returns TRUE if the current coroutine is in the exceptional execution state
  63.  * because of the raising of an exception in a routine from this module;
  64.  * otherwise returns FALSE.
  65.  *)
  66.  
  67. END WholeConv.
  68.