So apparently input() just returns 0 (and keeps doing so).
Is input() supposed to always return 0 at the end? Could inut() return 0
in some other situation? When would input() return EOF?
Philipp
[The convention in lex and flex is that input() returns 0 at tne end of input. You can use a <<EOF>> rule if you want your lexer to do something other than return
when it gets to EOF. The yywrap() routine is used for file switching if your lexer
handles multiple input files in a single run. -John]
From Philipp Klaus Krause@21:1/5 to All on Thu Jun 4 19:16:09 2020
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]