Comments (2)
I can't find a spot in the docs that explains this behavior clearly. The best hints I could find are in the sections on multiple buffers, yywrap, and EOF rules.
You need an <> rule that calls yyterminate or sets up the next buffer. That rule will take the place of yywrap in your use case.
I'm away from my computer but I'll post an example when I'm back.
from flex.
Thanks for clarifying.
In case it's useful when thinking about the docs, my mental model, when writing what I did, was that when I arrive at EOF
using input()
, I'm doing so ‘legitimately’ (ie, as opposed to my being illegitimately creative with yyinput
, or something like that). It was on that basis that I presumed yywrap
would Do The Right Thing, and that when flex subsequently asked for more input from input()
, it would be told calmly ‘no’.
Or, put another way, my mental model is that flex is itself using input()
to get input, or something equivalent to that, so that I'm working in concert with it if I read from it separately.
If those are bad intuitions, it might be useful for the docs to disabuse the reader fairly explicitly.
from flex.
Related Issues (20)
- New release request HOT 1
- Add Scorecard Action to monitor project's security posture HOT 2
- Broken yywrap()?
- Some situation where flex generated cpp code generates an access out-of-bounds HOT 2
- FYI: New warning for C++ lexer with gcc 13 -Wall
- BSD licensing while containing GPL-2.0 header in some files HOT 2
- Docs typo: C++ header file is FlexLexer.h not yyFlexLexer.h HOT 1
- aarch64-linux-gnu-gcc build flex2.6.4 will error HOT 2
- C-99 comment rule flawed HOT 13
- Inconsistent handling of in memory buffers compared to file buffers
- question HOT 1
- can't enlarge buffer, but no REJECT HOT 11
- Build without info/man/examples HOT 2
- Potential out-of-bounds access of `yy_nxt` HOT 7
- Buffer overflow with `-CF -8` options and 0x00 0xFF input HOT 23
- Fix sed incompatibilities on MacOS X HOT 10
- Cannot match non-ASCII characters HOT 1
- Noob question: Where's the makefile? HOT 5
- crash when yylex HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flex.