This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: stage1 bootstrap failuer to build gcc.3.3: cppfiles.c:1168: error: parse error before ']' token etc.


Zack Weinberg wrote:-

> I was thinking of doing stage 3 (comment strip) in there too.  It's
> pretty easy to enumerate the cases to be dealt with:
> 
> case 1: Logical line contains no characters in the set /\?, no
> characters outside the basic source set, and is entirely inside the
> read() buffer.  We scan for the newline, and return the interval to
> the phase-4 lexer.
> 
> 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?).  What about quotes?
 
> case 3: Logical line ends with a // comment.  Overwrite the leading
> slash with a \n terminator, advance the read pointer past the comment,
> and return the narrowed interval to phase 4.  (This saves copying the
> line.)

OK; this assumes we've given up on mmap, right?  What about quotes?
 
> 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?

Neil.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]