Next: How do I skip as many chars as possible?, Previous: How do I track the byte offset for lseek()?, Up: FAQ [Contents][Index]
When the flex C++ scanning class rewrite finally happens, then this sort of thing should become much easier.
You can do this by passing the various functions (such as LexerInput()
and LexerOutput()
) NULL iostream*
’s, and then
dealing with your own I/O classes surreptitiously (i.e., stashing them in
special member variables). This works because the only assumption about
the lexer regarding what’s done with the iostream’s is that they’re
ultimately passed to LexerInput()
and LexerOutput
, which then do whatever
is necessary with them.