|Hand written or tool generated lexical analyzers for FORTRAN email@example.com (Pankaj) (2005-09-14)|
|Re: Hand written or tool generated lexical analyzers for FORTRAN firstname.lastname@example.org (Fred J. Scipione) (2005-09-17)|
|Re: Hand written or tool generated lexical analyzers for FORTRAN email@example.com (Pankaj) (2005-09-27)|
|Re: C scanners, was Hand written or tool generated lexical analyzers f firstname.lastname@example.org (Russ Cox) (2005-09-30)|
|Re: C scanners, was Hand written or tool generated lexical analyzers f email@example.com (2005-10-02)|
|Re: C scanners, was Hand written or tool generated lexical analyzers f firstname.lastname@example.org (Vesa Karvonen) (2005-10-13)|
|From:||Vesa Karvonen <email@example.com>|
|Date:||13 Oct 2005 20:37:21 -0400|
|Organization:||University of Helsinki|
|References:||05-09-054 05-09-069 05-09-127 05-09-137 05-10-004|
Nick Maclaren <firstname.lastname@example.org> wrote:
> But, if you exclude that, and the more contorted use of the # and ##
> preprocessor operations, I believe that most C compilers do work the
> way you say. There are some truly horrible ambiguities with those
> operators, but thankfully nobody seems to use the constructions that
> trigger them.
I don't think that there are "horrible ambiquities" (at least not when
compared to the rest of the language) with the # and ## operators of
the C preprocessor. The semantics of the # and ## operators are
relatively clearly spelled out. However, based on my experience in
writing C preprocessor metaprograms, like
it seems that relatively few preprocessors implement the C
> #include <stddef.h>
> #define A(x) # x
> is one of the simpler and more unambiguously implementation dependent.
Are you saying that the token sequence resulting from preprocessing
the above macro invocation
is implementation dependent? It isn't:
"If, in the replacement list, a parameter is immediately
preceded by a # preprocessing token, both are replaced by a
single character string literal preprocessing token that
contains the spelling of the preprocessing token sequence
for the corresponding argument. Each occurrence of white
space between the argument's preprocessing tokens becomes a
single space character in the character string literal.
White space before the first preprocessing token and after
the last preprocessing token composing the argument is
The result of the above macro invocation must be
on all C99 conforming preprocessors.
Return to the
Search the comp.compilers archives again.