On Fri, 8 Aug 2003 23:57:54 -0400, "Bill Cunningham" <so**@some.net>
wrote in comp.lang.c:
after the phase 3 of the translation in both languages.
Victor
What exactly is phase 3 translation? Into assembly or RTL perhaps?
Bill
The original ANSI/ISO C language standard (1989/1990) provided a
high-level definition of the translation process that an
implementation performs in producing executable code from a source
file. These have persisted to the present in later versions of the C
standard and have been incorporated into the C++ standard.
Like everything else in C and C++, the "as-if" rule applies, meaning
that a compiler does not have use separate passes to perform all of
these operations. It can do them in parallel as long as the proper
ordering is used.
They are too long to quote here in full, but the two that are relevant
to this question are that in phase 3, "Each comment is replaced by one
space character", and in phase 4, "Preprocessing directives are
executed and macro invocations are expanded".
So there is no way of including a comment in the expansion of a macro.
The early lexical analysis step removes comments before the
preprocessor expands macros.
An overview of the 8 phases of translation:
1 through 6 deals with parsing and preprocessor issues. At the end of
phase 6 the program is a series of tokens, without white space, with
all comments removed and macros expanded.
Phase 7 actually analyses and translates the program into some sort of
output format, generally referred to as an object file.
Phase 8 is after compilation, usually performed by a separate tool
called a linker. It resolves references between different source
files and to library modules and generally produces the final
executable output file.
--
Jack Klein
Home:
http://JK-Technology.Com
FAQs for
comp.lang.c
http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++
http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
ftp://snurse-l.org/pub/acllc-c++/faq