|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - download
Length: 18432 (0x4800) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, package Character_Utilities, seg_042797
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─ ⟦5a81ac88f⟧ »Space Info Vol 1« └─⟦this⟧
-- <!DOCTYPE ADA> -- <ADA> -------------------------------------------------------------------------------- -- <PROLOGUE> -- <UNIT> Character_Utilities -- -- <DESCRIPTION> This package defines subtypes and operations for working with -- ASCII characters. -- -- <HISTORY> -- -- <ORIGIN> -- <AUTHOR> David Blanchard and Peter A. Berggren -- <DATE> 12 July 1989 -- -- <COMPANY> Science Applications International Corporation -- <ADDRESS> 311 Park Place Boulevard, Suite 360 -- <ADDRESS> Clearwater, Florida 34619 -- -- <REMARK> The specification of this package was derived from "Software -- Components with Ada", by Grady Booch. -- Developed for the STARS program under task IR20. -- </ORIGIN> -- -- </HISTORY> -- -- <NOTES> Dependencies => -- ( Operating_System => None , -- Compiler => None , -- Device => None ) ; -- -- <copyright notice> -- This component was derived from specifications described in the book, -- "Software Components with Ada", by Grady Booch. -- -- -- </PROLOGUE> -------------------------------------------------------------------------------- package Character_Utilities is subtype Control_Character is Character range Ascii.Nul .. Ascii.Us; subtype Graphic_Character is Character range ' ' .. '~'; subtype Uppercase_Character is Character range 'A' .. 'Z'; subtype Lowercase_Character is Character range 'a' .. 'z'; subtype Digit_Character is Character range '0' .. '9'; -- -- These subtypes define the conventional ranges of ASCII character values, as -- follows: -- -- Control_Character => The first 32 characters in the ASCII set. These -- characters generally invoke some kind -- of control operation, rather than producing a graphic -- image. -- Graphic_Character => The 95 characters of the ASCII set that always produce -- a graphic image. -- Uppercase_Character => The uppercase alphabetic characters. -- Lowercase_Character => The lowercase alphabetic characters. -- Digit_Character => The decimal digits. -- -- Note: The subtypes Control_Character and Graphic_Character do not -- cover the complete range of ASCII characters. The last character in the set, -- (ASCII.DEL) is a control character, but cannot be included in -- the subtype Control_Character because it is not contiguous with the other -- control characters. -- subtype Digit is Integer range 0 .. 9; subtype Letter is Integer range 1 .. 26; -- -- The subtypes Digit and Letter provide Integer mappings for decimal digit and -- alphabetic characters, respectively. -- procedure Make_Uppercase (The_Character : in out Character); -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Make_Uppercase -- -- <DESCRIPTION> This procedure maps from the lowercase characters to the -- uppercase characters. -- If the character given by The_Character is -- lowercase, it is changed to the equivalent uppercase character. -- Otherwise, no action is taken. -- -- <EXCEPTIONS> None -- -- </SUBPROGRAM> -------------------------------------------------------------------------------- procedure Make_Lowercase (The_Character : in out Character); -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Make_Lowercase -- -- <DESCRIPTION> This procedure maps from the uppercase characters to the -- lowercase characters. -- If the character given by The_Character is -- uppercase, it is changed to the equivalent lowercase character. -- Otherwise, no action is taken. -- -- <EXCEPTIONS> None -- -- </SUBPROGRAM> -------------------------------------------------------------------------------- function Uppercase_Of (The_Character : in Character) return Character; -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Uppercase_Of -- -- <DESCRIPTION> This function returns the uppercase equivalent of the character -- given by The_Character or, if the given -- character is not alphabetic, returns the character itself. -- -- <EXCEPTIONS> None -- -- </SUBPROGRAM> -------------------------------------------------------------------------------- function Lowercase_Of (The_Character : in Character) return Character; -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Lowercase_Of -- -- <DESCRIPTION> This function returns the lowercase equivalent of the character -- given by The_Character or, if the given -- character is not alphabetic, returns the character itself. -- -- <EXCEPTIONS> None -- -- </SUBPROGRAM> -------------------------------------------------------------------------------- function Is_Control (The_Character : in Character) return Boolean; -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Is_Control -- -- <DESCRIPTION> This function returns True if the character given by -- The_Character is a control character. -- -- <EXCEPTIONS> None -- -- </SUBPROGRAM> -------------------------------------------------------------------------------- function Is_Graphic (The_Character : in Character) return Boolean; -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Is_Graphic -- -- <DESCRIPTION> This function returns True if the character given by -- The_Character is a graphic character. -- -- <EXCEPTIONS> None -- -- </SUBPROGRAM> -------------------------------------------------------------------------------- function Is_Uppercase (The_Character : in Character) return Boolean; -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Is_Uppercase -- -- <DESCRIPTION> This function returns True if the character given by -- The_Character is uppercase. -- -- <EXCEPTIONS> None -- -- </SUBPROGRAM> -------------------------------------------------------------------------------- function Is_Lowercase (The_Character : in Character) return Boolean; -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Is_Lowercase -- -- <DESCRIPTION> This function returns True if the character given by -- The_Character is lowercase. -- -- <EXCEPTIONS> None -- -- </SUBPROGRAM> -------------------------------------------------------------------------------- function Is_Digit (The_Character : in Character) return Boolean; -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Is_Digit -- -- <DESCRIPTION> This function returns True if the character given by -- The_Character is a decimal digit. -- -- <EXCEPTIONS> None -- -- </SUBPROGRAM> -------------------------------------------------------------------------------- function Is_Alphabetic (The_Character : in Character) return Boolean; -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Is_Alphabetic -- -- <DESCRIPTION> This function returns True if the character given by -- The_Character is alphabetic. -- The set of alphabetic characters is defined as the union of the -- uppercase and lowercase sets. -- -- <EXCEPTIONS> None -- -- </SUBPROGRAM> -------------------------------------------------------------------------------- function Is_Alphanumeric (The_Character : in Character) return Boolean; -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Is_Alphanumeric -- -- <DESCRIPTION> This function returns True if the character given by -- The_Character is alphanumeric. -- The set of alphanumeric characters is defined as the union of -- the alphabetic and decimal digit sets. -- -- <EXCEPTIONS> None -- -- </SUBPROGRAM> -------------------------------------------------------------------------------- function Is_Special (The_Character : in Character) return Boolean; -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Is_Special -- -- <DESCRIPTION> This function returns True if the character given by -- The_Character is special. -- The set of special characters includes the graphic characters, -- less the alphanumeric characters. -- -- <EXCEPTIONS> None -- -- </SUBPROGRAM> -------------------------------------------------------------------------------- function Value_Of (The_Character : in Character) return Digit; -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Value_Of -- -- <DESCRIPTION> This function returns the integer value of the decimal digit -- given by The_Character. -- -- <EXCEPTIONS> Lexical_Error => -- The character given by The_Character is not a decimal digit. -- -- </SUBPROGRAM> -------------------------------------------------------------------------------- function Image_Of (The_Digit : in Digit) return Character; -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Image_Of -- -- <DESCRIPTION> This function returns the decimal digit corresponding to the -- integer value given by The_Digit. -- -- <EXCEPTIONS> None -- -- </SUBPROGRAM> -------------------------------------------------------------------------------- function Index_Of (The_Character : in Character) return Letter; -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Index_Of -- -- <DESCRIPTION> This function returns the position in the alphabet of the -- character given by The_Character. -- For example, 'C' and 'c' produce the value 3. -- -- <EXCEPTIONS> Lexical_Error => -- The character given by The_Character is not alphabetic. -- -- </SUBPROGRAM> -------------------------------------------------------------------------------- function Uppercase_Of (The_Letter : in Letter) return Character; -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Uppercase_Of -- -- <DESCRIPTION> This function returns the uppercase character whose position in -- the alphabet is given by The_Letter. -- -- <EXCEPTIONS> None -- -- </SUBPROGRAM> -------------------------------------------------------------------------------- function Lowercase_Of (The_Letter : in Letter) return Character; -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Lowercase_Of -- -- <DESCRIPTION> This function returns the lowercase character whose position in -- the alphabet is given by The_Letter. -- -- <EXCEPTIONS> None -- -- </SUBPROGRAM> -------------------------------------------------------------------------------- function Is_Equal (Left : in Character; Right : in Character; Case_Sensitive : in Boolean := True) return Boolean; -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Is_Equal -- -- <DESCRIPTION> This function returns True if the characters given by Left and -- Right are equal. -- The parameter Case_Sensitive determines the handling of -- character case, as follows: -- True => The uppercase and lowercase character sets are treated -- as distinct sets. -- False => The lowercase character set is mapped onto the -- uppercase character set. -- -- <EXCEPTIONS> None -- -- </SUBPROGRAM> -------------------------------------------------------------------------------- function Is_Less_Than (Left : in Character; Right : in Character; Case_Sensitive : in Boolean := True) return Boolean; -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Is_Less_Than -- -- <DESCRIPTION> This function returns True if the character given by Left is -- less than the character given by Right. -- The parameter Case_Sensitive determines the handling of -- character case, as follows: -- True => The uppercase and lowercase character sets are treated -- as distinct sets. -- False => The lowercase character set is mapped onto the -- uppercase character set. -- -- <EXCEPTIONS> None -- -- </SUBPROGRAM> -------------------------------------------------------------------------------- function Is_Greater_Than (Left : in Character; Right : in Character; Case_Sensitive : in Boolean := True) return Boolean; -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Is_Greater_Than -- -- <DESCRIPTION> This function returns True if the character given by Left is -- greater than the character given by Right. -- The parameter Case_Sensitive determines the handling of -- character case, as follows: -- True => The uppercase and lowercase character sets are treated -- as distinct sets. -- False => The lowercase character set is mapped onto the -- uppercase character set. -- -- <EXCEPTIONS> None -- -- </SUBPROGRAM> -------------------------------------------------------------------------------- Lexical_Error : exception; -- -- The exception Lexical_Error is raised by functions Value_Of -- and Index_Of, if the given character is not a decimal digit or an alphabetic -- character, respectively. -- end Character_Utilities; -- </ADA> -- <!DOCTYPE ADA> -- <ADA> -------------------------------------------------------------------------------- -- <PROLOGUE> -- <UNIT> Character_Utilities -- -- <DESCRIPTION> This package defines subtypes and operations for working with -- ASCII characters. -- -- <HISTORY> -- -- <ORIGIN> -- <AUTHOR> David Blanchard and Peter A. Berggren -- <DATE> 12 July 1989 -- -- <COMPANY> Science Applications International Corporation -- <ADDRESS> 311 Park Place Boulevard, Suite 360 -- <ADDRESS> Clearwater, Florida 34619 -- -- <REMARK> The specification of this package was derived from "Software -- Components with Ada", by Grady Booch. -- Developed for the STARS program under task IR20. -- </ORIGIN> -- -- </HISTORY> -- -- <NOTES> Dependencies => -- ( Operating_System => None , -- Compiler => None , -- Device => None ) ; -- -- <copyright notice> -- This component was derived from specifications described in the book, -- "Software Components with Ada", by Grady Booch. -- -- -- </PROLOGUE> --------------------------------------------------------------------------------
nblk1=11 nid=0 hdr6=22 [0x00] rec0=20 rec1=00 rec2=01 rec3=044 [0x01] rec0=18 rec1=00 rec2=02 rec3=030 [0x02] rec0=16 rec1=00 rec2=03 rec3=084 [0x03] rec0=18 rec1=00 rec2=04 rec3=02e [0x04] rec0=1a rec1=00 rec2=05 rec3=07c [0x05] rec0=1b rec1=00 rec2=06 rec3=044 [0x06] rec0=1b rec1=00 rec2=07 rec3=036 [0x07] rec0=1b rec1=00 rec2=08 rec3=06c [0x08] rec0=1a rec1=00 rec2=09 rec3=00e [0x09] rec0=1a rec1=00 rec2=0a rec3=04e [0x0a] rec0=1a rec1=00 rec2=0b rec3=058 [0x0b] rec0=1c rec1=00 rec2=0c rec3=002 [0x0c] rec0=16 rec1=00 rec2=0d rec3=036 [0x0d] rec0=17 rec1=00 rec2=0e rec3=008 [0x0e] rec0=16 rec1=00 rec2=0f rec3=05a [0x0f] rec0=23 rec1=00 rec2=10 rec3=028 [0x10] rec0=0c rec1=00 rec2=11 rec3=000 tail 0x2153db264862f6c32912a 0x42a00088462060003