Keith said:
The output of the preprocessor is a sequence of tokens. It isn't
necessarily text.
A typical *implementation* emits text that looks very much like C
code; such an implementation will sometimes need to emit spaces to
separate adjacent tokens. But that's just an internal implementation
detail.
And, in fact, getting back to the OP...
=====
#define A 1
#define B 2
whatever A.B whatever
=====
If the preprocessor were to emit a text file consisting of:
whatever 1.2 whatever
and then pass that file on to the compiler, it would change the
meaning of "A.B". Because "A.B" expands to three tokens, "1", ".",
and "2", and "1.2" is a single token, the two are not equivalent.
In order to preserver the "these are separate tokens", it must
create the text file[1] with the spaces.
Note, too, that "structure . member" is just as valid (at least
according to my compiler, with all warnings turned to max) as
"structure.member".
[1] Note that "must create the text file" is taken in the context
of the preprocessor creating a file to pass to the compiler.
Obviously, nothing requires that it actually do so, and could
instead pass the token stream to a compiler without the use of
an external file.
--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody |
www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net |
www.fptech.com | <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:
[email protected]>