This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]