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 positions of Row 00 (also known as Latin-1) of the ISO/IEC
10646:2003 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 positions of Row 00 (0000-001F and
007F-009F) 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 positions of the ISO/IEC 10646:2003 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 positions of the ISO/IEC 10646:2003
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 position 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 position 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.
Implementation Permissions
This paragraph was
deleted.
Implementation Advice
This paragraph was
deleted.
25 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.
26 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 clause
13.4.
Examples
Example of a character
type:
type Roman_Digit is ('I', 'V', 'X', 'L', 'C', 'D', 'M');