Contents Index Search Previous Next
2.3 Identifiers
1
Identifiers
are used as names.
Syntax
2
identifier
::=
identifier_letter {[
underline]
letter_or_digit}
3
letter_or_digit
::= identifier_letter |
digit
4
An identifier
shall not be a reserved word.
Static Semantics
5
All characters of an
identifier
are significant, including any underline character.
{case
insensitive} Identifiers
differing only in the use of corresponding upper and lower case letters
are considered the same.
5.a
Discussion: Two of the
letters of ISO 8859-1 appear only as lower case, "sharp s"
and "y with diaeresis." These two letters have no corresponding
upper case letter (in particular, they are not considered equivalent
to one another).
Implementation Permissions
6
In a nonstandard mode, an implementation may support
other upper/lower case equivalence rules for identifiers[,
to accommodate local conventions].
Examples
7
Examples of identifiers:
8
Count X Get_Symbol Ethelyn Marion
Snobol_4 X1 Page_Count Store_Next_Item
Wording Changes from Ada 83
8.a
We no longer include reserved
words as identifiers. This is not
a language change. In Ada 83, identifier
included reserved words. However, this complicated several other rules
(for example, regarding implementation-defined attributes and pragmas,
etc.). We now explicitly allow certain reserved words for attribute designators,
to make up for the loss.
8.b
Ramification: Because
syntax rules are relevant to overload resolution, it means that if it
looks like a reserved word, it is not an identifier.
As a side effect, implementations cannot use reserved words as implementation-defined
attributes or pragma names.
Contents Index Search Previous Next Legal