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.)
Are you using re2c in the pull model where it calls YYFILL(n) or push model by passing -f?
In the pull model, declare YYFILL(n) to call return when your iterator is exhausted.
In the push model, your iterator loop will dictate when input is done and you won't call into the parser again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With