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: 12 Jul 1999 00:54:06 -0700
- Cc: egcs-patches at egcs dot cygnus dot com
- References: <199907120255.WAA11006@blastula.phys.columbia.edu>
>>>>> Zack Weinberg <zack@rabi.columbia.edu> writes:
> However, I'm working on a revised API to cpplib that is going to behave
> differently in both the affected areas. The big difference is that you
> make one function call and get handed an entire line split up into
> tokens. You then can walk through it at your leisure.
Why a line? The current API of getting one token at a time makes sense to
me. I actually find it inconvenient that #-directives are treated as one
big token rather than a series of tokens like everything else; it means
that I can't always rely on cpplib pre-tokenization in yylex().
> If you stack another input buffer in the middle of parsing the list,
> it'll still be there when you come back (this is needed anyway for macro
> expansion). So cpp_unget becomes a pointer decrement in the front end.
> On the flip side, you can't back up by part of a token. cpp_unget as it
> was in your patch would have let you do that.
No problem; it was only actually used for full tokens.
> As for redirected_input_p, the plan is to make caller pop the buffer all
> the time (except for macro buffers).
Huh? Why should the frontend handle #includes?
Jason