As in C++, identifiers are used to name functions, variables, etc.
identifier ::= letter [ letter-or-digit ] ... |
ident(letter [ letter-or-digit ] ...
9letter-or-digit ::= letter | digit
The usual form of an identifier
is an arbitrary long sequence of letters and digits.
The first character of an identifier must be a letter;
the underscore (
_) is treated as a letter.
(The alphabetic letters only include ASCII codes,
no codes for accented characters are included.)
Identifiers are case sensitive;
three distinct identifiers.
Some names that would otherwise be identifiers are reserved
(see section 4.8 Keywords for a list of Larch/C++ keywords).
In a few rare cases, one needs to use a Larch/C++ keyword as the name
of something to be specified.
This is the reason for the other form of identifier.
ident(reach) means the identifier
not the Larch/C++ keyword
(Note that no whitespace is allowed between the parts of such
This syntax allows one to use the C++ macro defined in the following,
so that C++ will not gag on this form of identifier.
// @(#)$Id: ident_macro.lh,v 1.2 1997/05/25 00:19:37 leavens Exp $ #ifndef __ident_macro_lh__ #ifndef ident_macro_lh #define ident_macro_lh #define ident(x) x #endif #endif
Identifiers may live in several different worlds in Larch/C++.
There are 3 different such worlds: trait names,
names of specified C++ entities,
and all other names.
The last world includes
trait function names (including prefix, infix, and postfix
trait functions) and sort names that are not type names.
The same identifier may thus be used in these worlds with
For example, in Larch/C++,
int is both the name of a trait
and the name of a C++ type.
Go to the first, previous, next, last section, table of contents.