This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to improve cpplib's C++ support
- To: Zack Weinberg <zack at rabi dot columbia dot edu>
- Subject: Re: Patch to improve cpplib's C++ support
- From: Jason Merrill <jason at cygnus dot com>
- Date: 10 Jul 1999 18:23:22 -0700
- Cc: egcs-patches at egcs dot cygnus dot com
- References: <199907110037.UAA06529@blastula.phys.columbia.edu> <u9so6w6lt9.fsf@yorick.cygnus.com>
>>>>> 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