(flex.info)How do I use my own I/O classes in a C++ scanner?


Next: How do I skip as many chars as possible? Prev: How do I track the byte offset for lseek()? Up: FAQ
Enter node , (file) or (file)node

How do I use my own I/O classes in a C++ scanner?
=================================================

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.


automatically generated by info2www version 1.2.2.9