FlexLexer.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086 #ifndef __FLEX_LEXER_H
00087
00088 #define __FLEX_LEXER_H
00089 #include <iostream>
00090
00091
00092
00093 using std::istream;
00094 using std::ostream;
00095 using std::cin;
00096 using std::cout;
00097 using std::cerr;
00098 using std::endl;
00099
00100
00101 extern "C++" {
00102
00103 struct yy_buffer_state;
00104 typedef int yy_state_type;
00105
00106 class FlexLexer {
00107 public:
00108 virtual ~FlexLexer() { }
00109
00110 const char* YYText() { return yytext; }
00111 int YYLeng() { return yyleng; }
00112
00113 virtual void
00114 yy_switch_to_buffer( struct yy_buffer_state* new_buffer ) = 0;
00115 virtual struct yy_buffer_state*
00116 yy_create_buffer( istream* s, int size ) = 0;
00117 virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0;
00118 virtual void yyrestart( istream* s ) = 0;
00119
00120 virtual int yylex() = 0;
00121
00122
00123 int yylex( istream* new_in, ostream* new_out = 0 )
00124 {
00125 switch_streams( new_in, new_out );
00126 return yylex();
00127 }
00128
00129
00130
00131 virtual void switch_streams( istream* new_in = 0,
00132 ostream* new_out = 0 ) = 0;
00133
00134 int lineno() const { return yylineno; }
00135
00136 int debug() const { return yy_flex_debug; }
00137 void set_debug( int flag ) { yy_flex_debug = flag; }
00138
00139 protected:
00140 char* yytext;
00141 int yyleng;
00142 int yylineno;
00143 int yy_flex_debug;
00144 };
00145
00146 }
00147 #endif
00148
00149 #if defined(yyFlexLexer) || ! defined(yyFlexLexerOnce)
00150
00151
00152
00153 #define yyFlexLexerOnce
00154
00155 class yyFlexLexer : public FlexLexer {
00156 public:
00157
00158
00159 yyFlexLexer( istream* arg_yyin = 0, ostream* arg_yyout = 0 );
00160
00161 virtual ~yyFlexLexer();
00162
00163 void yy_switch_to_buffer( struct yy_buffer_state* new_buffer );
00164 struct yy_buffer_state* yy_create_buffer( istream* s, int size );
00165 void yy_delete_buffer( struct yy_buffer_state* b );
00166 void yyrestart( istream* s );
00167
00168 virtual int yylex();
00169 virtual void switch_streams( istream* new_in, ostream* new_out );
00170
00171 int yylex( istream* new_in, ostream* new_out = 0 ) {
00172 return FlexLexer::yylex(new_in, new_out);
00173 }
00174
00175 protected:
00176 virtual int LexerInput( char* buf, int max_size );
00177 virtual void LexerOutput( const char* buf, int size );
00178 virtual void LexerError( const char* msg );
00179
00180
00181 virtual int actionHook(void* data = 0) {
00182 return data == 0;
00183 }
00184
00185 void yyunput( int c, char* buf_ptr );
00186 int yyinput();
00187
00188 void yy_load_buffer_state();
00189 void yy_init_buffer( struct yy_buffer_state* b, istream* s );
00190 void yy_flush_buffer( struct yy_buffer_state* b );
00191
00192 int yy_start_stack_ptr;
00193 int yy_start_stack_depth;
00194 int* yy_start_stack;
00195
00196 void yy_push_state( int new_state );
00197 void yy_pop_state();
00198 int yy_top_state();
00199
00200 yy_state_type yy_get_previous_state();
00201 yy_state_type yy_try_NUL_trans( yy_state_type current_state );
00202 int yy_get_next_buffer();
00203
00204 istream* yyin;
00205 ostream* yyout;
00206
00207 struct yy_buffer_state* yy_current_buffer;
00208
00209
00210 char yy_hold_char;
00211
00212
00213 int yy_n_chars;
00214
00215
00216 char* yy_c_buf_p;
00217
00218 int yy_init;
00219 int yy_start;
00220
00221
00222
00223 int yy_did_buffer_switch_on_eof;
00224
00225
00226
00227
00228 yy_state_type yy_last_accepting_state;
00229 char* yy_last_accepting_cpos;
00230
00231 yy_state_type* yy_state_buf;
00232 yy_state_type* yy_state_ptr;
00233
00234 char* yy_full_match;
00235 int* yy_full_state;
00236 int yy_full_lp;
00237
00238 int yy_lp;
00239 int yy_looking_for_trail_begin;
00240
00241 int yy_more_flag;
00242 int yy_more_len;
00243 int yy_more_offset;
00244 int yy_prev_more_offset;
00245 };
00246
00247 #endif
Generated on Wed Jul 28 16:04:14 2004 for s11n by
1.3.7