version 1.6, 2001/01/05 18:26:23 |
version 1.7, 2004/02/03 21:20:17 |
|
|
|
|
#include <stdlib.h> |
#include <stdlib.h> |
%+ |
%+ |
class istream; |
#include <iosfwd> |
%* |
%* |
#include <unistd.h> |
#include <unistd.h> |
|
|
|
|
%- |
%- |
FILE *yy_input_file; |
FILE *yy_input_file; |
%+ |
%+ |
istream* yy_input_file; |
std::istream* yy_input_file; |
%* |
%* |
|
|
char *yy_ch_buf; /* input buffer */ |
char *yy_ch_buf; /* input buffer */ |
|
|
%- |
%- |
yyin = stdin; |
yyin = stdin; |
%+ |
%+ |
yyin = &cin; |
yyin = &std::cin; |
%* |
%* |
|
|
if ( ! yyout ) |
if ( ! yyout ) |
%- |
%- |
yyout = stdout; |
yyout = stdout; |
%+ |
%+ |
yyout = &cout; |
yyout = &std::cout; |
%* |
%* |
|
|
if ( ! yy_current_buffer ) |
if ( ! yy_current_buffer ) |
|
|
} /* end of yylex */ |
} /* end of yylex */ |
|
|
%+ |
%+ |
yyFlexLexer::yyFlexLexer( istream* arg_yyin, ostream* arg_yyout ) |
yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout ) |
{ |
{ |
yyin = arg_yyin; |
yyin = arg_yyin; |
yyout = arg_yyout; |
yyout = arg_yyout; |
|
|
yy_delete_buffer( yy_current_buffer ); |
yy_delete_buffer( yy_current_buffer ); |
} |
} |
|
|
void yyFlexLexer::switch_streams( istream* new_in, ostream* new_out ) |
void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out ) |
{ |
{ |
if ( new_in ) |
if ( new_in ) |
{ |
{ |
|
|
FILE *input_file; |
FILE *input_file; |
#endif |
#endif |
%+ |
%+ |
void yyFlexLexer::yyrestart( istream* input_file ) |
void yyFlexLexer::yyrestart( std::istream* input_file ) |
%* |
%* |
{ |
{ |
if ( ! yy_current_buffer ) |
if ( ! yy_current_buffer ) |
|
|
int size; |
int size; |
#endif |
#endif |
%+ |
%+ |
YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( istream* file, int size ) |
YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size ) |
%* |
%* |
{ |
{ |
YY_BUFFER_STATE b; |
YY_BUFFER_STATE b; |
|
|
%- |
%- |
#ifndef YY_ALWAYS_INTERACTIVE |
#ifndef YY_ALWAYS_INTERACTIVE |
#ifndef YY_NEVER_INTERACTIVE |
#ifndef YY_NEVER_INTERACTIVE |
extern int isatty YY_PROTO(( int )); |
#include <unistd.h> |
#endif |
#endif |
#endif |
#endif |
|
|
|
|
|
|
%+ |
%+ |
extern "C" int isatty YY_PROTO(( int )); |
extern "C" int isatty YY_PROTO(( int )); |
void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, istream* file ) |
void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream* file ) |
%* |
%* |
|
|
{ |
{ |
|
|
|
|
void yyFlexLexer::LexerError( yyconst char msg[] ) |
void yyFlexLexer::LexerError( yyconst char msg[] ) |
{ |
{ |
cerr << msg << '\n'; |
std::cerr << msg << '\n'; |
exit( YY_EXIT_FAILURE ); |
exit( YY_EXIT_FAILURE ); |
} |
} |
%* |
%* |