Ada Conformity Assessment Authority      Home Conformity Assessment   Test Suite ARGAda Standard
 
Ada Reference Manual (Ada 2022 with Amendment 1)Legal Information
Contents   Index   References   Search   Previous   Next 

3.5.2 Character Types

Static Semantics

1
An enumeration type is said to be a character type if at least one of its enumeration literals is a character_literal.
2/6
The predefined type Character is a character type having 256 values. Those values correspond to the 256 code points of Row 00 (also known as Latin-1) of the Basic Multilingual Plane (BMP) of The Unicode Standard, version 15.0.0. Each of the graphic characters of Row 00 of the BMP has a corresponding character_literal in Character. Each of the nongraphic characters of Row 00 has a corresponding language-defined name, which is not usable as an enumeration literal, but which is usable with the attributes Image, Wide_Image, Wide_Wide_Image, Value, Wide_Value, and Wide_Wide_Value; these names are given in the definition of type Character in A.1, “The Package Standard”, but are set in italics.
3/6
The predefined type Wide_Character is a character type having 2**16 values. Those values correspond to the 2**16 code points of the Basic Multilingual Plane (BMP) of The Unicode Standard, version 15.0.0. Each of the graphic characters of the BMP has a corresponding character_literal in Wide_Character. The first 256 values of Wide_Character have the same character_literal or language-defined name as defined for Character. Each of the graphic_characters has a corresponding character_literal.
4/6
The predefined type Wide_Wide_Character is a character type having 2**32 values. The values with position numbers in the range 0 .. 16#10FFFF# correspond to the 17 * 2**16 code points of the codespace of The Unicode Standard, version 15.0.0. Each of the graphic_characters has a corresponding character_literal in Wide_Wide_Character. The first 2**16 values of Wide_Wide_Character have the same character_literal or language-defined name as defined for Wide_Character.
5/3
The characters whose code point is larger than 16#FF# and which are not graphic_characters have language-defined names which are formed by appending to the string "Hex_" the representation of their code point in hexadecimal as eight extended digits. As with other language-defined names, these names are usable only with the attributes (Wide_)Wide_Image and (Wide_)Wide_Value; they are not usable as enumeration literals.
Original Paragraphs 4 and 5 were deleted. 
8
NOTE 1   The language-defined library package Characters.Latin_1 (see A.3.3) includes the declaration of constants denoting control characters, lower case characters, and special characters of the predefined type Character.
9/5
NOTE 2   A conventional character set such as EBCDIC can be declared as a character type; the internal codes of the characters can be specified by an enumeration_representation_clause as explained in 13.4

Examples

10
Example of a character type: 
11
type Roman_Digit is ('I', 'V', 'X', 'L', 'C', 'D', 'M');

Contents   Index   References   Search   Previous   Next 
Ada-Europe Ada 2005 and 2012 Editions sponsored in part by Ada-Europe