This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: EOF character in parser
Geert Bosch wrote:-
> On Jan 6, 2004, at 17:16, neil@daikokuya.co.uk wrote:
> >There is no EOF character in cpplib; all bytes are "OK", so this
> >doesn't work.
>
> You can still take advantage of knowing there's an EOF at the
> end of the file. Most tokens cannot contain the EOF symbol and
> you can optimize scanning of those tokens. Or more general, you
> could scan as if EOF's are not allowed in the source. Then you
> fix up when you actually find an EOF.
Yeah, I'd misread your mail. That is in fact what cpplib does
(with \n as sentinel).
Neil.