Expose yyatEOF() in generated scanner API#644
Conversation
|
The benefit is quite clear on EofminGoldenTest.java which has states and doesn't have a single token for the EOF status. |
|
@lsf37 Am I missing something? Can a client of the scanner know whether the scanner has reached EOF in a generic way? |
|
@lsf37 I chose name |
|
The I don't fully remember any more wether relying on The whole |
|
Ok, after looking through the emitter and skeleton code, |
|
We should probably add it to the manual as well. I can do that if you like (happy for you to merge first). |
Renamed to |
zzAtEof() in generated scanner APIyyatEOF() in generated scanner API
Documentation should be added with code. Done in 4405977. |
commit f966df4 Author: Régis Décamps <regisd@google.com> AuthorDate: Tue Dec 3 14:12:41 2019 +0100 Commit: GitHub <noreply@github.com> CommitDate: Tue Dec 3 14:12:41 2019 +0100 Expose `yyatEOF()` in generated scanner API (#644) * Add new `zzatEOF()` method to generated scanners. * Demonstrate use in tests * Update vm template in migration tool * Add documentation about yyatEOF() Updated from target/jflex-parent-1.8.0-SNAPSHOT-sources.jar
I don't think there is a convenient way to known whether a scanner has finished reading its input.
But it's sounds to me that looping until EOF is a critical use case, which is even implemented in the standalone
mainmethod as:See Emitter.java:350
This change adds a getter for the
zzAtEOFfield.