This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: stage1 bootstrap failuer to build gcc.3.3: cppfiles.c:1168: error: parse error before ']' token etc.
On Wed, Sep 11, 2002 at 07:42:30AM +0100, 'Neil Booth' wrote:
> > case 2: Logical line contains / not immediately followed by * or /; \
> > not immediately followed by whitespace and newline; or ? not
> > immediately followed by the rest of a trigraph. Catch this out of
> > line, jump back into the scanner loop.
>
> OK. You get the boring cases of / and * separated by escaped newlines
> too (or is that case 4?).
Yes, that's case 4.
> What about quotes?
Ugh, I forgot all about quotes. I guess they're another case again,
or a state flag.
That might kick the complexity up to the point where it's not worth
it.
> > case 4: Logical line contains a trigraph, backslash-newline, block
> > comment, or character outside the basic source set. Jump to
> > particular logic to handle that case. They'll all probably involve
> > copying the logical line to a second buffer, with some sort of
> > annotation on the side so we don't lose track of the original source
> > position.
>
> Yes. What would you do about caret diagnostics to get the caret to
> point to the right place in the original line?
That's what the annotations on the side are for. They're basically a
list of reverse transformations that take you from the logical line to
the set of physical lines it was composed from.
It occurs to me that one good reason to keep the complete text of all
files around forever is to facilitate generating caret diagnostics; we
may want to do that well after we're done with any given logical line.
zw