]> granicus.if.org Git - flex/commitdiff
added switch_streams
authorVern Paxson <vern@ee.lbl.gov>
Sun, 5 Mar 1995 16:50:33 +0000 (16:50 +0000)
committerVern Paxson <vern@ee.lbl.gov>
Sun, 5 Mar 1995 16:50:33 +0000 (16:50 +0000)
flex.skl

index 2ea231d9b2af631286080130afa4aee14b3a6aa2..69eafa485af275e665f28e0f86987da5a3f36624 100644 (file)
--- a/flex.skl
+++ b/flex.skl
@@ -667,6 +667,18 @@ yyFlexLexer::~yyFlexLexer()
        yy_delete_buffer( yy_current_buffer );
        }
 
+void yyFlexLexer::switch_streams( istream* new_in, ostream* new_out )
+       {
+       if ( new_in )
+               {
+               yy_delete_buffer( yy_current_buffer );
+               yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) );
+               }
+
+       if ( new_out )
+               yyout = new_out;
+       }
+
 #ifdef YY_INTERACTIVE
 int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
 #else