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 #ifndef __FLEX_LEXER_H
00045
00046 #define __FLEX_LEXER_H
00047 using namespace std;
00048 #include <iostream>
00049
00050 extern "C++" {
00051
00052 struct yy_buffer_state;
00053 typedef int yy_state_type;
00054
00055 class FlexLexer {
00056 public:
00057 virtual ~FlexLexer() { }
00058
00059 const char* YYText() { return yytext; }
00060 int YYLeng() { return yyleng; }
00061
00062 virtual void
00063 yy_switch_to_buffer( struct yy_buffer_state* new_buffer ) = 0;
00064 virtual struct yy_buffer_state*
00065 yy_create_buffer( istream* s, int size ) = 0;
00066 virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0;
00067 virtual void yyrestart( istream* s ) = 0;
00068
00069 virtual int yylex() = 0;
00070
00071
00072 int yylex( istream* new_in, ostream* new_out = 0 )
00073 {
00074 switch_streams( new_in, new_out );
00075 return yylex();
00076 }
00077
00078
00079
00080 virtual void switch_streams( istream* new_in = 0,
00081 ostream* new_out = 0 ) = 0;
00082
00083 int lineno() const { return yylineno; }
00084
00085 int debug() const { return yy_flex_debug; }
00086 void set_debug( int flag ) { yy_flex_debug = flag; }
00087
00088 protected:
00089 char* yytext;
00090 int yyleng;
00091 int yylineno;
00092 int yy_flex_debug;
00093 };
00094
00095 }
00096 #endif
00097
00098 #if defined(yyFlexLexer) || ! defined(yyFlexLexerOnce)
00099
00100
00101
00102 #define yyFlexLexerOnce
00103
00104 class yyFlexLexer : public FlexLexer {
00105 public:
00106
00107
00108 yyFlexLexer( istream* arg_yyin = 0, ostream* arg_yyout = 0 );
00109
00110 virtual ~yyFlexLexer();
00111
00112 void yy_switch_to_buffer( struct yy_buffer_state* new_buffer );
00113 struct yy_buffer_state* yy_create_buffer( istream* s, int size );
00114 void yy_delete_buffer( struct yy_buffer_state* b );
00115 void yyrestart( istream* s );
00116
00117 virtual int yylex();
00118 virtual void switch_streams( istream* new_in, ostream* new_out );
00119
00120 protected:
00121 virtual int LexerInput( char* buf, int max_size );
00122 virtual void LexerOutput( const char* buf, int size );
00123 virtual void LexerError( const char* msg );
00124
00125 void yyunput( int c, char* buf_ptr );
00126 int yyinput();
00127
00128 void yy_load_buffer_state();
00129 void yy_init_buffer( struct yy_buffer_state* b, istream* s );
00130 void yy_flush_buffer( struct yy_buffer_state* b );
00131
00132 int yy_start_stack_ptr;
00133 int yy_start_stack_depth;
00134 int* yy_start_stack;
00135
00136 void yy_push_state( int new_state );
00137 void yy_pop_state();
00138 int yy_top_state();
00139
00140 yy_state_type yy_get_previous_state();
00141 yy_state_type yy_try_NUL_trans( yy_state_type current_state );
00142 int yy_get_next_buffer();
00143
00144 istream* yyin;
00145 ostream* yyout;
00146
00147 struct yy_buffer_state* yy_current_buffer;
00148
00149
00150 char yy_hold_char;
00151
00152
00153 int yy_n_chars;
00154
00155
00156 char* yy_c_buf_p;
00157
00158 int yy_init;
00159 int yy_start;
00160
00161
00162
00163 int yy_did_buffer_switch_on_eof;
00164
00165
00166
00167
00168 yy_state_type yy_last_accepting_state;
00169 char* yy_last_accepting_cpos;
00170
00171 yy_state_type* yy_state_buf;
00172 yy_state_type* yy_state_ptr;
00173
00174 char* yy_full_match;
00175 int* yy_full_state;
00176 int yy_full_lp;
00177
00178 int yy_lp;
00179 int yy_looking_for_trail_begin;
00180
00181 int yy_more_flag;
00182 int yy_more_len;
00183 int yy_more_offset;
00184 int yy_prev_more_offset;
00185 };
00186
00187 #endif