[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Flex/Bison converter doesn't stop on EOF
From: |
Piotr Siupa |
Subject: |
Re: Flex/Bison converter doesn't stop on EOF |
Date: |
Tue, 5 Dec 2023 20:27:15 +0100 |
Fragment from the manual
(https://westes.github.io/flex/manual/Generated-Scanner.html):
"When the scanner receives an end-of-file indication from YY_INPUT, it
then checks the yywrap() function. If yywrap() returns false (zero),
then it is assumed that the function has gone ahead and set up yyin to
point to another input file, and scanning continues. If it returns
true (non-zero), then the scanner terminates, returning 0 to its
caller. Note that in either case, the start condition remains
unchanged; it does not revert to INITIAL."
In short, you're supposed to return 1 in yywrap. Either that or set
the "%option noyywrap".
regards
Piotr Siupa