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


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.


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