This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: EOF character in parser
On Jan 5, 2004, at 20:53, Zack Weinberg wrote:
The Fortran, Java, and Ada front ends don't use cpplib so I don't know
what they do.
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.
-Geert