Contents Index Search Previous Next
a value literally, that is, by means of notation suited to its kind.
A literal is either a numeric_literal
, the literal
, or a string_literal
Name Resolution Rules
The expected type for a literal
shall be a single access type.
that consists of a character_literal
either its expected type shall be a single character type, in which case
it is interpreted as a parameterless function_call
that yields the corresponding value of the character type, or its expected
profile shall correspond to a parameterless function with a character
result type, in which case it is interpreted as the name of the corresponding
parameterless function declared as part of the character type's definition
). In either case, the character_literal
denotes the enumeration_literal_specification
The expected type for a primary
that is a string_literal
a single string type.
that is a name shall correspond
to a defining_character_literal
of the expected type, or of the result type of the expected profile.
For each character of a string_literal
with a given expected string type, there shall be a corresponding defining_character_literal
of the component type of the expected string type.
A literal null
shall not be of an anonymous access type, since such types do not have
a null value (see 3.10
An integer literal is of type universal_integer.
A real literal is of type universal_real.
evaluation of a numeric literal, or the literal null
, yields the
The evaluation of a string_literal
that is a primary
yields an array
value containing the value of each character of the sequence of characters
of the string_literal
, as defined
. The bounds of this array value are
determined according to the rules for positional_array_aggregate
), except that for a null string
literal, the upper bound is the predecessor of the lower bound.
evaluation of a string_literal
, a check is made that the value of each character of the
belongs to the component
subtype of T
. For the evaluation of a null string literal, a check
is made that its lower bound is greater than the lower bound of the base
range of the index type.
The exception Constraint_Error
is raised if either of these checks fails.
6 Enumeration literals
that are identifiers rather than
character_literals follow the normal
rules for identifiers when used
in a name (see 4.1
and 4.1.3). Character_literals
used as selector_names follow the
normal rules for expanded names (see 4.1.3).
3.14159_26536 -- a real literal
1_345 -- an integer literal
'A' -- a character literal
"Some Text" -- a string literal
Contents Index Search Previous Next Legal