diff options
author | Will Estes <wlestes@users.sourceforge.net> | 2001-09-19 19:19:03 +0000 |
---|---|---|
committer | Will Estes <wlestes@users.sourceforge.net> | 2001-09-19 19:19:03 +0000 |
commit | 75a2fd64ccaca871257fd678ee0be9b39b6abd1d (patch) | |
tree | 1c79d6addd6c580c95161e6100361ed5dafe61e4 /FlexLexer.h | |
parent | 29f3e1f0120b0015567a5dca474e17f2d8fb1024 (diff) |
made preliminary c++ fixes; the intent is to make it work with recent c++ compilers
Diffstat (limited to 'FlexLexer.h')
-rw-r--r-- | FlexLexer.h | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/FlexLexer.h b/FlexLexer.h index e79e1d9..e2d764f 100644 --- a/FlexLexer.h +++ b/FlexLexer.h @@ -47,7 +47,11 @@ #ifndef __FLEX_LEXER_H // Never included before - need to define base class. #define __FLEX_LEXER_H -#include <iostream.h> + +#include <iostream> +# ifndef FLEX_STD +# define FLEX_STD std:: +# endif extern "C++" { @@ -64,14 +68,14 @@ public: virtual void yy_switch_to_buffer( struct yy_buffer_state* new_buffer ) = 0; virtual struct yy_buffer_state* - yy_create_buffer( istream* s, int size ) = 0; + yy_create_buffer( FLEX_STD istream* s, int size ) = 0; virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0; - virtual void yyrestart( istream* s ) = 0; + virtual void yyrestart( FLEX_STD istream* s ) = 0; virtual int yylex() = 0; // Call yylex with new input/output sources. - int yylex( istream* new_in, ostream* new_out = 0 ) + int yylex( FLEX_STD istream* new_in, FLEX_STD ostream* new_out = 0 ) { switch_streams( new_in, new_out ); return yylex(); @@ -79,8 +83,8 @@ public: // Switch to new input/output streams. A nil stream pointer // indicates "keep the current one". - virtual void switch_streams( istream* new_in = 0, - ostream* new_out = 0 ) = 0; + virtual void switch_streams( FLEX_STD istream* new_in = 0, + FLEX_STD ostream* new_out = 0 ) = 0; int lineno() const { return yylineno; } @@ -109,17 +113,17 @@ class yyFlexLexer : public FlexLexer { public: // arg_yyin and arg_yyout default to the cin and cout, but we // only make that assignment when initializing in yylex(). - yyFlexLexer( istream* arg_yyin = 0, ostream* arg_yyout = 0 ); + yyFlexLexer( FLEX_STD istream* arg_yyin = 0, FLEX_STD ostream* arg_yyout = 0 ); virtual ~yyFlexLexer(); void yy_switch_to_buffer( struct yy_buffer_state* new_buffer ); - struct yy_buffer_state* yy_create_buffer( istream* s, int size ); + struct yy_buffer_state* yy_create_buffer( FLEX_STD istream* s, int size ); void yy_delete_buffer( struct yy_buffer_state* b ); - void yyrestart( istream* s ); + void yyrestart( FLEX_STD istream* s ); virtual int yylex(); - virtual void switch_streams( istream* new_in, ostream* new_out ); + virtual void switch_streams( FLEX_STD istream* new_in, FLEX_STD ostream* new_out ); protected: virtual int LexerInput( char* buf, int max_size ); @@ -130,7 +134,7 @@ protected: int yyinput(); void yy_load_buffer_state(); - void yy_init_buffer( struct yy_buffer_state* b, istream* s ); + void yy_init_buffer( struct yy_buffer_state* b, FLEX_STD istream* s ); void yy_flush_buffer( struct yy_buffer_state* b ); int yy_start_stack_ptr; @@ -145,8 +149,8 @@ protected: yy_state_type yy_try_NUL_trans( yy_state_type current_state ); int yy_get_next_buffer(); - istream* yyin; // input source for default LexerInput - ostream* yyout; // output sink for default LexerOutput + FLEX_STD istream* yyin; // input source for default LexerInput + FLEX_STD ostream* yyout; // output sink for default LexerOutput struct yy_buffer_state* yy_current_buffer; |