00001 #line 2 "sqlscanner.cpp"
00002
00003
00004
00005
00006
00007
00008 #define FLEX_SCANNER
00009 #define YY_FLEX_MAJOR_VERSION 2
00010 #define YY_FLEX_MINOR_VERSION 5
00011
00012 #include <stdio.h>
00013
00014
00015
00016 #ifdef c_plusplus
00017 #ifndef __cplusplus
00018 #define __cplusplus
00019 #endif
00020 #endif
00021
00022
00023 #ifdef __cplusplus
00024
00025 #include <stdlib.h>
00026 #include <unistd.h>
00027
00028
00029 #define YY_USE_PROTOS
00030
00031
00032 #define YY_USE_CONST
00033
00034 #else
00035
00036 #if __STDC__
00037
00038 #define YY_USE_PROTOS
00039 #define YY_USE_CONST
00040
00041 #endif
00042 #endif
00043
00044 #ifdef __TURBOC__
00045 #pragma warn -rch
00046 #pragma warn -use
00047 #include <io.h>
00048 #include <stdlib.h>
00049 #define YY_USE_CONST
00050 #define YY_USE_PROTOS
00051 #endif
00052
00053 #ifdef YY_USE_CONST
00054 #define yyconst const
00055 #else
00056 #define yyconst
00057 #endif
00058
00059
00060 #ifdef YY_USE_PROTOS
00061 #define YY_PROTO(proto) proto
00062 #else
00063 #define YY_PROTO(proto) ()
00064 #endif
00065
00066
00067 #define YY_NULL 0
00068
00069
00070
00071
00072
00073
00074 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
00075
00076
00077
00078
00079
00080 #define BEGIN yy_start = 1 + 2 *
00081
00082
00083
00084
00085
00086 #define YY_START ((yy_start - 1) / 2)
00087 #define YYSTATE YY_START
00088
00089
00090 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
00091
00092
00093 #define YY_NEW_FILE yyrestart( yyin )
00094
00095 #define YY_END_OF_BUFFER_CHAR 0
00096
00097
00098 #define YY_BUF_SIZE 16384
00099
00100 typedef struct yy_buffer_state *YY_BUFFER_STATE;
00101
00102 extern int yyleng;
00103 extern FILE *yyin, *yyout;
00104
00105 #define EOB_ACT_CONTINUE_SCAN 0
00106 #define EOB_ACT_END_OF_FILE 1
00107 #define EOB_ACT_LAST_MATCH 2
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125 #define yyless(n) \
00126 do \
00127 { \
00128 \
00129 *yy_cp = yy_hold_char; \
00130 YY_RESTORE_YY_MORE_OFFSET \
00131 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
00132 YY_DO_BEFORE_ACTION; \
00133 } \
00134 while ( 0 )
00135
00136 #define unput(c) yyunput( c, yytext_ptr )
00137
00138
00139
00140
00141
00142 typedef unsigned int yy_size_t;
00143
00144
00145 struct yy_buffer_state
00146 {
00147 FILE *yy_input_file;
00148
00149 char *yy_ch_buf;
00150 char *yy_buf_pos;
00151
00152
00153
00154
00155 yy_size_t yy_buf_size;
00156
00157
00158
00159
00160 int yy_n_chars;
00161
00162
00163
00164
00165
00166 int yy_is_our_buffer;
00167
00168
00169
00170
00171
00172
00173 int yy_is_interactive;
00174
00175
00176
00177
00178
00179 int yy_at_bol;
00180
00181
00182
00183
00184 int yy_fill_buffer;
00185
00186 int yy_buffer_status;
00187 #define YY_BUFFER_NEW 0
00188 #define YY_BUFFER_NORMAL 1
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199 #define YY_BUFFER_EOF_PENDING 2
00200 };
00201
00202 static YY_BUFFER_STATE yy_current_buffer = 0;
00203
00204
00205
00206
00207
00208 #define YY_CURRENT_BUFFER yy_current_buffer
00209
00210
00211
00212 static char yy_hold_char;
00213
00214 static int yy_n_chars;
00215
00216
00217 int yyleng;
00218
00219
00220 static char *yy_c_buf_p = (char *) 0;
00221 static int yy_init = 1;
00222 static int yy_start = 0;
00223
00224
00225
00226
00227 static int yy_did_buffer_switch_on_eof;
00228
00229 void yyrestart YY_PROTO(( FILE *input_file ));
00230
00231 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
00232 void yy_load_buffer_state YY_PROTO(( void ));
00233 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
00234 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
00235 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
00236 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
00237 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
00238
00239 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
00240 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
00241 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
00242
00243 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
00244 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
00245 static void yy_flex_free YY_PROTO(( void * ));
00246
00247 #define yy_new_buffer yy_create_buffer
00248
00249 #define yy_set_interactive(is_interactive) \
00250 { \
00251 if ( ! yy_current_buffer ) \
00252 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
00253 yy_current_buffer->yy_is_interactive = is_interactive; \
00254 }
00255
00256 #define yy_set_bol(at_bol) \
00257 { \
00258 if ( ! yy_current_buffer ) \
00259 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
00260 yy_current_buffer->yy_at_bol = at_bol; \
00261 }
00262
00263 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
00264
00265
00266 #define YY_USES_REJECT
00267
00268 #define yywrap() 1
00269 #define YY_SKIP_YYWRAP
00270 typedef unsigned char YY_CHAR;
00271 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
00272 typedef int yy_state_type;
00273 #define YY_FLEX_LEX_COMPAT
00274 extern int yylineno;
00275 int yylineno = 1;
00276 extern char yytext[];
00277
00278
00279 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
00280 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
00281 static int yy_get_next_buffer YY_PROTO(( void ));
00282 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
00283
00284
00285
00286
00287 #define YY_DO_BEFORE_ACTION \
00288 yytext_ptr = yy_bp; \
00289 yyleng = (int) (yy_cp - yy_bp); \
00290 yy_hold_char = *yy_cp; \
00291 *yy_cp = '\0'; \
00292 if ( yyleng + yy_more_offset >= YYLMAX ) \
00293 YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \
00294 yy_flex_strncpy( &yytext[yy_more_offset], yytext_ptr, yyleng + 1 ); \
00295 yyleng += yy_more_offset; \
00296 yy_prev_more_offset = yy_more_offset; \
00297 yy_more_offset = 0; \
00298 yy_c_buf_p = yy_cp;
00299
00300 #define YY_NUM_RULES 39
00301 #define YY_END_OF_BUFFER 40
00302 static yyconst short int yy_acclist[154] =
00303 { 0,
00304 40, 39, 37, 39, 38, 39, 39, 38, 39, 38,
00305 39, 39, 38, 39, 7, 35, 39, 38, 39, 38,
00306 39, 38, 39, 35, 39, 35, 39, 35, 39, 35,
00307 39, 35, 39, 35, 39, 35, 39, 35, 39, 35,
00308 39, 35, 39, 35, 39, 35, 39, 35, 39, 35,
00309 39, 38, 39, 37, 2, 9, 34, 8, 8, 7,
00310 35, 35, 27, 4, 1, 3, 5, 28, 35, 10,
00311 35, 35, 35, 6, 35, 22, 35, 35, 35, 35,
00312 35, 35, 24, 35, 25, 35, 35, 35, 35, 35,
00313 35, 35, 26, 36, 8, 9, 35, 35, 35, 35,
00314
00315 35, 35, 35, 21, 35, 35, 35, 35, 35, 35,
00316 35, 29, 35, 35, 12, 35, 35, 14, 35, 15,
00317 35, 16, 35, 23, 35, 35, 35, 35, 35, 35,
00318 35, 35, 30, 35, 35, 35, 32, 35, 33, 35,
00319 11, 35, 35, 31, 35, 35, 13, 35, 20, 35,
00320 18, 19, 17
00321 } ;
00322
00323 static yyconst short int yy_accept[137] =
00324 { 0,
00325 1, 1, 1, 2, 3, 5, 7, 8, 10, 12,
00326 13, 15, 18, 20, 22, 24, 26, 28, 30, 32,
00327 34, 36, 38, 40, 42, 44, 46, 48, 50, 52,
00328 54, 55, 56, 56, 57, 57, 58, 59, 60, 62,
00329 63, 64, 65, 66, 67, 68, 69, 70, 72, 73,
00330 74, 76, 78, 79, 80, 81, 82, 83, 85, 87,
00331 88, 89, 90, 91, 92, 93, 94, 95, 96, 98,
00332 99, 100, 101, 101, 102, 103, 104, 106, 107, 108,
00333 109, 110, 111, 112, 114, 115, 117, 118, 118, 120,
00334 122, 124, 124, 126, 127, 128, 129, 130, 131, 132,
00335
00336 133, 133, 133, 133, 135, 136, 137, 139, 141, 143,
00337 144, 144, 144, 144, 146, 147, 149, 149, 150, 150,
00338 151, 151, 151, 151, 151, 151, 151, 151, 151, 152,
00339 153, 153, 153, 153, 154, 154
00340 } ;
00341
00342 static yyconst int yy_ec[256] =
00343 { 0,
00344 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
00345 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00346 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00347 1, 2, 3, 4, 5, 1, 5, 6, 7, 5,
00348 5, 5, 5, 5, 5, 8, 5, 9, 9, 9,
00349 9, 9, 9, 9, 9, 9, 9, 5, 5, 10,
00350 11, 12, 5, 5, 14, 15, 16, 17, 18, 19,
00351 20, 21, 22, 23, 24, 25, 26, 27, 28, 13,
00352 13, 29, 30, 31, 32, 13, 33, 34, 13, 13,
00353 5, 1, 5, 5, 13, 5, 14, 15, 16, 17,
00354
00355 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
00356 28, 13, 13, 29, 30, 31, 32, 13, 33, 34,
00357 13, 13, 1, 35, 1, 5, 1, 1, 1, 1,
00358 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00359 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00360 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00361 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00362 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00363 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00364 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00365
00366 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00367 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00368 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00369 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00370 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00371 1, 1, 1, 1, 1
00372 } ;
00373
00374 static yyconst int yy_meta[36] =
00375 { 0,
00376 1, 1, 1, 1, 1, 1, 1, 2, 3, 1,
00377 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
00378 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00379 3, 3, 3, 3, 1
00380 } ;
00381
00382 static yyconst short int yy_base[139] =
00383 { 0,
00384 0, 0, 228, 229, 225, 215, 0, 229, 219, 217,
00385 214, 28, 28, 211, 30, 213, 35, 37, 38, 41,
00386 36, 39, 42, 46, 47, 64, 44, 55, 51, 185,
00387 217, 229, 214, 229, 210, 229, 207, 206, 69, 206,
00388 229, 229, 229, 229, 229, 229, 43, 205, 72, 73,
00389 75, 83, 76, 80, 79, 81, 84, 204, 203, 85,
00390 86, 87, 89, 92, 88, 229, 229, 201, 201, 94,
00391 99, 106, 113, 108, 110, 111, 118, 113, 115, 114,
00392 120, 119, 122, 200, 123, 199, 125, 111, 198, 197,
00393 196, 132, 195, 129, 40, 138, 139, 140, 141, 147,
00394
00395 165, 170, 172, 185, 142, 153, 184, 183, 182, 145,
00396 186, 162, 160, 177, 148, 176, 162, 229, 161, 164,
00397 150, 155, 150, 154, 164, 148, 150, 142, 229, 229,
00398 168, 166, 141, 229, 229, 50, 197, 199
00399 } ;
00400
00401 static yyconst short int yy_def[139] =
00402 { 0,
00403 135, 1, 135, 135, 135, 135, 136, 135, 135, 137,
00404 135, 138, 135, 135, 135, 138, 138, 138, 138, 138,
00405 138, 138, 138, 138, 138, 138, 138, 138, 138, 135,
00406 135, 135, 136, 135, 137, 135, 135, 135, 138, 138,
00407 135, 135, 135, 135, 135, 135, 138, 138, 138, 138,
00408 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
00409 138, 138, 138, 138, 138, 135, 135, 135, 138, 138,
00410 138, 138, 135, 138, 138, 138, 138, 138, 138, 138,
00411 138, 138, 138, 138, 138, 138, 138, 135, 138, 138,
00412 138, 135, 138, 138, 138, 138, 138, 138, 138, 138,
00413
00414 135, 135, 135, 138, 138, 138, 138, 138, 138, 138,
00415 135, 135, 135, 138, 138, 138, 135, 135, 135, 138,
00416 135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
00417 135, 135, 135, 135, 0, 135, 135, 135
00418 } ;
00419
00420 static yyconst short int yy_nxt[265] =
00421 { 0,
00422 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
00423 14, 15, 16, 17, 16, 18, 16, 16, 19, 16,
00424 16, 20, 21, 16, 22, 16, 23, 24, 25, 26,
00425 27, 16, 28, 29, 30, 38, 39, 41, 42, 43,
00426 45, 46, 135, 135, 135, 135, 135, 135, 135, 135,
00427 135, 135, 33, 135, 135, 105, 54, 63, 135, 69,
00428 55, 47, 135, 53, 48, 49, 50, 51, 60, 56,
00429 52, 135, 58, 57, 59, 64, 38, 39, 65, 135,
00430 135, 61, 135, 135, 73, 62, 135, 135, 135, 70,
00431 135, 135, 135, 135, 135, 135, 135, 74, 75, 135,
00432
00433 71, 135, 76, 82, 79, 72, 135, 85, 78, 83,
00434 80, 77, 81, 135, 73, 135, 84, 135, 135, 92,
00435 135, 135, 135, 87, 86, 135, 135, 135, 91, 135,
00436 135, 95, 135, 92, 89, 94, 135, 93, 101, 88,
00437 90, 96, 102, 97, 100, 135, 135, 135, 135, 135,
00438 98, 123, 135, 99, 135, 135, 107, 108, 109, 104,
00439 135, 103, 106, 117, 110, 123, 115, 132, 134, 132,
00440 131, 135, 114, 116, 130, 129, 120, 128, 127, 125,
00441 126, 124, 122, 135, 135, 119, 118, 117, 121, 135,
00442 135, 135, 135, 113, 112, 111, 133, 35, 35, 35,
00443
00444 40, 40, 135, 135, 135, 135, 135, 135, 135, 68,
00445 135, 135, 135, 135, 68, 37, 36, 67, 31, 66,
00446 135, 44, 37, 36, 34, 32, 31, 135, 3, 135,
00447 135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
00448 135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
00449 135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
00450 135, 135, 135, 135
00451 } ;
00452
00453 static yyconst short int yy_chk[265] =
00454 { 0,
00455 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00456 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00457 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00458 1, 1, 1, 1, 1, 12, 12, 13, 13, 13,
00459 15, 15, 17, 21, 18, 19, 22, 95, 20, 23,
00460 47, 27, 136, 24, 25, 95, 22, 27, 29, 47,
00461 22, 17, 28, 21, 17, 18, 19, 20, 25, 23,
00462 20, 26, 24, 23, 24, 28, 39, 39, 29, 49,
00463 50, 26, 51, 53, 52, 26, 55, 54, 56, 49,
00464 52, 57, 60, 61, 62, 65, 63, 53, 54, 64,
00465
00466 50, 70, 55, 63, 60, 51, 71, 70, 57, 64,
00467 61, 56, 62, 72, 73, 74, 65, 75, 76, 77,
00468 78, 80, 79, 72, 71, 77, 82, 81, 76, 83,
00469 85, 80, 87, 92, 74, 79, 94, 78, 88, 73,
00470 75, 81, 88, 82, 87, 96, 97, 98, 99, 105,
00471 83, 123, 110, 85, 100, 115, 97, 98, 99, 94,
00472 106, 92, 96, 117, 100, 120, 106, 132, 133, 131,
00473 128, 120, 105, 110, 127, 126, 115, 125, 124, 122,
00474 123, 121, 119, 116, 114, 113, 112, 111, 117, 109,
00475 108, 107, 104, 103, 102, 101, 132, 137, 137, 137,
00476
00477 138, 138, 93, 91, 90, 89, 86, 84, 69, 68,
00478 59, 58, 48, 40, 38, 37, 35, 33, 31, 30,
00479 16, 14, 11, 10, 9, 6, 5, 3, 135, 135,
00480 135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
00481 135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
00482 135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
00483 135, 135, 135, 135
00484 } ;
00485
00486 static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
00487 static char *yy_full_match;
00488 static int yy_lp;
00489 #define REJECT \
00490 { \
00491 *yy_cp = yy_hold_char; \
00492 yy_cp = yy_full_match; \
00493 ++yy_lp; \
00494 goto find_rule; \
00495 }
00496 static int yy_more_offset = 0;
00497 static int yy_prev_more_offset = 0;
00498 #define yymore() (yy_more_offset = yy_flex_strlen( yytext ))
00499 #define YY_NEED_STRLEN
00500 #define YY_MORE_ADJ 0
00501 #define YY_RESTORE_YY_MORE_OFFSET \
00502 { \
00503 yy_more_offset = yy_prev_more_offset; \
00504 yyleng -= yy_more_offset; \
00505 }
00506 #ifndef YYLMAX
00507 #define YYLMAX 8192
00508 #endif
00509
00510 char yytext[YYLMAX];
00511 char *yytext_ptr;
00512 #line 1 "sqlscanner.l"
00513 #define INITIAL 0
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533 #line 22 "sqlscanner.l"
00534 #include <field.h>
00535 #include <expression.h>
00536
00537 #include "sqlparser.h"
00538 #include "sqltypes.h"
00539 #include <iostream>
00540 #include <kdebug.h>
00541 #include <klocale.h>
00542
00543 #define YY_NO_UNPUT
00544 #define ECOUNT current += yyleng; ctoken = yytext
00545
00546 extern void setError(const QString& errDesc);
00547 extern void setError(const QString& errName, const QString& errDesc);
00548
00549
00550 #define YY_NEVER_INTERACTIVE 1
00551
00552
00553 #line 554 "sqlscanner.cpp"
00554
00555
00556
00557
00558
00559 #ifndef YY_SKIP_YYWRAP
00560 #ifdef __cplusplus
00561 extern "C" int yywrap YY_PROTO(( void ));
00562 #else
00563 extern int yywrap YY_PROTO(( void ));
00564 #endif
00565 #endif
00566
00567 #ifndef YY_NO_UNPUT
00568 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
00569 #endif
00570
00571 #ifndef yytext_ptr
00572 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
00573 #endif
00574
00575 #ifdef YY_NEED_STRLEN
00576 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
00577 #endif
00578
00579 #ifndef YY_NO_INPUT
00580 #ifdef __cplusplus
00581 static int yyinput YY_PROTO(( void ));
00582 #else
00583 static int input YY_PROTO(( void ));
00584 #endif
00585 #endif
00586
00587 #if YY_STACK_USED
00588 static int yy_start_stack_ptr = 0;
00589 static int yy_start_stack_depth = 0;
00590 static int *yy_start_stack = 0;
00591 #ifndef YY_NO_PUSH_STATE
00592 static void yy_push_state YY_PROTO(( int new_state ));
00593 #endif
00594 #ifndef YY_NO_POP_STATE
00595 static void yy_pop_state YY_PROTO(( void ));
00596 #endif
00597 #ifndef YY_NO_TOP_STATE
00598 static int yy_top_state YY_PROTO(( void ));
00599 #endif
00600
00601 #else
00602 #define YY_NO_PUSH_STATE 1
00603 #define YY_NO_POP_STATE 1
00604 #define YY_NO_TOP_STATE 1
00605 #endif
00606
00607 #ifdef YY_MALLOC_DECL
00608 YY_MALLOC_DECL
00609 #else
00610 #if __STDC__
00611 #ifndef __cplusplus
00612 #include <stdlib.h>
00613 #endif
00614 #else
00615
00616
00617
00618
00619 #endif
00620 #endif
00621
00622
00623 #ifndef YY_READ_BUF_SIZE
00624 #define YY_READ_BUF_SIZE 8192
00625 #endif
00626
00627
00628
00629 #ifndef ECHO
00630
00631
00632
00633 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
00634 #endif
00635
00636
00637
00638
00639 #ifndef YY_INPUT
00640 #define YY_INPUT(buf,result,max_size) \
00641 if ( yy_current_buffer->yy_is_interactive ) \
00642 { \
00643 int c = '*', n; \
00644 for ( n = 0; n < max_size && \
00645 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
00646 buf[n] = (char) c; \
00647 if ( c == '\n' ) \
00648 buf[n++] = (char) c; \
00649 if ( c == EOF && ferror( yyin ) ) \
00650 YY_FATAL_ERROR( "input in flex scanner failed" ); \
00651 result = n; \
00652 } \
00653 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
00654 && ferror( yyin ) ) \
00655 YY_FATAL_ERROR( "input in flex scanner failed" );
00656 #endif
00657
00658
00659
00660
00661
00662 #ifndef yyterminate
00663 #define yyterminate() return YY_NULL
00664 #endif
00665
00666
00667 #ifndef YY_START_STACK_INCR
00668 #define YY_START_STACK_INCR 25
00669 #endif
00670
00671
00672 #ifndef YY_FATAL_ERROR
00673 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
00674 #endif
00675
00676
00677
00678
00679 #ifndef YY_DECL
00680 #define YY_DECL int yylex YY_PROTO(( void ))
00681 #endif
00682
00683
00684
00685
00686 #ifndef YY_USER_ACTION
00687 #define YY_USER_ACTION
00688 #endif
00689
00690
00691 #ifndef YY_BREAK
00692 #define YY_BREAK break;
00693 #endif
00694
00695 #define YY_RULE_SETUP \
00696 YY_USER_ACTION
00697
00698 YY_DECL
00699 {
00700 register yy_state_type yy_current_state;
00701 register char *yy_cp, *yy_bp;
00702 register int yy_act;
00703
00704 #line 57 "sqlscanner.l"
00705
00706
00707
00708 #line 709 "sqlscanner.cpp"
00709
00710 if ( yy_init )
00711 {
00712 yy_init = 0;
00713
00714 #ifdef YY_USER_INIT
00715 YY_USER_INIT;
00716 #endif
00717
00718 if ( ! yy_start )
00719 yy_start = 1;
00720
00721 if ( ! yyin )
00722 yyin = stdin;
00723
00724 if ( ! yyout )
00725 yyout = stdout;
00726
00727 if ( ! yy_current_buffer )
00728 yy_current_buffer =
00729 yy_create_buffer( yyin, YY_BUF_SIZE );
00730
00731 yy_load_buffer_state();
00732 }
00733
00734 while ( 1 )
00735 {
00736 yy_cp = yy_c_buf_p;
00737
00738
00739 *yy_cp = yy_hold_char;
00740
00741
00742
00743
00744 yy_bp = yy_cp;
00745
00746 yy_current_state = yy_start;
00747 yy_state_ptr = yy_state_buf;
00748 *yy_state_ptr++ = yy_current_state;
00749 yy_match:
00750 do
00751 {
00752 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
00753 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
00754 {
00755 yy_current_state = (int) yy_def[yy_current_state];
00756 if ( yy_current_state >= 136 )
00757 yy_c = yy_meta[(unsigned int) yy_c];
00758 }
00759 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
00760 *yy_state_ptr++ = yy_current_state;
00761 ++yy_cp;
00762 }
00763 while ( yy_base[yy_current_state] != 229 );
00764
00765 yy_find_action:
00766 yy_current_state = *--yy_state_ptr;
00767 yy_lp = yy_accept[yy_current_state];
00768 find_rule:
00769 for ( ; ; )
00770 {
00771 if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
00772 {
00773 yy_act = yy_acclist[yy_lp];
00774 {
00775 yy_full_match = yy_cp;
00776 break;
00777 }
00778 }
00779 --yy_cp;
00780 yy_current_state = *--yy_state_ptr;
00781 yy_lp = yy_accept[yy_current_state];
00782 }
00783
00784 YY_DO_BEFORE_ACTION;
00785
00786 if ( yy_act != YY_END_OF_BUFFER )
00787 {
00788 int yyl;
00789 for ( yyl = 0; yyl < yyleng; ++yyl )
00790 if ( yytext[yyl] == '\n' )
00791 ++yylineno;
00792 }
00793
00794 do_action:
00795
00796
00797 switch ( yy_act )
00798 {
00799 case 1:
00800 YY_RULE_SETUP
00801 #line 60 "sqlscanner.l"
00802 {
00803 ECOUNT;
00804 return NOT_EQUAL;
00805 }
00806 YY_BREAK
00807 case 2:
00808 YY_RULE_SETUP
00809 #line 65 "sqlscanner.l"
00810 {
00811 ECOUNT;
00812 return NOT_EQUAL2;
00813 }
00814 YY_BREAK
00815 case 3:
00816 YY_RULE_SETUP
00817 #line 70 "sqlscanner.l"
00818 {
00819 ECOUNT;
00820 return '=';
00821 }
00822 YY_BREAK
00823 case 4:
00824 YY_RULE_SETUP
00825 #line 75 "sqlscanner.l"
00826 {
00827 ECOUNT;
00828 return LESS_OR_EQUAL;
00829 }
00830 YY_BREAK
00831 case 5:
00832 YY_RULE_SETUP
00833 #line 80 "sqlscanner.l"
00834 {
00835 ECOUNT;
00836 return GREATER_OR_EQUAL;
00837 }
00838 YY_BREAK
00839 case 6:
00840 YY_RULE_SETUP
00841 #line 85 "sqlscanner.l"
00842 {
00843 ECOUNT;
00844 return SQL_IN;
00845 }
00846 YY_BREAK
00847 case 7:
00848 YY_RULE_SETUP
00849 #line 90 "sqlscanner.l"
00850 {
00851
00852
00853 ECOUNT;
00854 bool ok;
00855 yylval.integerValue = QString(yytext).toLongLong( &ok );
00856 if (!ok) {
00857 setError(i18n("Invalid integer number"),i18n("This integer number may be too large."));
00858 return SCAN_ERROR;
00859 }
00860
00861 return INTEGER_CONST;
00862 }
00863 YY_BREAK
00864 case 8:
00865 YY_RULE_SETUP
00866 #line 104 "sqlscanner.l"
00867 {
00868 char *p = yytext;
00869 if (yytext[0]=='.') {
00870 yylval.realValue.integer = 0;
00871 }
00872 else {
00873 yylval.realValue.integer = atoi(p);
00874 int i=0;
00875 while (p && i < yyleng && *p != '.') {
00876 i++;
00877 p++;
00878 }
00879 if (i==0 || !p || *p!='.') {
00880 yylval.realValue.fractional = 0;
00881 return REAL_CONST;
00882 }
00883 }
00884
00885 p++;
00886 yylval.realValue.fractional = atoi(p);
00887 return REAL_CONST;
00888 }
00889 YY_BREAK
00890 case 9:
00891 YY_RULE_SETUP
00892 #line 127 "sqlscanner.l"
00893 {
00894 ECOUNT;
00895 return AND;
00896 }
00897 YY_BREAK
00898 case 10:
00899 YY_RULE_SETUP
00900 #line 132 "sqlscanner.l"
00901 {
00902 ECOUNT;
00903 return AS;
00904 }
00905 YY_BREAK
00906 case 11:
00907 YY_RULE_SETUP
00908 #line 137 "sqlscanner.l"
00909 {
00910 ECOUNT;
00911 return CREATE;
00912 }
00913 YY_BREAK
00914 case 12:
00915 YY_RULE_SETUP
00916 #line 142 "sqlscanner.l"
00917 {
00918 ECOUNT;
00919 return FROM;
00920 }
00921 YY_BREAK
00922 case 13:
00923 YY_RULE_SETUP
00924 #line 147 "sqlscanner.l"
00925 {
00926 ECOUNT;
00927 return SQL_TYPE;
00928 }
00929 YY_BREAK
00930 case 14:
00931 YY_RULE_SETUP
00932 #line 152 "sqlscanner.l"
00933 {
00934 ECOUNT;
00935 return JOIN;
00936 }
00937 YY_BREAK
00938 case 15:
00939 YY_RULE_SETUP
00940 #line 157 "sqlscanner.l"
00941 {
00942 ECOUNT;
00943 return LEFT;
00944 }
00945 YY_BREAK
00946 case 16:
00947 YY_RULE_SETUP
00948 #line 162 "sqlscanner.l"
00949 {
00950 ECOUNT;
00951 return LIKE;
00952 }
00953 YY_BREAK
00954 case 17:
00955 YY_RULE_SETUP
00956 #line 167 "sqlscanner.l"
00957 {
00958 ECOUNT;
00959 return NOT_SIMILAR_TO;
00960 }
00961 YY_BREAK
00962 case 18:
00963 YY_RULE_SETUP
00964 #line 172 "sqlscanner.l"
00965 {
00966 ECOUNT;
00967 return SIMILAR_TO;
00968 }
00969 YY_BREAK
00970 case 19:
00971 YY_RULE_SETUP
00972 #line 177 "sqlscanner.l"
00973 {
00974 ECOUNT;
00975 return SQL_IS_NOT_NULL;
00976 }
00977 YY_BREAK
00978 case 20:
00979 YY_RULE_SETUP
00980 #line 182 "sqlscanner.l"
00981 {
00982 ECOUNT;
00983 return SQL_IS_NULL;
00984 }
00985 YY_BREAK
00986 case 21:
00987 YY_RULE_SETUP
00988 #line 187 "sqlscanner.l"
00989 {
00990 ECOUNT;
00991 return NOT;
00992 }
00993 YY_BREAK
00994 case 22:
00995 YY_RULE_SETUP
00996 #line 192 "sqlscanner.l"
00997 {
00998 ECOUNT;
00999 return SQL_IS;
01000 }
01001 YY_BREAK
01002 case 23:
01003 YY_RULE_SETUP
01004 #line 197 "sqlscanner.l"
01005 {
01006 ECOUNT;
01007 return SQL_NULL;
01008 }
01009 YY_BREAK
01010 case 24:
01011 YY_RULE_SETUP
01012 #line 202 "sqlscanner.l"
01013 {
01014 ECOUNT;
01015 return SQL_ON;
01016 }
01017 YY_BREAK
01018 case 25:
01019 YY_RULE_SETUP
01020 #line 207 "sqlscanner.l"
01021 {
01022 ECOUNT;
01023 return OR;
01024 }
01025 YY_BREAK
01026 case 26:
01027 YY_RULE_SETUP
01028 #line 212 "sqlscanner.l"
01029 {
01030 ECOUNT;
01031 return CONCATENATION;
01032 }
01033 YY_BREAK
01034 case 27:
01035 YY_RULE_SETUP
01036 #line 217 "sqlscanner.l"
01037 {
01038 ECOUNT;
01039 return BITWISE_SHIFT_LEFT;
01040 }
01041 YY_BREAK
01042 case 28:
01043 YY_RULE_SETUP
01044 #line 222 "sqlscanner.l"
01045 {
01046 ECOUNT;
01047 return BITWISE_SHIFT_RIGHT;
01048 }
01049 YY_BREAK
01050 case 29:
01051 YY_RULE_SETUP
01052 #line 227 "sqlscanner.l"
01053 {
01054 ECOUNT;
01055 return XOR;
01056 }
01057 YY_BREAK
01058 case 30:
01059 YY_RULE_SETUP
01060 #line 232 "sqlscanner.l"
01061 {
01062 ECOUNT;
01063 return RIGHT;
01064 }
01065 YY_BREAK
01066 case 31:
01067 YY_RULE_SETUP
01068 #line 237 "sqlscanner.l"
01069 {
01070 ECOUNT;
01071 return SELECT;
01072 }
01073 YY_BREAK
01074 case 32:
01075 YY_RULE_SETUP
01076 #line 242 "sqlscanner.l"
01077 {
01078 ECOUNT;
01079 return TABLE;
01080 }
01081 YY_BREAK
01082 case 33:
01083 YY_RULE_SETUP
01084 #line 247 "sqlscanner.l"
01085 {
01086 ECOUNT;
01087 return WHERE;
01088 }
01089 YY_BREAK
01090 case 34:
01091 YY_RULE_SETUP
01092 #line 253 "sqlscanner.l"
01093 {
01094 ECOUNT;
01095 strncpy(yylval.stringValue, yytext, yyleng + 1);
01096 return CHARACTER_STRING_LITERAL;
01097
01098
01099 }
01100 YY_BREAK
01101 case 35:
01102 YY_RULE_SETUP
01103 #line 261 "sqlscanner.l"
01104 {
01105 kdDebug() << "yytext: '" << yytext << "' (" << yyleng << ")" << endl;
01106 ECOUNT;
01107 strncpy(yylval.stringValue, yytext, yyleng + 1);
01108 if (yytext[0]>='0' && yytext[0]<='9') {
01109 setError(i18n("Invalid identifier"),
01110 i18n("Identifiers should start with a letter or '_' character"));
01111 return SCAN_ERROR;
01112
01113 }
01114 return IDENTIFIER;
01115 }
01116 YY_BREAK
01117 case 36:
01118 YY_RULE_SETUP
01119 #line 274 "sqlscanner.l"
01120 {
01121 kdDebug() << "yytext: '" << yytext << "' (" << yyleng << ")" << endl;
01122 ECOUNT;
01123 strncpy(yylval.stringValue, yytext + 1, yyleng - 1);
01124 yylval.stringValue[yyleng - 2] = 0x00;
01125 if (yytext[1]>='0' && yytext[1]<='9') {
01126 setError(i18n("Invalid identifier"),
01127 i18n("Identifiers should start with a letter or '_' character"));
01128 return SCAN_ERROR;
01129
01130 }
01131 return IDENTIFIER;
01132 }
01133 YY_BREAK
01134 case 37:
01135 YY_RULE_SETUP
01136 #line 288 "sqlscanner.l"
01137 {
01138 ECOUNT;
01139 }
01140 YY_BREAK
01141 case 38:
01142 YY_RULE_SETUP
01143 #line 292 "sqlscanner.l"
01144 {
01145 kdDebug() << "char: '" << yytext[0] << "'" << endl;
01146 ECOUNT;
01147 return yytext[0];
01148 }
01149 YY_BREAK
01150 case 39:
01151 YY_RULE_SETUP
01152 #line 298 "sqlscanner.l"
01153 ECHO;
01154 YY_BREAK
01155 #line 1156 "sqlscanner.cpp"
01156 case YY_STATE_EOF(INITIAL):
01157 yyterminate();
01158
01159 case YY_END_OF_BUFFER:
01160 {
01161
01162 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
01163
01164
01165 *yy_cp = yy_hold_char;
01166 YY_RESTORE_YY_MORE_OFFSET
01167
01168 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
01169 {
01170
01171
01172
01173
01174
01175
01176
01177
01178
01179 yy_n_chars = yy_current_buffer->yy_n_chars;
01180 yy_current_buffer->yy_input_file = yyin;
01181 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
01182 }
01183
01184
01185
01186
01187
01188
01189
01190
01191 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
01192 {
01193 yy_state_type yy_next_state;
01194
01195 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
01196
01197 yy_current_state = yy_get_previous_state();
01198
01199
01200
01201
01202
01203
01204
01205
01206
01207
01208 yy_next_state = yy_try_NUL_trans( yy_current_state );
01209
01210 yy_bp = yytext_ptr + YY_MORE_ADJ;
01211
01212 if ( yy_next_state )
01213 {
01214
01215 yy_cp = ++yy_c_buf_p;
01216 yy_current_state = yy_next_state;
01217 goto yy_match;
01218 }
01219
01220 else
01221 {
01222 yy_cp = yy_c_buf_p;
01223 goto yy_find_action;
01224 }
01225 }
01226
01227 else switch ( yy_get_next_buffer() )
01228 {
01229 case EOB_ACT_END_OF_FILE:
01230 {
01231 yy_did_buffer_switch_on_eof = 0;
01232
01233 if ( yywrap() )
01234 {
01235
01236
01237
01238
01239
01240
01241
01242
01243
01244 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
01245
01246 yy_act = YY_STATE_EOF(YY_START);
01247 goto do_action;
01248 }
01249
01250 else
01251 {
01252 if ( ! yy_did_buffer_switch_on_eof )
01253 YY_NEW_FILE;
01254 }
01255 break;
01256 }
01257
01258 case EOB_ACT_CONTINUE_SCAN:
01259 yy_c_buf_p =
01260 yytext_ptr + yy_amount_of_matched_text;
01261
01262 yy_current_state = yy_get_previous_state();
01263
01264 yy_cp = yy_c_buf_p;
01265 yy_bp = yytext_ptr + YY_MORE_ADJ;
01266 goto yy_match;
01267
01268 case EOB_ACT_LAST_MATCH:
01269 yy_c_buf_p =
01270 &yy_current_buffer->yy_ch_buf[yy_n_chars];
01271
01272 yy_current_state = yy_get_previous_state();
01273
01274 yy_cp = yy_c_buf_p;
01275 yy_bp = yytext_ptr + YY_MORE_ADJ;
01276 goto yy_find_action;
01277 }
01278 break;
01279 }
01280
01281 default:
01282 YY_FATAL_ERROR(
01283 "fatal flex scanner internal error--no action found" );
01284 }
01285 }
01286 }
01287
01288
01289
01290
01291
01292
01293
01294
01295
01296
01297 static int yy_get_next_buffer()
01298 {
01299 register char *dest = yy_current_buffer->yy_ch_buf;
01300 register char *source = yytext_ptr;
01301 register int number_to_move, i;
01302 int ret_val;
01303
01304 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
01305 YY_FATAL_ERROR(
01306 "fatal flex scanner internal error--end of buffer missed" );
01307
01308 if ( yy_current_buffer->yy_fill_buffer == 0 )
01309 {
01310 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
01311 {
01312
01313
01314
01315 return EOB_ACT_END_OF_FILE;
01316 }
01317
01318 else
01319 {
01320
01321
01322
01323 return EOB_ACT_LAST_MATCH;
01324 }
01325 }
01326
01327
01328
01329
01330 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
01331
01332 for ( i = 0; i < number_to_move; ++i )
01333 *(dest++) = *(source++);
01334
01335 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
01336
01337
01338
01339 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
01340
01341 else
01342 {
01343 int num_to_read =
01344 yy_current_buffer->yy_buf_size - number_to_move - 1;
01345
01346 while ( num_to_read <= 0 )
01347 {
01348 #ifdef YY_USES_REJECT
01349 YY_FATAL_ERROR(
01350 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
01351 #else
01352
01353
01354 YY_BUFFER_STATE b = yy_current_buffer;
01355
01356 int yy_c_buf_p_offset =
01357 (int) (yy_c_buf_p - b->yy_ch_buf);
01358
01359 if ( b->yy_is_our_buffer )
01360 {
01361 int new_size = b->yy_buf_size * 2;
01362
01363 if ( new_size <= 0 )
01364 b->yy_buf_size += b->yy_buf_size / 8;
01365 else
01366 b->yy_buf_size *= 2;
01367
01368 b->yy_ch_buf = (char *)
01369
01370 yy_flex_realloc( (void *) b->yy_ch_buf,
01371 b->yy_buf_size + 2 );
01372 }
01373 else
01374
01375 b->yy_ch_buf = 0;
01376
01377 if ( ! b->yy_ch_buf )
01378 YY_FATAL_ERROR(
01379 "fatal error - scanner input buffer overflow" );
01380
01381 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
01382
01383 num_to_read = yy_current_buffer->yy_buf_size -
01384 number_to_move - 1;
01385 #endif
01386 }
01387
01388 if ( num_to_read > YY_READ_BUF_SIZE )
01389 num_to_read = YY_READ_BUF_SIZE;
01390
01391
01392 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
01393 yy_n_chars, num_to_read );
01394
01395 yy_current_buffer->yy_n_chars = yy_n_chars;
01396 }
01397
01398 if ( yy_n_chars == 0 )
01399 {
01400 if ( number_to_move == YY_MORE_ADJ )
01401 {
01402 ret_val = EOB_ACT_END_OF_FILE;
01403 yyrestart( yyin );
01404 }
01405
01406 else
01407 {
01408 ret_val = EOB_ACT_LAST_MATCH;
01409 yy_current_buffer->yy_buffer_status =
01410 YY_BUFFER_EOF_PENDING;
01411 }
01412 }
01413
01414 else
01415 ret_val = EOB_ACT_CONTINUE_SCAN;
01416
01417 yy_n_chars += number_to_move;
01418 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
01419 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
01420
01421 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
01422
01423 return ret_val;
01424 }
01425
01426
01427
01428
01429 static yy_state_type yy_get_previous_state()
01430 {
01431 register yy_state_type yy_current_state;
01432 register char *yy_cp;
01433
01434 yy_current_state = yy_start;
01435 yy_state_ptr = yy_state_buf;
01436 *yy_state_ptr++ = yy_current_state;
01437
01438 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
01439 {
01440 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
01441 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01442 {
01443 yy_current_state = (int) yy_def[yy_current_state];
01444 if ( yy_current_state >= 136 )
01445 yy_c = yy_meta[(unsigned int) yy_c];
01446 }
01447 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01448 *yy_state_ptr++ = yy_current_state;
01449 }
01450
01451 return yy_current_state;
01452 }
01453
01454
01455
01456
01457
01458
01459
01460
01461 #ifdef YY_USE_PROTOS
01462 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
01463 #else
01464 static yy_state_type yy_try_NUL_trans( yy_current_state )
01465 yy_state_type yy_current_state;
01466 #endif
01467 {
01468 register int yy_is_jam;
01469
01470 register YY_CHAR yy_c = 1;
01471 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01472 {
01473 yy_current_state = (int) yy_def[yy_current_state];
01474 if ( yy_current_state >= 136 )
01475 yy_c = yy_meta[(unsigned int) yy_c];
01476 }
01477 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01478 yy_is_jam = (yy_current_state == 135);
01479 if ( ! yy_is_jam )
01480 *yy_state_ptr++ = yy_current_state;
01481
01482 return yy_is_jam ? 0 : yy_current_state;
01483 }
01484
01485
01486 #ifndef YY_NO_UNPUT
01487 #ifdef YY_USE_PROTOS
01488 static void yyunput( int c, register char *yy_bp )
01489 #else
01490 static void yyunput( c, yy_bp )
01491 int c;
01492 register char *yy_bp;
01493 #endif
01494 {
01495 register char *yy_cp = yy_c_buf_p;
01496
01497
01498 *yy_cp = yy_hold_char;
01499
01500 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
01501 {
01502
01503 register int number_to_move = yy_n_chars + 2;
01504 register char *dest = &yy_current_buffer->yy_ch_buf[
01505 yy_current_buffer->yy_buf_size + 2];
01506 register char *source =
01507 &yy_current_buffer->yy_ch_buf[number_to_move];
01508
01509 while ( source > yy_current_buffer->yy_ch_buf )
01510 *--dest = *--source;
01511
01512 yy_cp += (int) (dest - source);
01513 yy_bp += (int) (dest - source);
01514 yy_current_buffer->yy_n_chars =
01515 yy_n_chars = yy_current_buffer->yy_buf_size;
01516
01517 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
01518 YY_FATAL_ERROR( "flex scanner push-back overflow" );
01519 }
01520
01521 *--yy_cp = (char) c;
01522
01523 if ( c == '\n' )
01524 --yylineno;
01525
01526 yytext_ptr = yy_bp;
01527 yy_hold_char = *yy_cp;
01528 yy_c_buf_p = yy_cp;
01529 }
01530 #endif
01531
01532
01533 #ifdef __cplusplus
01534 static int yyinput()
01535 #else
01536 static int input()
01537 #endif
01538 {
01539 int c;
01540
01541 *yy_c_buf_p = yy_hold_char;
01542
01543 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
01544 {
01545
01546
01547
01548
01549 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
01550
01551 *yy_c_buf_p = '\0';
01552
01553 else
01554 {
01555 int offset = yy_c_buf_p - yytext_ptr;
01556 ++yy_c_buf_p;
01557
01558 switch ( yy_get_next_buffer() )
01559 {
01560 case EOB_ACT_LAST_MATCH:
01561
01562
01563
01564
01565
01566
01567
01568
01569
01570
01571
01572 yyrestart( yyin );
01573
01574
01575
01576 case EOB_ACT_END_OF_FILE:
01577 {
01578 if ( yywrap() )
01579 return EOF;
01580
01581 if ( ! yy_did_buffer_switch_on_eof )
01582 YY_NEW_FILE;
01583 #ifdef __cplusplus
01584 return yyinput();
01585 #else
01586 return input();
01587 #endif
01588 }
01589
01590 case EOB_ACT_CONTINUE_SCAN:
01591 yy_c_buf_p = yytext_ptr + offset;
01592 break;
01593 }
01594 }
01595 }
01596
01597 c = *(unsigned char *) yy_c_buf_p;
01598 *yy_c_buf_p = '\0';
01599 yy_hold_char = *++yy_c_buf_p;
01600
01601 if ( c == '\n' )
01602 ++yylineno;
01603
01604 return c;
01605 }
01606
01607
01608 #ifdef YY_USE_PROTOS
01609 void yyrestart( FILE *input_file )
01610 #else
01611 void yyrestart( input_file )
01612 FILE *input_file;
01613 #endif
01614 {
01615 if ( ! yy_current_buffer )
01616 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
01617
01618 yy_init_buffer( yy_current_buffer, input_file );
01619 yy_load_buffer_state();
01620 }
01621
01622
01623 #ifdef YY_USE_PROTOS
01624 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
01625 #else
01626 void yy_switch_to_buffer( new_buffer )
01627 YY_BUFFER_STATE new_buffer;
01628 #endif
01629 {
01630 if ( yy_current_buffer == new_buffer )
01631 return;
01632
01633 if ( yy_current_buffer )
01634 {
01635
01636 *yy_c_buf_p = yy_hold_char;
01637 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
01638 yy_current_buffer->yy_n_chars = yy_n_chars;
01639 }
01640
01641 yy_current_buffer = new_buffer;
01642 yy_load_buffer_state();
01643
01644
01645
01646
01647
01648
01649 yy_did_buffer_switch_on_eof = 1;
01650 }
01651
01652
01653 #ifdef YY_USE_PROTOS
01654 void yy_load_buffer_state( void )
01655 #else
01656 void yy_load_buffer_state()
01657 #endif
01658 {
01659 yy_n_chars = yy_current_buffer->yy_n_chars;
01660 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
01661 yyin = yy_current_buffer->yy_input_file;
01662 yy_hold_char = *yy_c_buf_p;
01663 }
01664
01665
01666 #ifdef YY_USE_PROTOS
01667 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
01668 #else
01669 YY_BUFFER_STATE yy_create_buffer( file, size )
01670 FILE *file;
01671 int size;
01672 #endif
01673 {
01674 YY_BUFFER_STATE b;
01675
01676 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
01677 if ( ! b )
01678 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
01679
01680 b->yy_buf_size = size;
01681
01682
01683
01684
01685 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
01686 if ( ! b->yy_ch_buf )
01687 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
01688
01689 b->yy_is_our_buffer = 1;
01690
01691 yy_init_buffer( b, file );
01692
01693 return b;
01694 }
01695
01696
01697 #ifdef YY_USE_PROTOS
01698 void yy_delete_buffer( YY_BUFFER_STATE b )
01699 #else
01700 void yy_delete_buffer( b )
01701 YY_BUFFER_STATE b;
01702 #endif
01703 {
01704 if ( ! b )
01705 return;
01706
01707 if ( b == yy_current_buffer )
01708 yy_current_buffer = (YY_BUFFER_STATE) 0;
01709
01710 if ( b->yy_is_our_buffer )
01711 yy_flex_free( (void *) b->yy_ch_buf );
01712
01713 yy_flex_free( (void *) b );
01714 }
01715
01716
01717 #ifndef YY_ALWAYS_INTERACTIVE
01718 #ifndef YY_NEVER_INTERACTIVE
01719 extern int isatty YY_PROTO(( int ));
01720 #endif
01721 #endif
01722
01723 #ifdef YY_USE_PROTOS
01724 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
01725 #else
01726 void yy_init_buffer( b, file )
01727 YY_BUFFER_STATE b;
01728 FILE *file;
01729 #endif
01730
01731
01732 {
01733 yy_flush_buffer( b );
01734
01735 b->yy_input_file = file;
01736 b->yy_fill_buffer = 1;
01737
01738 #if YY_ALWAYS_INTERACTIVE
01739 b->yy_is_interactive = 1;
01740 #else
01741 #if YY_NEVER_INTERACTIVE
01742 b->yy_is_interactive = 0;
01743 #else
01744 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
01745 #endif
01746 #endif
01747 }
01748
01749
01750 #ifdef YY_USE_PROTOS
01751 void yy_flush_buffer( YY_BUFFER_STATE b )
01752 #else
01753 void yy_flush_buffer( b )
01754 YY_BUFFER_STATE b;
01755 #endif
01756
01757 {
01758 if ( ! b )
01759 return;
01760
01761 b->yy_n_chars = 0;
01762
01763
01764
01765
01766
01767 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
01768 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
01769
01770 b->yy_buf_pos = &b->yy_ch_buf[0];
01771
01772 b->yy_at_bol = 1;
01773 b->yy_buffer_status = YY_BUFFER_NEW;
01774
01775 if ( b == yy_current_buffer )
01776 yy_load_buffer_state();
01777 }
01778
01779
01780 #ifndef YY_NO_SCAN_BUFFER
01781 #ifdef YY_USE_PROTOS
01782 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
01783 #else
01784 YY_BUFFER_STATE yy_scan_buffer( base, size )
01785 char *base;
01786 yy_size_t size;
01787 #endif
01788 {
01789 YY_BUFFER_STATE b;
01790
01791 if ( size < 2 ||
01792 base[size-2] != YY_END_OF_BUFFER_CHAR ||
01793 base[size-1] != YY_END_OF_BUFFER_CHAR )
01794
01795 return 0;
01796
01797 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
01798 if ( ! b )
01799 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
01800
01801 b->yy_buf_size = size - 2;
01802 b->yy_buf_pos = b->yy_ch_buf = base;
01803 b->yy_is_our_buffer = 0;
01804 b->yy_input_file = 0;
01805 b->yy_n_chars = b->yy_buf_size;
01806 b->yy_is_interactive = 0;
01807 b->yy_at_bol = 1;
01808 b->yy_fill_buffer = 0;
01809 b->yy_buffer_status = YY_BUFFER_NEW;
01810
01811 yy_switch_to_buffer( b );
01812
01813 return b;
01814 }
01815 #endif
01816
01817
01818 #ifndef YY_NO_SCAN_STRING
01819 #ifdef YY_USE_PROTOS
01820 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
01821 #else
01822 YY_BUFFER_STATE yy_scan_string( yy_str )
01823 yyconst char *yy_str;
01824 #endif
01825 {
01826 int len;
01827 for ( len = 0; yy_str[len]; ++len )
01828 ;
01829
01830 return yy_scan_bytes( yy_str, len );
01831 }
01832 #endif
01833
01834
01835 #ifndef YY_NO_SCAN_BYTES
01836 #ifdef YY_USE_PROTOS
01837 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
01838 #else
01839 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
01840 yyconst char *bytes;
01841 int len;
01842 #endif
01843 {
01844 YY_BUFFER_STATE b;
01845 char *buf;
01846 yy_size_t n;
01847 int i;
01848
01849
01850 n = len + 2;
01851 buf = (char *) yy_flex_alloc( n );
01852 if ( ! buf )
01853 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
01854
01855 for ( i = 0; i < len; ++i )
01856 buf[i] = bytes[i];
01857
01858 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
01859
01860 b = yy_scan_buffer( buf, n );
01861 if ( ! b )
01862 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
01863
01864
01865
01866
01867 b->yy_is_our_buffer = 1;
01868
01869 return b;
01870 }
01871 #endif
01872
01873
01874 #ifndef YY_NO_PUSH_STATE
01875 #ifdef YY_USE_PROTOS
01876 static void yy_push_state( int new_state )
01877 #else
01878 static void yy_push_state( new_state )
01879 int new_state;
01880 #endif
01881 {
01882 if ( yy_start_stack_ptr >= yy_start_stack_depth )
01883 {
01884 yy_size_t new_size;
01885
01886 yy_start_stack_depth += YY_START_STACK_INCR;
01887 new_size = yy_start_stack_depth * sizeof( int );
01888
01889 if ( ! yy_start_stack )
01890 yy_start_stack = (int *) yy_flex_alloc( new_size );
01891
01892 else
01893 yy_start_stack = (int *) yy_flex_realloc(
01894 (void *) yy_start_stack, new_size );
01895
01896 if ( ! yy_start_stack )
01897 YY_FATAL_ERROR(
01898 "out of memory expanding start-condition stack" );
01899 }
01900
01901 yy_start_stack[yy_start_stack_ptr++] = YY_START;
01902
01903 BEGIN(new_state);
01904 }
01905 #endif
01906
01907
01908 #ifndef YY_NO_POP_STATE
01909 static void yy_pop_state()
01910 {
01911 if ( --yy_start_stack_ptr < 0 )
01912 YY_FATAL_ERROR( "start-condition stack underflow" );
01913
01914 BEGIN(yy_start_stack[yy_start_stack_ptr]);
01915 }
01916 #endif
01917
01918
01919 #ifndef YY_NO_TOP_STATE
01920 static int yy_top_state()
01921 {
01922 return yy_start_stack[yy_start_stack_ptr - 1];
01923 }
01924 #endif
01925
01926 #ifndef YY_EXIT_FAILURE
01927 #define YY_EXIT_FAILURE 2
01928 #endif
01929
01930 #ifdef YY_USE_PROTOS
01931 static void yy_fatal_error( yyconst char msg[] )
01932 #else
01933 static void yy_fatal_error( msg )
01934 char msg[];
01935 #endif
01936 {
01937 (void) fprintf( stderr, "%s\n", msg );
01938 exit( YY_EXIT_FAILURE );
01939 }
01940
01941
01942
01943
01944
01945 #undef yyless
01946 #define yyless(n) \
01947 do \
01948 { \
01949 \
01950 yytext[yyleng] = yy_hold_char; \
01951 yy_c_buf_p = yytext + n; \
01952 yy_hold_char = *yy_c_buf_p; \
01953 *yy_c_buf_p = '\0'; \
01954 yyleng = n; \
01955 } \
01956 while ( 0 )
01957
01958
01959
01960
01961 #ifndef yytext_ptr
01962 #ifdef YY_USE_PROTOS
01963 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
01964 #else
01965 static void yy_flex_strncpy( s1, s2, n )
01966 char *s1;
01967 yyconst char *s2;
01968 int n;
01969 #endif
01970 {
01971 register int i;
01972 for ( i = 0; i < n; ++i )
01973 s1[i] = s2[i];
01974 }
01975 #endif
01976
01977 #ifdef YY_NEED_STRLEN
01978 #ifdef YY_USE_PROTOS
01979 static int yy_flex_strlen( yyconst char *s )
01980 #else
01981 static int yy_flex_strlen( s )
01982 yyconst char *s;
01983 #endif
01984 {
01985 register int n;
01986 for ( n = 0; s[n]; ++n )
01987 ;
01988
01989 return n;
01990 }
01991 #endif
01992
01993
01994 #ifdef YY_USE_PROTOS
01995 static void *yy_flex_alloc( yy_size_t size )
01996 #else
01997 static void *yy_flex_alloc( size )
01998 yy_size_t size;
01999 #endif
02000 {
02001 return (void *) malloc( size );
02002 }
02003
02004 #ifdef YY_USE_PROTOS
02005 static void *yy_flex_realloc( void *ptr, yy_size_t size )
02006 #else
02007 static void *yy_flex_realloc( ptr, size )
02008 void *ptr;
02009 yy_size_t size;
02010 #endif
02011 {
02012
02013
02014
02015
02016
02017
02018
02019 return (void *) realloc( (char *) ptr, size );
02020 }
02021
02022 #ifdef YY_USE_PROTOS
02023 static void yy_flex_free( void *ptr )
02024 #else
02025 static void yy_flex_free( ptr )
02026 void *ptr;
02027 #endif
02028 {
02029 free( ptr );
02030 }
02031
02032 #if YY_MAIN
02033 int main()
02034 {
02035 yylex();
02036 return 0;
02037 }
02038 #endif
02039 #line 298 "sqlscanner.l"
02040
02041
02042 void tokenize(const char *data)
02043 {
02044 yy_switch_to_buffer(yy_scan_string(data));
02045 ctoken = "";
02046 current = 0;
02047 }
02048