This is the mail archive of the gcc-patches@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]

Re: Patch to improve cpplib's C++ support


>>>>> 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.

Jason


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