I am attempting to use re2c with input defined with an iterator pair instead of a null terminated string.
From Manual:
YYCURSOR
[...]
On entry, YYCURSOR is assumed to point to the first character of the current token.
On exit, YYCURSOR will point to the first character of the following token.
This last point means that it is attempting to iterate past the end.
Is there a trick to make re2c work with iterators ? (Other than not using checked iterators.)
AFAICT, all you need to do is set
YYLIMITto point one character past the end, and haveYYFILL()return if no further data exists (which in your case is probably always).You might want to look at the re2c examples, specifically the strip_comments example, which reads from a file instead of a null terminated string.