4. Token identification
The syntax for the token-identification is as follows:
token identification: name-space?identifier # external-identifier? name-space: TAG
There is a default name space associated with each kind of token and internal identifiers for tokens generally reside in these default name spaces. The ISO C standard describes the five name spaces as being:
- The label space
-
in which all label identifiers reside;
- The tag space
-
in which structure, union and enumeration tags reside;
- The member name space
-
in which structure and union member selectors reside;
- The macro name space
-
in which all macro definitions reside. Token identifiers in the macro name space have no definition and so are not expanded. However, they behave as macros in all other respects;
- The ordinary name space
-
in which all other identifiers reside.
The exception is compound type-token identifiers (see §7.4 Compound type tokens) which by default reside in the ordinary name space but can be forced to reside in the tag name space by setting the optional name-space to be TAG
.
The first identifier of the token-identification provides the internal identification of the token. This is the name used to identify the token within the program. It must be followed by a #
.
All further preprocessing tokens until the end of the line are treated as part of the external-identifier with non-empty white space sequences being replaced by a single space. The external-identifier specifies the external identification of the token which is used for TDF linking. External token identifications reside in their own name space which is distinct from the external name space for functions and objects. This means that it is possible to have both a function and a token with the same external identification. If the external-identifier is omitted it is assumed that the internal and external identifications are the same.