Patch to improve cpplib's C++ support

Jason Merrill jason@cygnus.com
Sun Jul 11 18:33:00 GMT 1999


>>>>> Jason Merrill <jason@cygnus.com> writes:

>>>>> Jason Merrill <jason@cygnus.com> writes:
 >> cpp_unget is necessary because parsing sometimes looks ahead at the next
 >> token to determine how to proceed.  Normally, this is fine, but when we're
 >> switching to a different input stream, we need to put the lookahead token
 >> back into the buffer where we found it so that it will be there when we
 >> return to reading from that file.

 >> Actually, it occurs to me that it's the lexer, not the parser, that's
 >> looking ahead in this case, and that I can probably avoid that by taking
 >> better advantage of our pre-knowledge of token lengths.

 > Nope, I was wrong.  We need to look ahead at the next token in order to
 > support type attributes.

No, I was right the first time; I've fixed g++ so cpp_unget isn't needed.
I'll investigate doing the same for redirected_input_p.

Jason


More information about the Gcc-patches mailing list