Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!linac!att!princeton!pucc!EGNILGES From: EGNILGES@pucc.Princeton.EDU (Ed Nilges) Newsgroups: comp.lang.c Subject: Re: Trouble at EOF Message-ID: <12850@pucc.Princeton.EDU> Date: 17 Jun 91 15:34:45 GMT References: <12847@pucc.Princeton.EDU> <4739@inews.intel.com> Reply-To: EGNILGES@pucc.Princeton.EDU Organization: Princeton University, NJ Lines: 27 Disclaimer: Author bears full responsibility for contents of this article In article <4739@inews.intel.com>, bhoughto@pima.intel.com (Blair P. Houghton) writes: > >As confusing as that was, I think I got it. The only confusion resulted from the misuse of a line reader in a lexical analyzer, which is a character-by-character sort of thing. A minor source of confusion was the omission of the reference. It was ANSI C: A Lexical Guide, published by the Mark Williams Company. I took the advice of Mr. Ken Yap down in Australia at CSIRO, and this morning completely altered the lexical analyzer to use getc and ungetc. It considerably simplified the code. The use of a line reader in the first place was the unfortunate byproduct of having an IBM, unit-record background. Yes, there may be a performance penalty on IBM mainframe systems compiling C, in which case the getc and ungetc can be hand-rolled around a unit record reader for efficiency. No, I don't want to use lexx. I do not like the code it generates and (once I get rid of these subtle tendencies to think in IBMerese) I believe I can write more efficient code for the language I am lexxicating. Thanks to Mr. Ken Yap and the rest of the gang on comp.lang.c for your patience.