HP C/iX Reference Manual (31506-90011)
12 Chapter2
Lexical Elements
Identifiers
Identifiers
An identifier is a sequence of characters that represents an entity such as a function or a
data object.
Syntax
identifier
:=
nondigit
identifier nondigit
identifier digit
nondigit
:= any character from the set:
_abcdefghijklmnop
qrstuvwxyzABCDEFG
HIJKLMNOPQRSTUVWX
YZ
digit
:= any character from the set:
0123456789
dollar-sign
:= the $ character
Description
Identifiers must start with a nonnumeric character followed by a sequence of digits or
nonnumeric characters. Internal and external names may have up to 255 significant
characters.
Identifiers are case sensitive. The compiler considers uppercase and lowercase characters
to be different. For example, the identifier CAT is different from the identifier cat. This is
true for external as well as internal names.
An HP extension to the language non-ANSI mode allows $ as a valid character in an
identifier as long as it is not the first character. The following are examples of legal and
illegal identifiers:
Legal
Sub_Total
X
aBc
Else
do_123
Illegal
3xyz
First character is a digit
const
Conflict with a reserved word
#note
First character not alphabetic or _
Num'2
Contains an illegal character
All identifiers that begin with the underscore () character are reserved for system use. If
you define identifiers that begin with an underscore, the compiler may interpret them as
internal system names. The resulting behavior is undefined.