I'm considering writing some simple lexers with Boost's Spirit.Lex, but I can't seem to find any examples of what I'd like to do.
More or less, I'd like to lex an entire text file (this is easy). But, once the entire file has been processed, I would like to be able to "re-lex" an arbitrary line (e.g. if its contents have changed), using the state from the previous line to avoid lexing the entire file again.
I have seen related resources like this question as well as the Spirit.Lex API documentation (of course), but a simple, concise example of what I'm talking about would be very helpful.
Does such an example exist and/or is this even feasible with Sprit.Lex?