00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef NL_LEX_H
00028 #define NL_LEX_H
00029
00030 #include <strstream>
00031
00032 struct yy_buffer_state;
00033
00034 typedef int yy_state_type;
00035 #define YY_SKIP_YYWRAP
00036
00037 namespace NLAISCRIPT
00038 {
00039
00040
00041 class FlexLexer {
00042 public:
00043 virtual ~FlexLexer() { }
00044
00045 const char* YYText() { return yytext; }
00046 int YYLeng() { return yyleng; }
00047
00048 virtual void
00049 yy_switch_to_buffer( struct yy_buffer_state* new_buffer ) = 0;
00050 virtual struct yy_buffer_state*
00051 yy_create_buffer( istream* s, int size ) = 0;
00052 virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0;
00053 virtual void yyrestart( istream* s ) = 0;
00054
00055 virtual int yylex() = 0;
00056
00057
00058 int yylex( istream* new_in, ostream* new_out = 0 )
00059 {
00060 switch_streams( new_in, new_out );
00061 return yylex();
00062 }
00063
00064
00065
00066 virtual void switch_streams( istream* new_in = 0,
00067 ostream* new_out = 0 ) = 0;
00068
00069 int lineno() const { return yylineno; }
00070
00071 int debug() const { return yy_flex_debug; }
00072 void set_debug( int flag ) { yy_flex_debug = flag; }
00073
00074 protected:
00075 char* yytext;
00076 int yyleng;
00077 int yylineno;
00078 int yy_flex_debug;
00079
00080 };
00081
00082
00083 #define yyFlexLexerOnce
00084
00085 class yyFlexLexer : public FlexLexer {
00086 public:
00087
00088
00089 yyFlexLexer( istream* arg_yyin = 0, ostream* arg_yyout = 0 );
00090
00091 virtual ~yyFlexLexer();
00092
00093 void yy_switch_to_buffer( struct yy_buffer_state* new_buffer );
00094 struct yy_buffer_state* yy_create_buffer( istream* s, int size );
00095 void yy_delete_buffer( struct yy_buffer_state* b );
00096 void yyrestart( istream* s );
00097
00098 virtual int yylex();
00099 virtual void switch_streams( istream* new_in, ostream* new_out );
00100
00101
00102 protected:
00103 virtual int LexerInput( char* buf, int max_size );
00104 virtual void LexerOutput( const char* buf, int size );
00105 virtual void LexerError( const char* msg );
00106
00107 void yyunput( int c, char* buf_ptr );
00108 int yyinput();
00109
00110 void yy_load_buffer_state();
00111 void yy_init_buffer( struct yy_buffer_state* b, istream* s );
00112 void yy_flush_buffer( struct yy_buffer_state* b );
00113
00114 int yy_start_stack_ptr;
00115 int yy_start_stack_depth;
00116 int* yy_start_stack;
00117
00118 void yy_push_state( int new_state );
00119 void yy_pop_state();
00120 int yy_top_state();
00121
00122 yy_state_type yy_get_previous_state();
00123 yy_state_type yy_try_NUL_trans( yy_state_type current_state );
00124 int yy_get_next_buffer();
00125
00126 istream* yyin;
00127 ostream* yyout;
00128
00129 struct yy_buffer_state* yy_current_buffer;
00130
00131
00132 char yy_hold_char;
00133
00134
00135 int yy_n_chars;
00136
00137
00138 char* yy_c_buf_p;
00139
00140 int yy_init;
00141 int yy_start;
00142
00143
00144
00145 int yy_did_buffer_switch_on_eof;
00146
00147
00148
00149
00150 yy_state_type yy_last_accepting_state;
00151 char* yy_last_accepting_cpos;
00152
00153 yy_state_type* yy_state_buf;
00154 yy_state_type* yy_state_ptr;
00155
00156 char* yy_full_match;
00157 int* yy_full_state;
00158 int yy_full_lp;
00159
00160 int yy_lp;
00161 int yy_looking_for_trail_begin;
00162
00163 int yy_more_flag;
00164 int yy_more_len;
00165
00166
00167
00168 char LastyyText[2][1024*4];
00169 double LastyyNum;
00170 int yyLine,yyColone;
00171
00172 virtual int yywrap() = 0;
00173
00175 virtual void setNewLine() = 0;
00176 };
00177 }
00178 #endif