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:-
> The Ada front end always terminates files with an EOF character
> after they have been read in. One of the advantages is that you
> never need checking for end of file, you'll encounter it during
> parsing. Note that, with a little care, this even works if
> an EOF character may appear in other situations.
>
> For example, when skipping white space, you can just increase
> the scan pointer until it doesn't point to white space. No checks
> for an out-of-range pointer are necessary.
There is no EOF character in cpplib; all bytes are "OK", so this
doesn't work.
Neil.