Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #2523

Re: What happens at the end of the file for lex?

From Philipp Klaus Krause <pkk@spth.de>
Newsgroups comp.compilers
Subject Re: What happens at the end of the file for lex?
Date 2020-06-04 19:16 +0200
Organization solani.org
Message-ID <20-06-002@comp.compilers> (permalink)
References <20-06-001@comp.compilers>

Show all headers | View raw


Further investigation shows that this was an intentional, but
undocumented change in flex in 2015 (flex 2.5.4 input() returns EOF at
the end of the file, flex 2.6.4 input() returns 0). However I still have
no idea why this change was made.

I guess the only portable way to handle the end of the file is to set a
flag in yywrap() and check it each time input() was called.

Philipp
[Returning EOF was a bug.  The lex input() always returned 0 at end of file. -John]

Back to comp.compilers | Previous | NextPrevious in thread | Find similar


Thread

What happens at the end of the file for lex? Philipp Klaus Krause <pkk@spth.de> - 2020-06-03 10:04 +0200
  Re: What happens at the end of the file for lex? Philipp Klaus Krause <pkk@spth.de> - 2020-06-04 19:16 +0200

csiph-web