Preprocessor Trickery
bet at ecsvax.UUCP
bet at ecsvax.UUCP
Tue Jul 3 00:52:24 AEST 1984
Someone made a comment earlier that seems to have been ignored by many,
that efforts like X/**/Y and the QUOTE macro *aren't* guaranteed to be
portable, and further that *no* mechanism is guaranteed to be portable,
since in theory the cpp functionality is defined in terms of *tokens*.
That is to say, the standard, *required* behavior of cpp could be produced
by code between the lexical analyzer and the parser. Composite token
creation can only really be expected to show up when cpp is a distinct
pass of the compiler, producing "clear", preprocessed C as an intermediate
step, which then undergoes another lexical analysis. In fact this
is not the only way that compilers are created -- small, fast single pass
compilers for micros, to keep the amount of overlaying required down,
sometimes build the functionality of cpp *into* the compiler. A second
lexical analysis is legitimately considered an unnecessary waste of
time and space. Let us keep in mind that one of the strongest aspects
of C is how good a language it is for small systems.
Bennett Todd
...{decvax,ihnp4,akgua}!mcnc!ecsvax!bet
More information about the Comp.lang.c
mailing list