3.5.2 Character Types
Static Semantics
An enumeration type is said to
be a
character type if at least one of its enumeration literals
is a
character_literal.
The
predefined type Character is a character type whose values correspond
to the 256 code points of Row 00 (also known as Latin-1) of the ISO/IEC
10646:2020 Basic Multilingual Plane (BMP). 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.
The
predefined type Wide_Character is a character type whose values correspond
to the 65536 code points of the ISO/IEC 10646:2020 Basic Multilingual
Plane (BMP). 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.
The predefined
type Wide_Wide_Character is a character type whose values correspond
to the 2147483648 code points of the ISO/IEC 10646:2020 character set.
Each of the
graphic_characters has a corresponding
character_literal
in Wide_Wide_Character. The first 65536 values of Wide_Wide_Character
have the same
character_literal
or language-defined name as defined for Wide_Character.
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.
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.
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
Example of a character
type:
type Roman_Digit is ('I', 'V', 'X', 'L', 'C', 'D', 'M');
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe