BadgerDB
|
00001 /* A lexical scanner generated by flex*/ 00002 00003 /* Scanner skeleton version: 00004 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ 00005 */ 00006 00007 #define FLEX_SCANNER 00008 #define YY_FLEX_MAJOR_VERSION 2 00009 #define YY_FLEX_MINOR_VERSION 5 00010 00011 #include <stdio.h> 00012 #include <unistd.h> 00013 00014 00015 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ 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 00027 /* Use prototypes in function declarations. */ 00028 #define YY_USE_PROTOS 00029 00030 /* The "const" storage-class-modifier is valid. */ 00031 #define YY_USE_CONST 00032 00033 #else /* ! __cplusplus */ 00034 00035 #if __STDC__ 00036 00037 #define YY_USE_PROTOS 00038 #define YY_USE_CONST 00039 00040 #endif /* __STDC__ */ 00041 #endif /* ! __cplusplus */ 00042 00043 #ifdef __TURBOC__ 00044 #pragma warn -rch 00045 #pragma warn -use 00046 #include <io.h> 00047 #include <stdlib.h> 00048 #define YY_USE_CONST 00049 #define YY_USE_PROTOS 00050 #endif 00051 00052 #ifdef YY_USE_CONST 00053 #define yyconst const 00054 #else 00055 #define yyconst 00056 #endif 00057 00058 00059 #ifdef YY_USE_PROTOS 00060 #define YY_PROTO(proto) proto 00061 #else 00062 #define YY_PROTO(proto) () 00063 #endif 00064 00065 /* Returned upon end-of-file. */ 00066 #define YY_NULL 0 00067 00068 /* Promotes a possibly negative, possibly signed char to an unsigned 00069 * integer for use as an array index. If the signed char is negative, 00070 * we want to instead treat it as an 8-bit unsigned char, hence the 00071 * double cast. 00072 */ 00073 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) 00074 00075 /* Enter a start condition. This macro really ought to take a parameter, 00076 * but we do it the disgusting crufty way forced on us by the ()-less 00077 * definition of BEGIN. 00078 */ 00079 #define BEGIN yy_start = 1 + 2 * 00080 00081 /* Translate the current start state into a value that can be later handed 00082 * to BEGIN to return to the state. The YYSTATE alias is for lex 00083 * compatibility. 00084 */ 00085 #define YY_START ((yy_start - 1) / 2) 00086 #define YYSTATE YY_START 00087 00088 /* Action number for EOF rule of a given start state. */ 00089 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 00090 00091 /* Special action meaning "start processing a new file". */ 00092 #define YY_NEW_FILE yyrestart( yyin ) 00093 00094 #define YY_END_OF_BUFFER_CHAR 0 00095 00096 /* Size of default input buffer. */ 00097 #define YY_BUF_SIZE 16384 00098 00099 typedef struct yy_buffer_state *YY_BUFFER_STATE; 00100 00101 extern int yyleng; 00102 extern FILE *yyin, *yyout; 00103 00104 #define EOB_ACT_CONTINUE_SCAN 0 00105 #define EOB_ACT_END_OF_FILE 1 00106 #define EOB_ACT_LAST_MATCH 2 00107 00108 /* The funky do-while in the following #define is used to turn the definition 00109 * int a single C statement (which needs a semi-colon terminator). This 00110 * avoids problems with code like: 00111 * 00112 * if ( condition_holds ) 00113 * yyless( 5 ); 00114 * else 00115 * do_something_else(); 00116 * 00117 * Prior to using the do-while the compiler would get upset at the 00118 * "else" because it interpreted the "if" statement as being all 00119 * done when it reached the ';' after the yyless() call. 00120 */ 00121 00122 /* Return all but the first 'n' matched characters back to the input stream. */ 00123 00124 #define yyless(n) \ 00125 do \ 00126 { \ 00127 /* Undo effects of setting up yytext. */ \ 00128 *yy_cp = yy_hold_char; \ 00129 YY_RESTORE_YY_MORE_OFFSET \ 00130 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ 00131 YY_DO_BEFORE_ACTION; /* set up yytext again */ \ 00132 } \ 00133 while ( 0 ) 00134 00135 #define unput(c) yyunput( c, yytext_ptr ) 00136 00137 /* Some routines like yy_flex_realloc() are emitted as static but are 00138 not called by all lexers. This generates warnings in some compilers, 00139 notably GCC. Arrange to suppress these. */ 00140 #ifdef __GNUC__ 00141 #define YY_MAY_BE_UNUSED __attribute__((unused)) 00142 #else 00143 #define YY_MAY_BE_UNUSED 00144 #endif 00145 00146 /* The following is because we cannot portably get our hands on size_t 00147 * (without autoconf's help, which isn't available because we want 00148 * flex-generated scanners to compile on their own). 00149 */ 00150 typedef unsigned int yy_size_t; 00151 00152 00153 struct yy_buffer_state 00154 { 00155 FILE *yy_input_file; 00156 00157 char *yy_ch_buf; /* input buffer */ 00158 char *yy_buf_pos; /* current position in input buffer */ 00159 00160 /* Size of input buffer in bytes, not including room for EOB 00161 * characters. 00162 */ 00163 yy_size_t yy_buf_size; 00164 00165 /* Number of characters read into yy_ch_buf, not including EOB 00166 * characters. 00167 */ 00168 int yy_n_chars; 00169 00170 /* Whether we "own" the buffer - i.e., we know we created it, 00171 * and can realloc() it to grow it, and should free() it to 00172 * delete it. 00173 */ 00174 int yy_is_our_buffer; 00175 00176 /* Whether this is an "interactive" input source; if so, and 00177 * if we're using stdio for input, then we want to use getc() 00178 * instead of fread(), to make sure we stop fetching input after 00179 * each newline. 00180 */ 00181 int yy_is_interactive; 00182 00183 /* Whether we're considered to be at the beginning of a line. 00184 * If so, '^' rules will be active on the next match, otherwise 00185 * not. 00186 */ 00187 int yy_at_bol; 00188 00189 /* Whether to try to fill the input buffer when we reach the 00190 * end of it. 00191 */ 00192 int yy_fill_buffer; 00193 00194 int yy_buffer_status; 00195 #define YY_BUFFER_NEW 0 00196 #define YY_BUFFER_NORMAL 1 00197 /* When an EOF's been seen but there's still some text to process 00198 * then we mark the buffer as YY_EOF_PENDING, to indicate that we 00199 * shouldn't try reading from the input source any more. We might 00200 * still have a bunch of tokens to match, though, because of 00201 * possible backing-up. 00202 * 00203 * When we actually see the EOF, we change the status to "new" 00204 * (via yyrestart()), so that the user can continue scanning by 00205 * just pointing yyin at a new input file. 00206 */ 00207 #define YY_BUFFER_EOF_PENDING 2 00208 }; 00209 00210 static YY_BUFFER_STATE yy_current_buffer = 0; 00211 00212 /* We provide macros for accessing buffer states in case in the 00213 * future we want to put the buffer states in a more general 00214 * "scanner state". 00215 */ 00216 #define YY_CURRENT_BUFFER yy_current_buffer 00217 00218 00219 /* yy_hold_char holds the character lost when yytext is formed. */ 00220 static char yy_hold_char; 00221 00222 static int yy_n_chars; /* number of characters read into yy_ch_buf */ 00223 00224 00225 int yyleng; 00226 00227 /* Points to current character in buffer. */ 00228 static char *yy_c_buf_p = (char *) 0; 00229 static int yy_init = 1; /* whether we need to initialize */ 00230 static int yy_start = 0; /* start state number */ 00231 00232 /* Flag which is used to allow yywrap()'s to do buffer switches 00233 * instead of setting up a fresh yyin. A bit of a hack ... 00234 */ 00235 static int yy_did_buffer_switch_on_eof; 00236 00237 void yyrestart YY_PROTO(( FILE *input_file )); 00238 00239 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); 00240 void yy_load_buffer_state YY_PROTO(( void )); 00241 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); 00242 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); 00243 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); 00244 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); 00245 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) 00246 00247 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); 00248 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); 00249 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); 00250 00251 static void *yy_flex_alloc YY_PROTO(( yy_size_t )); 00252 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) YY_MAY_BE_UNUSED; 00253 static void yy_flex_free YY_PROTO(( void * )); 00254 00255 #define yy_new_buffer yy_create_buffer 00256 00257 #define yy_set_interactive(is_interactive) \ 00258 { \ 00259 if ( ! yy_current_buffer ) \ 00260 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ 00261 yy_current_buffer->yy_is_interactive = is_interactive; \ 00262 } 00263 00264 #define yy_set_bol(at_bol) \ 00265 { \ 00266 if ( ! yy_current_buffer ) \ 00267 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ 00268 yy_current_buffer->yy_at_bol = at_bol; \ 00269 } 00270 00271 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) 00272 00273 typedef unsigned char YY_CHAR; 00274 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; 00275 typedef int yy_state_type; 00276 extern char *yytext; 00277 #define yytext_ptr yytext 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 /* Done after the current pattern has been matched and before the 00285 * corresponding action - sets up yytext. 00286 */ 00287 #define YY_DO_BEFORE_ACTION \ 00288 yytext_ptr = yy_bp; \ 00289 yytext_ptr -= yy_more_len; \ 00290 yyleng = (int) (yy_cp - yytext_ptr); \ 00291 yy_hold_char = *yy_cp; \ 00292 *yy_cp = '\0'; \ 00293 yy_c_buf_p = yy_cp; 00294 00295 #define YY_NUM_RULES 85 00296 #define YY_END_OF_BUFFER 86 00297 static yyconst short int yy_accept[289] = 00298 { 0, 00299 0, 0, 86, 84, 82, 81, 84, 84, 71, 71, 00300 71, 76, 84, 67, 65, 68, 72, 74, 74, 74, 00301 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 00302 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 00303 82, 0, 73, 0, 80, 79, 76, 83, 0, 75, 00304 69, 66, 70, 74, 74, 74, 74, 74, 74, 74, 00305 8, 74, 74, 74, 74, 74, 74, 74, 74, 74, 00306 74, 74, 74, 74, 74, 29, 36, 74, 74, 74, 00307 74, 74, 74, 74, 45, 74, 74, 74, 74, 74, 00308 74, 74, 74, 74, 74, 74, 74, 74, 83, 77, 00309 00310 75, 1, 2, 3, 4, 5, 74, 74, 74, 74, 00311 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 00312 74, 74, 74, 74, 74, 74, 74, 74, 74, 33, 00313 37, 74, 74, 40, 41, 42, 74, 74, 74, 74, 00314 74, 74, 74, 74, 74, 52, 74, 74, 55, 74, 00315 74, 74, 74, 74, 74, 0, 74, 74, 9, 74, 00316 74, 74, 74, 74, 74, 17, 74, 74, 20, 74, 00317 74, 64, 74, 74, 25, 74, 27, 74, 74, 74, 00318 74, 74, 35, 38, 39, 43, 74, 74, 74, 74, 00319 63, 49, 74, 74, 74, 54, 74, 74, 74, 74, 00320 00321 60, 74, 74, 0, 78, 74, 6, 74, 11, 12, 00322 74, 74, 74, 74, 74, 74, 74, 74, 23, 74, 00323 26, 74, 30, 74, 74, 74, 74, 46, 74, 74, 00324 74, 74, 74, 56, 57, 74, 74, 74, 62, 74, 00325 74, 13, 74, 74, 16, 74, 19, 21, 22, 74, 00326 28, 74, 32, 74, 74, 74, 74, 74, 51, 74, 00327 58, 59, 61, 7, 74, 14, 15, 74, 24, 74, 00328 34, 44, 74, 48, 74, 74, 74, 18, 74, 74, 00329 74, 53, 10, 31, 47, 74, 50, 0 00330 } ; 00331 00332 static yyconst int yy_ec[256] = 00333 { 0, 00334 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 00335 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 00336 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00337 1, 2, 1, 4, 1, 1, 1, 1, 5, 6, 00338 6, 6, 7, 6, 8, 9, 6, 10, 10, 10, 00339 10, 10, 10, 10, 10, 10, 10, 11, 6, 12, 00340 13, 14, 1, 1, 17, 18, 19, 20, 21, 22, 00341 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 00342 33, 34, 35, 36, 37, 38, 39, 40, 41, 26, 00343 15, 1, 15, 1, 16, 1, 17, 18, 19, 20, 00344 00345 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 00346 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 00347 41, 26, 1, 1, 1, 1, 1, 1, 1, 1, 00348 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00349 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00350 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00351 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00352 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00353 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00354 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00355 00356 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00357 1, 1, 1, 1, 1, 1, 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 00362 } ; 00363 00364 static yyconst int yy_meta[42] = 00365 { 0, 00366 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, 00367 1, 1, 1, 1, 1, 3, 4, 4, 4, 4, 00368 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 00369 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 00370 4 00371 } ; 00372 00373 static yyconst short int yy_base[295] = 00374 { 0, 00375 0, 0, 311, 312, 308, 312, 305, 39, 312, 298, 00376 35, 37, 0, 35, 312, 294, 312, 22, 30, 30, 00377 34, 18, 39, 272, 288, 39, 0, 283, 31, 55, 00378 44, 269, 268, 264, 279, 55, 282, 47, 281, 273, 00379 294, 291, 290, 80, 312, 312, 78, 0, 283, 0, 00380 312, 312, 312, 0, 264, 58, 272, 267, 253, 254, 00381 0, 72, 250, 265, 72, 250, 247, 252, 263, 256, 00382 249, 245, 247, 246, 60, 70, 0, 235, 248, 257, 00383 233, 242, 235, 68, 250, 83, 244, 92, 74, 251, 00384 238, 237, 247, 239, 243, 241, 233, 239, 0, 91, 00385 00386 0, 0, 0, 0, 0, 0, 220, 237, 223, 237, 00387 225, 237, 228, 235, 230, 231, 213, 230, 215, 229, 00388 80, 228, 223, 214, 205, 217, 215, 92, 218, 90, 00389 0, 217, 217, 0, 0, 0, 208, 214, 213, 214, 00390 203, 195, 202, 208, 207, 0, 199, 205, 0, 197, 00391 87, 207, 189, 185, 187, 115, 199, 198, 201, 190, 00392 180, 179, 185, 176, 176, 0, 186, 182, 0, 177, 00393 172, 0, 171, 181, 0, 173, 0, 174, 163, 183, 00394 167, 177, 0, 0, 0, 0, 165, 164, 172, 179, 00395 0, 0, 161, 175, 165, 0, 171, 161, 153, 153, 00396 00397 0, 167, 166, 176, 175, 163, 0, 164, 0, 0, 00398 161, 164, 152, 158, 148, 156, 155, 140, 0, 151, 00399 0, 150, 0, 155, 135, 149, 144, 0, 133, 133, 00400 145, 129, 139, 0, 0, 142, 141, 126, 0, 130, 00401 123, 0, 130, 121, 0, 137, 0, 0, 0, 125, 00402 0, 118, 0, 119, 133, 126, 109, 119, 0, 118, 00403 0, 0, 0, 0, 126, 0, 0, 110, 0, 114, 00404 0, 0, 113, 0, 124, 106, 103, 0, 93, 94, 00405 98, 0, 0, 0, 0, 68, 0, 312, 125, 129, 00406 59, 131, 135, 137 00407 00408 } ; 00409 00410 static yyconst short int yy_def[295] = 00411 { 0, 00412 288, 1, 288, 288, 288, 288, 289, 290, 288, 288, 00413 288, 288, 291, 288, 288, 288, 288, 292, 292, 292, 00414 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 00415 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 00416 288, 289, 288, 290, 288, 288, 288, 293, 288, 294, 00417 288, 288, 288, 292, 292, 292, 292, 292, 292, 292, 00418 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 00419 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 00420 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 00421 292, 292, 292, 292, 292, 292, 292, 292, 293, 288, 00422 00423 294, 292, 292, 292, 292, 292, 292, 292, 292, 292, 00424 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 00425 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 00426 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 00427 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 00428 292, 292, 292, 292, 292, 288, 292, 292, 292, 292, 00429 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 00430 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 00431 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 00432 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 00433 00434 292, 292, 292, 288, 288, 292, 292, 292, 292, 292, 00435 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 00436 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 00437 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 00438 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 00439 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 00440 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 00441 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 00442 292, 292, 292, 292, 292, 292, 292, 0, 288, 288, 00443 288, 288, 288, 288 00444 00445 } ; 00446 00447 static yyconst short int yy_nxt[354] = 00448 { 0, 00449 4, 5, 6, 7, 8, 9, 10, 11, 9, 12, 00450 13, 14, 15, 16, 17, 4, 18, 19, 20, 21, 00451 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 00452 32, 33, 34, 35, 36, 37, 38, 39, 40, 27, 00453 27, 45, 48, 46, 47, 49, 47, 51, 52, 55, 00454 59, 56, 69, 62, 65, 79, 57, 70, 66, 58, 00455 63, 80, 50, 64, 67, 60, 71, 68, 76, 72, 00456 61, 81, 73, 77, 83, 89, 94, 103, 95, 82, 00457 84, 96, 45, 90, 46, 91, 49, 47, 109, 128, 00458 113, 92, 110, 114, 126, 137, 138, 127, 104, 115, 00459 00460 100, 145, 287, 140, 129, 130, 116, 141, 143, 146, 00461 182, 156, 179, 144, 171, 172, 180, 198, 286, 199, 00462 183, 204, 204, 285, 205, 42, 284, 42, 42, 44, 00463 44, 44, 44, 54, 54, 99, 283, 99, 99, 101, 00464 101, 282, 281, 280, 279, 278, 277, 276, 275, 274, 00465 273, 272, 271, 270, 269, 268, 267, 266, 265, 264, 00466 263, 262, 261, 260, 259, 258, 257, 256, 255, 254, 00467 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 00468 243, 242, 241, 240, 205, 205, 239, 238, 237, 236, 00469 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 00470 00471 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 00472 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 00473 203, 202, 201, 200, 197, 196, 195, 194, 193, 192, 00474 191, 190, 189, 188, 187, 186, 185, 184, 181, 178, 00475 177, 176, 175, 174, 173, 170, 169, 168, 167, 166, 00476 165, 164, 163, 162, 161, 160, 159, 158, 157, 155, 00477 154, 153, 152, 151, 150, 149, 148, 147, 142, 139, 00478 136, 135, 134, 133, 132, 131, 125, 124, 123, 122, 00479 121, 120, 119, 118, 117, 112, 111, 108, 107, 106, 00480 105, 102, 100, 42, 43, 41, 98, 97, 93, 88, 00481 00482 87, 86, 85, 78, 75, 74, 53, 47, 43, 41, 00483 288, 3, 288, 288, 288, 288, 288, 288, 288, 288, 00484 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 00485 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 00486 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 00487 288, 288, 288 00488 } ; 00489 00490 static yyconst short int yy_chk[354] = 00491 { 0, 00492 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00493 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00494 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00495 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00496 1, 8, 11, 8, 11, 12, 12, 14, 14, 18, 00497 19, 18, 22, 20, 21, 29, 18, 22, 21, 18, 00498 20, 29, 291, 20, 21, 19, 23, 21, 26, 23, 00499 19, 30, 23, 26, 31, 36, 38, 56, 38, 30, 00500 31, 38, 44, 36, 44, 36, 47, 47, 62, 76, 00501 65, 36, 62, 65, 75, 84, 84, 75, 56, 65, 00502 00503 100, 89, 286, 86, 76, 76, 65, 86, 88, 89, 00504 130, 100, 128, 88, 121, 121, 128, 151, 281, 151, 00505 130, 156, 156, 280, 156, 289, 279, 289, 289, 290, 00506 290, 290, 290, 292, 292, 293, 277, 293, 293, 294, 00507 294, 276, 275, 273, 270, 268, 265, 260, 258, 257, 00508 256, 255, 254, 252, 250, 246, 244, 243, 241, 240, 00509 238, 237, 236, 233, 232, 231, 230, 229, 227, 226, 00510 225, 224, 222, 220, 218, 217, 216, 215, 214, 213, 00511 212, 211, 208, 206, 205, 204, 203, 202, 200, 199, 00512 198, 197, 195, 194, 193, 190, 189, 188, 187, 182, 00513 00514 181, 180, 179, 178, 176, 174, 173, 171, 170, 168, 00515 167, 165, 164, 163, 162, 161, 160, 159, 158, 157, 00516 155, 154, 153, 152, 150, 148, 147, 145, 144, 143, 00517 142, 141, 140, 139, 138, 137, 133, 132, 129, 127, 00518 126, 125, 124, 123, 122, 120, 119, 118, 117, 116, 00519 115, 114, 113, 112, 111, 110, 109, 108, 107, 98, 00520 97, 96, 95, 94, 93, 92, 91, 90, 87, 85, 00521 83, 82, 81, 80, 79, 78, 74, 73, 72, 71, 00522 70, 69, 68, 67, 66, 64, 63, 60, 59, 58, 00523 57, 55, 49, 43, 42, 41, 40, 39, 37, 35, 00524 00525 34, 33, 32, 28, 25, 24, 16, 10, 7, 5, 00526 3, 288, 288, 288, 288, 288, 288, 288, 288, 288, 00527 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 00528 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 00529 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 00530 288, 288, 288 00531 } ; 00532 00533 static yy_state_type yy_last_accepting_state; 00534 static char *yy_last_accepting_cpos; 00535 00536 /* The intent behind this definition is that it'll catch 00537 * any uses of REJECT which flex missed. 00538 */ 00539 #define REJECT reject_used_but_not_detected 00540 static int yy_more_flag = 0; 00541 static int yy_more_len = 0; 00542 #define yymore() (yy_more_flag = 1) 00543 #define YY_MORE_ADJ yy_more_len 00544 #define YY_RESTORE_YY_MORE_OFFSET 00545 char *yytext; 00546 #line 1 "SqlScanner.l" 00547 #define INITIAL 0 00548 00558 #line 14 "SqlScanner.l" 00559 #include <iostream> 00560 #include "SqlParser.h" 00561 #include "SqlScanner.h" 00562 #include "SqlParser_gen.h" 00563 #include "utility.h" 00564 00565 int lineno = 1; 00566 void yyerror (const char* s); 00567 PxxScanner PsqlScan; 00568 extern PxxPnode* PxxPtree; 00569 00570 // Save text of SQL Token and return the token to the parser 00571 #define PXX_TOK(tname) { \ 00572 yylval.strVal = PsqlScan.SaveText(yytext, yyleng, true); \ 00573 return tname; \ 00574 } 00575 00576 /* Macros after this point can all be overridden by user definitions in 00577 * section 1. 00578 */ 00579 00580 #ifndef YY_SKIP_YYWRAP 00581 #ifdef __cplusplus 00582 extern "C" int yywrap YY_PROTO(( void )); 00583 #else 00584 extern int yywrap YY_PROTO(( void )); 00585 #endif 00586 #endif 00587 00588 #ifndef YY_NO_UNPUT 00589 static void yyunput YY_PROTO(( int c, char *buf_ptr )); 00590 #endif 00591 00592 #ifndef yytext_ptr 00593 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); 00594 #endif 00595 00596 #ifdef YY_NEED_STRLEN 00597 static int yy_flex_strlen YY_PROTO(( yyconst char * )); 00598 #endif 00599 00600 #ifndef YY_NO_INPUT 00601 #ifdef __cplusplus 00602 static int yyinput YY_PROTO(( void )); 00603 #else 00604 static int input YY_PROTO(( void )); 00605 #endif 00606 #endif 00607 00608 #if YY_STACK_USED 00609 static int yy_start_stack_ptr = 0; 00610 static int yy_start_stack_depth = 0; 00611 static int *yy_start_stack = 0; 00612 #ifndef YY_NO_PUSH_STATE 00613 static void yy_push_state YY_PROTO(( int new_state )); 00614 #endif 00615 #ifndef YY_NO_POP_STATE 00616 static void yy_pop_state YY_PROTO(( void )); 00617 #endif 00618 #ifndef YY_NO_TOP_STATE 00619 static int yy_top_state YY_PROTO(( void )); 00620 #endif 00621 00622 #else 00623 #define YY_NO_PUSH_STATE 1 00624 #define YY_NO_POP_STATE 1 00625 #define YY_NO_TOP_STATE 1 00626 #endif 00627 00628 #ifdef YY_MALLOC_DECL 00629 YY_MALLOC_DECL 00630 #else 00631 #if __STDC__ 00632 #ifndef __cplusplus 00633 #include <stdlib.h> 00634 #endif 00635 #else 00636 /* Just try to get by without declaring the routines. This will fail 00637 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) 00638 * or sizeof(void*) != sizeof(int). 00639 */ 00640 #endif 00641 #endif 00642 00643 /* Amount of stuff to slurp up with each read. */ 00644 #ifndef YY_READ_BUF_SIZE 00645 #define YY_READ_BUF_SIZE 8192 00646 #endif 00647 00648 /* Copy whatever the last rule matched to the standard output. */ 00649 00650 #ifndef ECHO 00651 /* This used to be an fputs(), but since the string might contain NUL's, 00652 * we now use fwrite(). 00653 */ 00654 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) 00655 #endif 00656 00657 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 00658 * is returned in "result". 00659 */ 00660 #ifndef YY_INPUT 00661 #define YY_INPUT(buf,result,max_size) \ 00662 if ( yy_current_buffer->yy_is_interactive ) \ 00663 { \ 00664 int c = '*', n; \ 00665 for ( n = 0; n < max_size && \ 00666 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 00667 buf[n] = (char) c; \ 00668 if ( c == '\n' ) \ 00669 buf[n++] = (char) c; \ 00670 if ( c == EOF && ferror( yyin ) ) \ 00671 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 00672 result = n; \ 00673 } \ 00674 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ 00675 && ferror( yyin ) ) \ 00676 YY_FATAL_ERROR( "input in flex scanner failed" ); 00677 #endif 00678 00679 /* No semi-colon after return; correct usage is to write "yyterminate();" - 00680 * we don't want an extra ';' after the "return" because that will cause 00681 * some compilers to complain about unreachable statements. 00682 */ 00683 #ifndef yyterminate 00684 #define yyterminate() return YY_NULL 00685 #endif 00686 00687 /* Number of entries by which start-condition stack grows. */ 00688 #ifndef YY_START_STACK_INCR 00689 #define YY_START_STACK_INCR 25 00690 #endif 00691 00692 /* Report a fatal error. */ 00693 #ifndef YY_FATAL_ERROR 00694 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) 00695 #endif 00696 00697 /* Default declaration of generated scanner - a define so the user can 00698 * easily add parameters. 00699 */ 00700 #ifndef YY_DECL 00701 #define YY_DECL int yylex YY_PROTO(( void )) 00702 #endif 00703 00704 /* Code executed at the beginning of each rule, after yytext and yyleng 00705 * have been set up. 00706 */ 00707 #ifndef YY_USER_ACTION 00708 #define YY_USER_ACTION 00709 #endif 00710 00711 /* Code executed at the end of each rule. */ 00712 #ifndef YY_BREAK 00713 #define YY_BREAK break; 00714 #endif 00715 00716 #define YY_RULE_SETUP \ 00717 YY_USER_ACTION 00718 00719 YY_DECL 00720 { 00721 register yy_state_type yy_current_state; 00722 register char *yy_cp = NULL, *yy_bp = NULL; 00723 register int yy_act; 00724 00725 #line 38 "SqlScanner.l" 00726 00727 00728 00729 if ( yy_init ) 00730 { 00731 yy_init = 0; 00732 00733 #ifdef YY_USER_INIT 00734 YY_USER_INIT; 00735 #endif 00736 00737 if ( ! yy_start ) 00738 yy_start = 1; /* first start state */ 00739 00740 if ( ! yyin ) 00741 yyin = stdin; 00742 00743 if ( ! yyout ) 00744 yyout = stdout; 00745 00746 if ( ! yy_current_buffer ) 00747 yy_current_buffer = 00748 yy_create_buffer( yyin, YY_BUF_SIZE ); 00749 00750 yy_load_buffer_state(); 00751 } 00752 00753 while ( 1 ) /* loops until end-of-file is reached */ 00754 { 00755 yy_more_len = 0; 00756 if ( yy_more_flag ) 00757 { 00758 yy_more_len = yy_c_buf_p - yytext_ptr; 00759 yy_more_flag = 0; 00760 } 00761 yy_cp = yy_c_buf_p; 00762 00763 /* Support of yytext. */ 00764 *yy_cp = yy_hold_char; 00765 00766 /* yy_bp points to the position in yy_ch_buf of the start of 00767 * the current run. 00768 */ 00769 yy_bp = yy_cp; 00770 00771 yy_current_state = yy_start; 00772 yy_match: 00773 do 00774 { 00775 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; 00776 if ( yy_accept[yy_current_state] ) 00777 { 00778 yy_last_accepting_state = yy_current_state; 00779 yy_last_accepting_cpos = yy_cp; 00780 } 00781 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 00782 { 00783 yy_current_state = (int) yy_def[yy_current_state]; 00784 if ( yy_current_state >= 289 ) 00785 yy_c = yy_meta[(unsigned int) yy_c]; 00786 } 00787 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 00788 ++yy_cp; 00789 } 00790 while ( yy_base[yy_current_state] != 312 ); 00791 00792 yy_find_action: 00793 yy_act = yy_accept[yy_current_state]; 00794 if ( yy_act == 0 ) 00795 { /* have to back up */ 00796 yy_cp = yy_last_accepting_cpos; 00797 yy_current_state = yy_last_accepting_state; 00798 yy_act = yy_accept[yy_current_state]; 00799 } 00800 00801 YY_DO_BEFORE_ACTION; 00802 00803 00804 do_action: /* This label is used only to access EOF actions. */ 00805 00806 00807 switch ( yy_act ) 00808 { /* beginning of action switch */ 00809 case 0: /* must back up */ 00810 /* undo the effects of YY_DO_BEFORE_ACTION */ 00811 *yy_cp = yy_hold_char; 00812 yy_cp = yy_last_accepting_cpos; 00813 yy_current_state = yy_last_accepting_state; 00814 goto yy_find_action; 00815 00816 case 1: 00817 YY_RULE_SETUP 00818 #line 40 "SqlScanner.l" 00819 PXX_TOK(PTOK_ALL); 00820 YY_BREAK 00821 case 2: 00822 YY_RULE_SETUP 00823 #line 41 "SqlScanner.l" 00824 PXX_TOK(PTOK_AND); 00825 YY_BREAK 00826 case 3: 00827 YY_RULE_SETUP 00828 #line 42 "SqlScanner.l" 00829 PXX_TOK(PTOK_ANY); 00830 YY_BREAK 00831 case 4: 00832 YY_RULE_SETUP 00833 #line 43 "SqlScanner.l" 00834 PXX_TOK(PTOK_ASC); 00835 YY_BREAK 00836 case 5: 00837 YY_RULE_SETUP 00838 #line 44 "SqlScanner.l" 00839 PXX_TOK(PTOK_AVG); 00840 YY_BREAK 00841 case 6: 00842 YY_RULE_SETUP 00843 #line 45 "SqlScanner.l" 00844 PXX_TOK(PTOK_BTREE); 00845 YY_BREAK 00846 case 7: 00847 YY_RULE_SETUP 00848 #line 46 "SqlScanner.l" 00849 PXX_TOK(PTOK_BETWEEN); 00850 YY_BREAK 00851 case 8: 00852 YY_RULE_SETUP 00853 #line 47 "SqlScanner.l" 00854 PXX_TOK(PTOK_BY); 00855 YY_BREAK 00856 case 9: 00857 YY_RULE_SETUP 00858 #line 48 "SqlScanner.l" 00859 PXX_TOK(PTOK_CHARACTER); 00860 YY_BREAK 00861 case 10: 00862 YY_RULE_SETUP 00863 #line 49 "SqlScanner.l" 00864 PXX_TOK(PTOK_CHARACTER); 00865 YY_BREAK 00866 case 11: 00867 YY_RULE_SETUP 00868 #line 50 "SqlScanner.l" 00869 PXX_TOK(PTOK_CHECK); 00870 YY_BREAK 00871 case 12: 00872 YY_RULE_SETUP 00873 #line 51 "SqlScanner.l" 00874 PXX_TOK(PTOK_COUNT); 00875 YY_BREAK 00876 case 13: 00877 YY_RULE_SETUP 00878 #line 52 "SqlScanner.l" 00879 PXX_TOK(PTOK_CREATE); 00880 YY_BREAK 00881 case 14: 00882 YY_RULE_SETUP 00883 #line 53 "SqlScanner.l" 00884 PXX_TOK(PTOK_DECIMAL); 00885 YY_BREAK 00886 case 15: 00887 YY_RULE_SETUP 00888 #line 54 "SqlScanner.l" 00889 PXX_TOK(PTOK_DEFAULT); 00890 YY_BREAK 00891 case 16: 00892 YY_RULE_SETUP 00893 #line 55 "SqlScanner.l" 00894 PXX_TOK(PTOK_DELETE); 00895 YY_BREAK 00896 case 17: 00897 YY_RULE_SETUP 00898 #line 56 "SqlScanner.l" 00899 PXX_TOK(PTOK_DESC); 00900 YY_BREAK 00901 case 18: 00902 YY_RULE_SETUP 00903 #line 57 "SqlScanner.l" 00904 PXX_TOK(PTOK_DISTINCT); 00905 YY_BREAK 00906 case 19: 00907 YY_RULE_SETUP 00908 #line 58 "SqlScanner.l" 00909 PXX_TOK(PTOK_DOUBLE); 00910 YY_BREAK 00911 case 20: 00912 YY_RULE_SETUP 00913 #line 59 "SqlScanner.l" 00914 PXX_TOK(PTOK_DROP); 00915 YY_BREAK 00916 case 21: 00917 YY_RULE_SETUP 00918 #line 60 "SqlScanner.l" 00919 PXX_TOK(PTOK_ESCAPE); 00920 YY_BREAK 00921 case 22: 00922 YY_RULE_SETUP 00923 #line 61 "SqlScanner.l" 00924 PXX_TOK(PTOK_EXISTS); 00925 YY_BREAK 00926 case 23: 00927 YY_RULE_SETUP 00928 #line 62 "SqlScanner.l" 00929 PXX_TOK(PTOK_FLOAT); 00930 YY_BREAK 00931 case 24: 00932 YY_RULE_SETUP 00933 #line 63 "SqlScanner.l" 00934 PXX_TOK(PTOK_FOREIGN); 00935 YY_BREAK 00936 case 25: 00937 YY_RULE_SETUP 00938 #line 64 "SqlScanner.l" 00939 PXX_TOK(PTOK_FROM); 00940 YY_BREAK 00941 case 26: 00942 YY_RULE_SETUP 00943 #line 65 "SqlScanner.l" 00944 PXX_TOK(PTOK_GROUP); 00945 YY_BREAK 00946 case 27: 00947 YY_RULE_SETUP 00948 #line 66 "SqlScanner.l" 00949 PXX_TOK(PTOK_HASH); 00950 YY_BREAK 00951 case 28: 00952 YY_RULE_SETUP 00953 #line 67 "SqlScanner.l" 00954 PXX_TOK(PTOK_HAVING); 00955 YY_BREAK 00956 case 29: 00957 YY_RULE_SETUP 00958 #line 68 "SqlScanner.l" 00959 PXX_TOK(PTOK_IN); 00960 YY_BREAK 00961 case 30: 00962 YY_RULE_SETUP 00963 #line 69 "SqlScanner.l" 00964 PXX_TOK(PTOK_INDEX); 00965 YY_BREAK 00966 case 31: 00967 YY_RULE_SETUP 00968 #line 70 "SqlScanner.l" 00969 PXX_TOK(PTOK_INDICATOR); 00970 YY_BREAK 00971 case 32: 00972 YY_RULE_SETUP 00973 #line 71 "SqlScanner.l" 00974 PXX_TOK(PTOK_INSERT); 00975 YY_BREAK 00976 case 33: 00977 YY_RULE_SETUP 00978 #line 72 "SqlScanner.l" 00979 PXX_TOK(PTOK_INTEGER); 00980 YY_BREAK 00981 case 34: 00982 YY_RULE_SETUP 00983 #line 73 "SqlScanner.l" 00984 PXX_TOK(PTOK_INTEGER); 00985 YY_BREAK 00986 case 35: 00987 YY_RULE_SETUP 00988 #line 74 "SqlScanner.l" 00989 PXX_TOK(PTOK_INTO); 00990 YY_BREAK 00991 case 36: 00992 YY_RULE_SETUP 00993 #line 75 "SqlScanner.l" 00994 PXX_TOK(PTOK_IS); 00995 YY_BREAK 00996 case 37: 00997 YY_RULE_SETUP 00998 #line 76 "SqlScanner.l" 00999 PXX_TOK(PTOK_KEY); 01000 YY_BREAK 01001 case 38: 01002 YY_RULE_SETUP 01003 #line 77 "SqlScanner.l" 01004 PXX_TOK(PTOK_LIKE); 01005 YY_BREAK 01006 case 39: 01007 YY_RULE_SETUP 01008 #line 78 "SqlScanner.l" 01009 PXX_TOK(PTOK_LOAD); 01010 YY_BREAK 01011 case 40: 01012 YY_RULE_SETUP 01013 #line 79 "SqlScanner.l" 01014 PXX_TOK(PTOK_MAX); 01015 YY_BREAK 01016 case 41: 01017 YY_RULE_SETUP 01018 #line 80 "SqlScanner.l" 01019 PXX_TOK(PTOK_MIN); 01020 YY_BREAK 01021 case 42: 01022 YY_RULE_SETUP 01023 #line 81 "SqlScanner.l" 01024 PXX_TOK(PTOK_NOT); 01025 YY_BREAK 01026 case 43: 01027 YY_RULE_SETUP 01028 #line 82 "SqlScanner.l" 01029 PXX_TOK(PTOK_NULLX); 01030 YY_BREAK 01031 case 44: 01032 YY_RULE_SETUP 01033 #line 83 "SqlScanner.l" 01034 PXX_TOK(PTOK_NUMERIC); 01035 YY_BREAK 01036 case 45: 01037 YY_RULE_SETUP 01038 #line 84 "SqlScanner.l" 01039 PXX_TOK(PTOK_OR); 01040 YY_BREAK 01041 case 46: 01042 YY_RULE_SETUP 01043 #line 85 "SqlScanner.l" 01044 PXX_TOK(PTOK_ORDER); 01045 YY_BREAK 01046 case 47: 01047 YY_RULE_SETUP 01048 #line 86 "SqlScanner.l" 01049 PXX_TOK(PTOK_PRECISION); 01050 YY_BREAK 01051 case 48: 01052 YY_RULE_SETUP 01053 #line 87 "SqlScanner.l" 01054 PXX_TOK(PTOK_PRIMARY); 01055 YY_BREAK 01056 case 49: 01057 YY_RULE_SETUP 01058 #line 88 "SqlScanner.l" 01059 PXX_TOK(PTOK_DOUBLE); 01060 YY_BREAK 01061 case 50: 01062 YY_RULE_SETUP 01063 #line 89 "SqlScanner.l" 01064 PXX_TOK(PTOK_REFERENCES); 01065 YY_BREAK 01066 case 51: 01067 YY_RULE_SETUP 01068 #line 90 "SqlScanner.l" 01069 PXX_TOK(PTOK_SELECT); 01070 YY_BREAK 01071 case 52: 01072 YY_RULE_SETUP 01073 #line 91 "SqlScanner.l" 01074 PXX_TOK(PTOK_SET); 01075 YY_BREAK 01076 case 53: 01077 YY_RULE_SETUP 01078 #line 92 "SqlScanner.l" 01079 PXX_TOK(PTOK_SMALLINT); 01080 YY_BREAK 01081 case 54: 01082 YY_RULE_SETUP 01083 #line 93 "SqlScanner.l" 01084 PXX_TOK(PTOK_SOME); 01085 YY_BREAK 01086 case 55: 01087 YY_RULE_SETUP 01088 #line 94 "SqlScanner.l" 01089 PXX_TOK(PTOK_SUM); 01090 YY_BREAK 01091 case 56: 01092 YY_RULE_SETUP 01093 #line 95 "SqlScanner.l" 01094 PXX_TOK(PTOK_TABLE); 01095 YY_BREAK 01096 case 57: 01097 YY_RULE_SETUP 01098 #line 96 "SqlScanner.l" 01099 PXX_TOK(PTOK_UNION); 01100 YY_BREAK 01101 case 58: 01102 YY_RULE_SETUP 01103 #line 97 "SqlScanner.l" 01104 PXX_TOK(PTOK_UNIQUE); 01105 YY_BREAK 01106 case 59: 01107 YY_RULE_SETUP 01108 #line 98 "SqlScanner.l" 01109 PXX_TOK(PTOK_UPDATE); 01110 YY_BREAK 01111 case 60: 01112 YY_RULE_SETUP 01113 #line 99 "SqlScanner.l" 01114 PXX_TOK(PTOK_USER); 01115 YY_BREAK 01116 case 61: 01117 YY_RULE_SETUP 01118 #line 100 "SqlScanner.l" 01119 PXX_TOK(PTOK_VALUES); 01120 YY_BREAK 01121 case 62: 01122 YY_RULE_SETUP 01123 #line 101 "SqlScanner.l" 01124 PXX_TOK(PTOK_WHERE); 01125 YY_BREAK 01126 case 63: 01127 YY_RULE_SETUP 01128 #line 102 "SqlScanner.l" 01129 PXX_TOK(PTOK_EOF); 01130 YY_BREAK 01131 case 64: 01132 YY_RULE_SETUP 01133 #line 103 "SqlScanner.l" 01134 PXX_TOK(PTOK_EOF); 01135 YY_BREAK 01136 case 65: 01137 YY_RULE_SETUP 01138 #line 105 "SqlScanner.l" 01139 PXX_TOK(PTOK_EQ); 01140 YY_BREAK 01141 case 66: 01142 YY_RULE_SETUP 01143 #line 106 "SqlScanner.l" 01144 PXX_TOK(PTOK_NEQ); 01145 YY_BREAK 01146 case 67: 01147 YY_RULE_SETUP 01148 #line 107 "SqlScanner.l" 01149 PXX_TOK(PTOK_LT); 01150 YY_BREAK 01151 case 68: 01152 YY_RULE_SETUP 01153 #line 108 "SqlScanner.l" 01154 PXX_TOK(PTOK_GT); 01155 YY_BREAK 01156 case 69: 01157 YY_RULE_SETUP 01158 #line 109 "SqlScanner.l" 01159 PXX_TOK(PTOK_LEQ); 01160 YY_BREAK 01161 case 70: 01162 YY_RULE_SETUP 01163 #line 110 "SqlScanner.l" 01164 PXX_TOK(PTOK_GEQ) 01165 YY_BREAK 01166 case 71: 01167 YY_RULE_SETUP 01168 #line 112 "SqlScanner.l" 01169 PXX_TOK(yytext[0]) 01170 YY_BREAK 01171 case 72: 01172 YY_RULE_SETUP 01173 #line 113 "SqlScanner.l" 01174 PXX_TOK(yytext[0]) 01175 YY_BREAK 01176 case 73: 01177 YY_RULE_SETUP 01178 #line 115 "SqlScanner.l" 01179 { 01180 yylval.strVal = PsqlScan.SaveQuotedText(yytext, yyleng); 01181 return PTOK_QSTRING; 01182 } 01183 YY_BREAK 01184 case 74: 01185 YY_RULE_SETUP 01186 #line 120 "SqlScanner.l" 01187 {PXX_TOK(PTOK_NAME);} 01188 YY_BREAK 01189 case 75: 01190 YY_RULE_SETUP 01191 #line 122 "SqlScanner.l" 01192 { 01193 yylval.strVal = PsqlScan.SaveParam(yytext+1); 01194 return PTOK_PARAMETER; 01195 } 01196 YY_BREAK 01197 case 76: 01198 YY_RULE_SETUP 01199 #line 127 "SqlScanner.l" 01200 { 01201 sscanf(yytext, "%d", &yylval.intVal); 01202 PsqlScan.SaveText(yytext, yyleng); 01203 return PTOK_INTNUM; 01204 } 01205 YY_BREAK 01206 case 77: 01207 YY_RULE_SETUP 01208 #line 132 "SqlScanner.l" 01209 { 01210 sscanf(yytext, "%lf", &yylval.dblVal); 01211 PsqlScan.SaveText(yytext, yyleng); 01212 return PTOK_DOUBLE; 01213 } 01214 YY_BREAK 01215 case 78: 01216 YY_RULE_SETUP 01217 #line 137 "SqlScanner.l" 01218 { 01219 sscanf(yytext, "%lf", &yylval.dblVal); 01220 PsqlScan.SaveText(yytext, yyleng); 01221 return PTOK_DOUBLE; 01222 } 01223 YY_BREAK 01224 case 79: 01225 YY_RULE_SETUP 01226 #line 143 "SqlScanner.l" 01227 { 01228 int c = yytext[yyleng]; 01229 if(c != '\'') 01230 { 01231 yylval.strVal = PsqlScan.SaveQuotedText(yytext, yyleng, false); 01232 return PTOK_STRING; 01233 } 01234 else yymore(); 01235 } 01236 YY_BREAK 01237 case 80: 01238 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ 01239 yy_c_buf_p = yy_cp -= 1; 01240 YY_DO_BEFORE_ACTION; /* set up yytext again */ 01241 YY_RULE_SETUP 01242 #line 153 "SqlScanner.l" 01243 { yyerror("Unterminated string"); } 01244 YY_BREAK 01245 case 81: 01246 YY_RULE_SETUP 01247 #line 155 "SqlScanner.l" 01248 {PsqlScan.SaveText(yytext, yyleng); lineno++; } 01249 YY_BREAK 01250 case 82: 01251 YY_RULE_SETUP 01252 #line 157 "SqlScanner.l" 01253 ; {PsqlScan.SaveText(yytext, yyleng);} /* ignore white space */ 01254 YY_BREAK 01255 case 83: 01256 YY_RULE_SETUP 01257 #line 159 "SqlScanner.l" 01258 ; /* comment */ 01259 YY_BREAK 01260 case YY_STATE_EOF(INITIAL): 01261 #line 160 "SqlScanner.l" 01262 {return PTOK_EOF;} 01263 YY_BREAK 01264 case 84: 01265 YY_RULE_SETUP 01266 #line 161 "SqlScanner.l" 01267 {printf("illegal character [%c] at line %d\n", yytext[0], lineno);} 01268 YY_BREAK 01269 case 85: 01270 YY_RULE_SETUP 01271 #line 162 "SqlScanner.l" 01272 ECHO; 01273 YY_BREAK 01274 01275 case YY_END_OF_BUFFER: 01276 { 01277 /* Amount of text matched not including the EOB char. */ 01278 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; 01279 01280 /* Undo the effects of YY_DO_BEFORE_ACTION. */ 01281 *yy_cp = yy_hold_char; 01282 YY_RESTORE_YY_MORE_OFFSET 01283 01284 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) 01285 { 01286 /* We're scanning a new file or input source. It's 01287 * possible that this happened because the user 01288 * just pointed yyin at a new source and called 01289 * yylex(). If so, then we have to assure 01290 * consistency between yy_current_buffer and our 01291 * globals. Here is the right place to do so, because 01292 * this is the first action (other than possibly a 01293 * back-up) that will match for the new input source. 01294 */ 01295 yy_n_chars = yy_current_buffer->yy_n_chars; 01296 yy_current_buffer->yy_input_file = yyin; 01297 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; 01298 } 01299 01300 /* Note that here we test for yy_c_buf_p "<=" to the position 01301 * of the first EOB in the buffer, since yy_c_buf_p will 01302 * already have been incremented past the NUL character 01303 * (since all states make transitions on EOB to the 01304 * end-of-buffer state). Contrast this with the test 01305 * in input(). 01306 */ 01307 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) 01308 { /* This was really a NUL. */ 01309 yy_state_type yy_next_state; 01310 01311 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; 01312 01313 yy_current_state = yy_get_previous_state(); 01314 01315 /* Okay, we're now positioned to make the NUL 01316 * transition. We couldn't have 01317 * yy_get_previous_state() go ahead and do it 01318 * for us because it doesn't know how to deal 01319 * with the possibility of jamming (and we don't 01320 * want to build jamming into it because then it 01321 * will run more slowly). 01322 */ 01323 01324 yy_next_state = yy_try_NUL_trans( yy_current_state ); 01325 01326 yy_bp = yytext_ptr + YY_MORE_ADJ; 01327 01328 if ( yy_next_state ) 01329 { 01330 /* Consume the NUL. */ 01331 yy_cp = ++yy_c_buf_p; 01332 yy_current_state = yy_next_state; 01333 goto yy_match; 01334 } 01335 01336 else 01337 { 01338 yy_cp = yy_c_buf_p; 01339 goto yy_find_action; 01340 } 01341 } 01342 01343 else switch ( yy_get_next_buffer() ) 01344 { 01345 case EOB_ACT_END_OF_FILE: 01346 { 01347 yy_did_buffer_switch_on_eof = 0; 01348 01349 if ( yywrap() ) 01350 { 01351 /* Note: because we've taken care in 01352 * yy_get_next_buffer() to have set up 01353 * yytext, we can now set up 01354 * yy_c_buf_p so that if some total 01355 * hoser (like flex itself) wants to 01356 * call the scanner after we return the 01357 * YY_NULL, it'll still work - another 01358 * YY_NULL will get returned. 01359 */ 01360 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; 01361 01362 yy_act = YY_STATE_EOF(YY_START); 01363 goto do_action; 01364 } 01365 01366 else 01367 { 01368 if ( ! yy_did_buffer_switch_on_eof ) 01369 YY_NEW_FILE; 01370 } 01371 break; 01372 } 01373 01374 case EOB_ACT_CONTINUE_SCAN: 01375 yy_c_buf_p = 01376 yytext_ptr + yy_amount_of_matched_text; 01377 01378 yy_current_state = yy_get_previous_state(); 01379 01380 yy_cp = yy_c_buf_p; 01381 yy_bp = yytext_ptr + YY_MORE_ADJ; 01382 goto yy_match; 01383 01384 case EOB_ACT_LAST_MATCH: 01385 yy_c_buf_p = 01386 &yy_current_buffer->yy_ch_buf[yy_n_chars]; 01387 01388 yy_current_state = yy_get_previous_state(); 01389 01390 yy_cp = yy_c_buf_p; 01391 yy_bp = yytext_ptr + YY_MORE_ADJ; 01392 goto yy_find_action; 01393 } 01394 break; 01395 } 01396 01397 default: 01398 YY_FATAL_ERROR( 01399 "fatal flex scanner internal error--no action found" ); 01400 } /* end of action switch */ 01401 } /* end of scanning one token */ 01402 } /* end of yylex */ 01403 01404 01405 /* yy_get_next_buffer - try to read in a new buffer 01406 * 01407 * Returns a code representing an action: 01408 * EOB_ACT_LAST_MATCH - 01409 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position 01410 * EOB_ACT_END_OF_FILE - end of file 01411 */ 01412 01413 static int yy_get_next_buffer() 01414 { 01415 register char *dest = yy_current_buffer->yy_ch_buf; 01416 register char *source = yytext_ptr; 01417 register int number_to_move, i; 01418 int ret_val; 01419 01420 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) 01421 YY_FATAL_ERROR( 01422 "fatal flex scanner internal error--end of buffer missed" ); 01423 01424 if ( yy_current_buffer->yy_fill_buffer == 0 ) 01425 { /* Don't try to fill the buffer, so this is an EOF. */ 01426 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) 01427 { 01428 /* We matched a single character, the EOB, so 01429 * treat this as a final EOF. 01430 */ 01431 return EOB_ACT_END_OF_FILE; 01432 } 01433 01434 else 01435 { 01436 /* We matched some text prior to the EOB, first 01437 * process it. 01438 */ 01439 return EOB_ACT_LAST_MATCH; 01440 } 01441 } 01442 01443 /* Try to read more data. */ 01444 01445 /* First move last chars to start of buffer. */ 01446 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; 01447 01448 for ( i = 0; i < number_to_move; ++i ) 01449 *(dest++) = *(source++); 01450 01451 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 01452 /* don't do the read, it's not guaranteed to return an EOF, 01453 * just force an EOF 01454 */ 01455 yy_current_buffer->yy_n_chars = yy_n_chars = 0; 01456 01457 else 01458 { 01459 int num_to_read = 01460 yy_current_buffer->yy_buf_size - number_to_move - 1; 01461 01462 while ( num_to_read <= 0 ) 01463 { /* Not enough room in the buffer - grow it. */ 01464 #ifdef YY_USES_REJECT 01465 YY_FATAL_ERROR( 01466 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); 01467 #else 01468 01469 /* just a shorter name for the current buffer */ 01470 YY_BUFFER_STATE b = yy_current_buffer; 01471 01472 int yy_c_buf_p_offset = 01473 (int) (yy_c_buf_p - b->yy_ch_buf); 01474 01475 if ( b->yy_is_our_buffer ) 01476 { 01477 int new_size = b->yy_buf_size * 2; 01478 01479 if ( new_size <= 0 ) 01480 b->yy_buf_size += b->yy_buf_size / 8; 01481 else 01482 b->yy_buf_size *= 2; 01483 01484 b->yy_ch_buf = (char *) 01485 /* Include room in for 2 EOB chars. */ 01486 yy_flex_realloc( (void *) b->yy_ch_buf, 01487 b->yy_buf_size + 2 ); 01488 } 01489 else 01490 /* Can't grow it, we don't own it. */ 01491 b->yy_ch_buf = 0; 01492 01493 if ( ! b->yy_ch_buf ) 01494 YY_FATAL_ERROR( 01495 "fatal error - scanner input buffer overflow" ); 01496 01497 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; 01498 01499 num_to_read = yy_current_buffer->yy_buf_size - 01500 number_to_move - 1; 01501 #endif 01502 } 01503 01504 if ( num_to_read > YY_READ_BUF_SIZE ) 01505 num_to_read = YY_READ_BUF_SIZE; 01506 01507 /* Read in more data. */ 01508 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), 01509 yy_n_chars, num_to_read ); 01510 01511 yy_current_buffer->yy_n_chars = yy_n_chars; 01512 } 01513 01514 if ( yy_n_chars == 0 ) 01515 { 01516 if ( number_to_move == YY_MORE_ADJ ) 01517 { 01518 ret_val = EOB_ACT_END_OF_FILE; 01519 yyrestart( yyin ); 01520 } 01521 01522 else 01523 { 01524 ret_val = EOB_ACT_LAST_MATCH; 01525 yy_current_buffer->yy_buffer_status = 01526 YY_BUFFER_EOF_PENDING; 01527 } 01528 } 01529 01530 else 01531 ret_val = EOB_ACT_CONTINUE_SCAN; 01532 01533 yy_n_chars += number_to_move; 01534 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; 01535 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; 01536 01537 yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; 01538 01539 return ret_val; 01540 } 01541 01542 01543 /* yy_get_previous_state - get the state just before the EOB char was reached */ 01544 01545 static yy_state_type yy_get_previous_state() 01546 { 01547 register yy_state_type yy_current_state; 01548 register char *yy_cp; 01549 01550 yy_current_state = yy_start; 01551 01552 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) 01553 { 01554 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 01555 if ( yy_accept[yy_current_state] ) 01556 { 01557 yy_last_accepting_state = yy_current_state; 01558 yy_last_accepting_cpos = yy_cp; 01559 } 01560 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 01561 { 01562 yy_current_state = (int) yy_def[yy_current_state]; 01563 if ( yy_current_state >= 289 ) 01564 yy_c = yy_meta[(unsigned int) yy_c]; 01565 } 01566 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 01567 } 01568 01569 return yy_current_state; 01570 } 01571 01572 01573 /* yy_try_NUL_trans - try to make a transition on the NUL character 01574 * 01575 * synopsis 01576 * next_state = yy_try_NUL_trans( current_state ); 01577 */ 01578 01579 #ifdef YY_USE_PROTOS 01580 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) 01581 #else 01582 static yy_state_type yy_try_NUL_trans( yy_current_state ) 01583 yy_state_type yy_current_state; 01584 #endif 01585 { 01586 register int yy_is_jam; 01587 register char *yy_cp = yy_c_buf_p; 01588 01589 register YY_CHAR yy_c = 1; 01590 if ( yy_accept[yy_current_state] ) 01591 { 01592 yy_last_accepting_state = yy_current_state; 01593 yy_last_accepting_cpos = yy_cp; 01594 } 01595 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 01596 { 01597 yy_current_state = (int) yy_def[yy_current_state]; 01598 if ( yy_current_state >= 289 ) 01599 yy_c = yy_meta[(unsigned int) yy_c]; 01600 } 01601 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 01602 yy_is_jam = (yy_current_state == 288); 01603 01604 return yy_is_jam ? 0 : yy_current_state; 01605 } 01606 01607 01608 #ifndef YY_NO_UNPUT 01609 #ifdef YY_USE_PROTOS 01610 static void yyunput( int c, register char *yy_bp ) 01611 #else 01612 static void yyunput( c, yy_bp ) 01613 int c; 01614 register char *yy_bp; 01615 #endif 01616 { 01617 register char *yy_cp = yy_c_buf_p; 01618 01619 /* undo effects of setting up yytext */ 01620 *yy_cp = yy_hold_char; 01621 01622 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) 01623 { /* need to shift things up to make room */ 01624 /* +2 for EOB chars. */ 01625 register int number_to_move = yy_n_chars + 2; 01626 register char *dest = &yy_current_buffer->yy_ch_buf[ 01627 yy_current_buffer->yy_buf_size + 2]; 01628 register char *source = 01629 &yy_current_buffer->yy_ch_buf[number_to_move]; 01630 01631 while ( source > yy_current_buffer->yy_ch_buf ) 01632 *--dest = *--source; 01633 01634 yy_cp += (int) (dest - source); 01635 yy_bp += (int) (dest - source); 01636 yy_current_buffer->yy_n_chars = 01637 yy_n_chars = yy_current_buffer->yy_buf_size; 01638 01639 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) 01640 YY_FATAL_ERROR( "flex scanner push-back overflow" ); 01641 } 01642 01643 *--yy_cp = (char) c; 01644 01645 01646 yytext_ptr = yy_bp; 01647 yy_hold_char = *yy_cp; 01648 yy_c_buf_p = yy_cp; 01649 } 01650 #endif /* ifndef YY_NO_UNPUT */ 01651 01652 01653 #ifndef YY_NO_INPUT 01654 #ifdef __cplusplus 01655 static int yyinput() 01656 #else 01657 static int input() 01658 #endif 01659 { 01660 int c; 01661 01662 *yy_c_buf_p = yy_hold_char; 01663 01664 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) 01665 { 01666 /* yy_c_buf_p now points to the character we want to return. 01667 * If this occurs *before* the EOB characters, then it's a 01668 * valid NUL; if not, then we've hit the end of the buffer. 01669 */ 01670 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) 01671 /* This was really a NUL. */ 01672 *yy_c_buf_p = '\0'; 01673 01674 else 01675 { /* need more input */ 01676 int offset = yy_c_buf_p - yytext_ptr; 01677 ++yy_c_buf_p; 01678 01679 switch ( yy_get_next_buffer() ) 01680 { 01681 case EOB_ACT_LAST_MATCH: 01682 /* This happens because yy_g_n_b() 01683 * sees that we've accumulated a 01684 * token and flags that we need to 01685 * try matching the token before 01686 * proceeding. But for input(), 01687 * there's no matching to consider. 01688 * So convert the EOB_ACT_LAST_MATCH 01689 * to EOB_ACT_END_OF_FILE. 01690 */ 01691 01692 /* Reset buffer status. */ 01693 yyrestart( yyin ); 01694 01695 /* fall through */ 01696 01697 case EOB_ACT_END_OF_FILE: 01698 { 01699 if ( yywrap() ) 01700 return EOF; 01701 01702 if ( ! yy_did_buffer_switch_on_eof ) 01703 YY_NEW_FILE; 01704 #ifdef __cplusplus 01705 return yyinput(); 01706 #else 01707 return input(); 01708 #endif 01709 } 01710 01711 case EOB_ACT_CONTINUE_SCAN: 01712 yy_c_buf_p = yytext_ptr + offset; 01713 break; 01714 } 01715 } 01716 } 01717 01718 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ 01719 *yy_c_buf_p = '\0'; /* preserve yytext */ 01720 yy_hold_char = *++yy_c_buf_p; 01721 01722 01723 return c; 01724 } 01725 #endif /* YY_NO_INPUT */ 01726 01727 #ifdef YY_USE_PROTOS 01728 void yyrestart( FILE *input_file ) 01729 #else 01730 void yyrestart( input_file ) 01731 FILE *input_file; 01732 #endif 01733 { 01734 if ( ! yy_current_buffer ) 01735 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); 01736 01737 yy_init_buffer( yy_current_buffer, input_file ); 01738 yy_load_buffer_state(); 01739 } 01740 01741 01742 #ifdef YY_USE_PROTOS 01743 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) 01744 #else 01745 void yy_switch_to_buffer( new_buffer ) 01746 YY_BUFFER_STATE new_buffer; 01747 #endif 01748 { 01749 if ( yy_current_buffer == new_buffer ) 01750 return; 01751 01752 if ( yy_current_buffer ) 01753 { 01754 /* Flush out information for old buffer. */ 01755 *yy_c_buf_p = yy_hold_char; 01756 yy_current_buffer->yy_buf_pos = yy_c_buf_p; 01757 yy_current_buffer->yy_n_chars = yy_n_chars; 01758 } 01759 01760 yy_current_buffer = new_buffer; 01761 yy_load_buffer_state(); 01762 01763 /* We don't actually know whether we did this switch during 01764 * EOF (yywrap()) processing, but the only time this flag 01765 * is looked at is after yywrap() is called, so it's safe 01766 * to go ahead and always set it. 01767 */ 01768 yy_did_buffer_switch_on_eof = 1; 01769 } 01770 01771 01772 #ifdef YY_USE_PROTOS 01773 void yy_load_buffer_state( void ) 01774 #else 01775 void yy_load_buffer_state() 01776 #endif 01777 { 01778 yy_n_chars = yy_current_buffer->yy_n_chars; 01779 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; 01780 yyin = yy_current_buffer->yy_input_file; 01781 yy_hold_char = *yy_c_buf_p; 01782 } 01783 01784 01785 #ifdef YY_USE_PROTOS 01786 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) 01787 #else 01788 YY_BUFFER_STATE yy_create_buffer( file, size ) 01789 FILE *file; 01790 int size; 01791 #endif 01792 { 01793 YY_BUFFER_STATE b; 01794 01795 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); 01796 if ( ! b ) 01797 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 01798 01799 b->yy_buf_size = size; 01800 01801 /* yy_ch_buf has to be 2 characters longer than the size given because 01802 * we need to put in 2 end-of-buffer characters. 01803 */ 01804 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); 01805 if ( ! b->yy_ch_buf ) 01806 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 01807 01808 b->yy_is_our_buffer = 1; 01809 01810 yy_init_buffer( b, file ); 01811 01812 return b; 01813 } 01814 01815 01816 #ifdef YY_USE_PROTOS 01817 void yy_delete_buffer( YY_BUFFER_STATE b ) 01818 #else 01819 void yy_delete_buffer( b ) 01820 YY_BUFFER_STATE b; 01821 #endif 01822 { 01823 if ( ! b ) 01824 return; 01825 01826 if ( b == yy_current_buffer ) 01827 yy_current_buffer = (YY_BUFFER_STATE) 0; 01828 01829 if ( b->yy_is_our_buffer ) 01830 yy_flex_free( (void *) b->yy_ch_buf ); 01831 01832 yy_flex_free( (void *) b ); 01833 } 01834 01835 01836 01837 #ifdef YY_USE_PROTOS 01838 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) 01839 #else 01840 void yy_init_buffer( b, file ) 01841 YY_BUFFER_STATE b; 01842 FILE *file; 01843 #endif 01844 01845 01846 { 01847 yy_flush_buffer( b ); 01848 01849 b->yy_input_file = file; 01850 b->yy_fill_buffer = 1; 01851 01852 #if YY_ALWAYS_INTERACTIVE 01853 b->yy_is_interactive = 1; 01854 #else 01855 #if YY_NEVER_INTERACTIVE 01856 b->yy_is_interactive = 0; 01857 #else 01858 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 01859 #endif 01860 #endif 01861 } 01862 01863 01864 #ifdef YY_USE_PROTOS 01865 void yy_flush_buffer( YY_BUFFER_STATE b ) 01866 #else 01867 void yy_flush_buffer( b ) 01868 YY_BUFFER_STATE b; 01869 #endif 01870 01871 { 01872 if ( ! b ) 01873 return; 01874 01875 b->yy_n_chars = 0; 01876 01877 /* We always need two end-of-buffer characters. The first causes 01878 * a transition to the end-of-buffer state. The second causes 01879 * a jam in that state. 01880 */ 01881 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 01882 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 01883 01884 b->yy_buf_pos = &b->yy_ch_buf[0]; 01885 01886 b->yy_at_bol = 1; 01887 b->yy_buffer_status = YY_BUFFER_NEW; 01888 01889 if ( b == yy_current_buffer ) 01890 yy_load_buffer_state(); 01891 } 01892 01893 01894 #ifndef YY_NO_SCAN_BUFFER 01895 #ifdef YY_USE_PROTOS 01896 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) 01897 #else 01898 YY_BUFFER_STATE yy_scan_buffer( base, size ) 01899 char *base; 01900 yy_size_t size; 01901 #endif 01902 { 01903 YY_BUFFER_STATE b; 01904 01905 if ( size < 2 || 01906 base[size-2] != YY_END_OF_BUFFER_CHAR || 01907 base[size-1] != YY_END_OF_BUFFER_CHAR ) 01908 /* They forgot to leave room for the EOB's. */ 01909 return 0; 01910 01911 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); 01912 if ( ! b ) 01913 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); 01914 01915 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ 01916 b->yy_buf_pos = b->yy_ch_buf = base; 01917 b->yy_is_our_buffer = 0; 01918 b->yy_input_file = 0; 01919 b->yy_n_chars = b->yy_buf_size; 01920 b->yy_is_interactive = 0; 01921 b->yy_at_bol = 1; 01922 b->yy_fill_buffer = 0; 01923 b->yy_buffer_status = YY_BUFFER_NEW; 01924 01925 yy_switch_to_buffer( b ); 01926 01927 return b; 01928 } 01929 #endif 01930 01931 01932 #ifndef YY_NO_SCAN_STRING 01933 #ifdef YY_USE_PROTOS 01934 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) 01935 #else 01936 YY_BUFFER_STATE yy_scan_string( yy_str ) 01937 yyconst char *yy_str; 01938 #endif 01939 { 01940 int len; 01941 for ( len = 0; yy_str[len]; ++len ) 01942 ; 01943 01944 return yy_scan_bytes( yy_str, len ); 01945 } 01946 #endif 01947 01948 01949 #ifndef YY_NO_SCAN_BYTES 01950 #ifdef YY_USE_PROTOS 01951 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) 01952 #else 01953 YY_BUFFER_STATE yy_scan_bytes( bytes, len ) 01954 yyconst char *bytes; 01955 int len; 01956 #endif 01957 { 01958 YY_BUFFER_STATE b; 01959 char *buf; 01960 yy_size_t n; 01961 int i; 01962 01963 /* Get memory for full buffer, including space for trailing EOB's. */ 01964 n = len + 2; 01965 buf = (char *) yy_flex_alloc( n ); 01966 if ( ! buf ) 01967 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); 01968 01969 for ( i = 0; i < len; ++i ) 01970 buf[i] = bytes[i]; 01971 01972 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; 01973 01974 b = yy_scan_buffer( buf, n ); 01975 if ( ! b ) 01976 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); 01977 01978 /* It's okay to grow etc. this buffer, and we should throw it 01979 * away when we're done. 01980 */ 01981 b->yy_is_our_buffer = 1; 01982 01983 return b; 01984 } 01985 #endif 01986 01987 01988 #ifndef YY_NO_PUSH_STATE 01989 #ifdef YY_USE_PROTOS 01990 static void yy_push_state( int new_state ) 01991 #else 01992 static void yy_push_state( new_state ) 01993 int new_state; 01994 #endif 01995 { 01996 if ( yy_start_stack_ptr >= yy_start_stack_depth ) 01997 { 01998 yy_size_t new_size; 01999 02000 yy_start_stack_depth += YY_START_STACK_INCR; 02001 new_size = yy_start_stack_depth * sizeof( int ); 02002 02003 if ( ! yy_start_stack ) 02004 yy_start_stack = (int *) yy_flex_alloc( new_size ); 02005 02006 else 02007 yy_start_stack = (int *) yy_flex_realloc( 02008 (void *) yy_start_stack, new_size ); 02009 02010 if ( ! yy_start_stack ) 02011 YY_FATAL_ERROR( 02012 "out of memory expanding start-condition stack" ); 02013 } 02014 02015 yy_start_stack[yy_start_stack_ptr++] = YY_START; 02016 02017 BEGIN(new_state); 02018 } 02019 #endif 02020 02021 02022 #ifndef YY_NO_POP_STATE 02023 static void yy_pop_state() 02024 { 02025 if ( --yy_start_stack_ptr < 0 ) 02026 YY_FATAL_ERROR( "start-condition stack underflow" ); 02027 02028 BEGIN(yy_start_stack[yy_start_stack_ptr]); 02029 } 02030 #endif 02031 02032 02033 #ifndef YY_NO_TOP_STATE 02034 static int yy_top_state() 02035 { 02036 return yy_start_stack[yy_start_stack_ptr - 1]; 02037 } 02038 #endif 02039 02040 #ifndef YY_EXIT_FAILURE 02041 #define YY_EXIT_FAILURE 2 02042 #endif 02043 02044 #ifdef YY_USE_PROTOS 02045 static void yy_fatal_error( yyconst char msg[] ) 02046 #else 02047 static void yy_fatal_error( msg ) 02048 char msg[]; 02049 #endif 02050 { 02051 (void) fprintf( stderr, "%s\n", msg ); 02052 exit( YY_EXIT_FAILURE ); 02053 } 02054 02055 02056 02057 /* Redefine yyless() so it works in section 3 code. */ 02058 02059 #undef yyless 02060 #define yyless(n) \ 02061 do \ 02062 { \ 02063 /* Undo effects of setting up yytext. */ \ 02064 yytext[yyleng] = yy_hold_char; \ 02065 yy_c_buf_p = yytext + n; \ 02066 yy_hold_char = *yy_c_buf_p; \ 02067 *yy_c_buf_p = '\0'; \ 02068 yyleng = n; \ 02069 } \ 02070 while ( 0 ) 02071 02072 02073 /* Internal utility routines. */ 02074 02075 #ifndef yytext_ptr 02076 #ifdef YY_USE_PROTOS 02077 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) 02078 #else 02079 static void yy_flex_strncpy( s1, s2, n ) 02080 char *s1; 02081 yyconst char *s2; 02082 int n; 02083 #endif 02084 { 02085 register int i; 02086 for ( i = 0; i < n; ++i ) 02087 s1[i] = s2[i]; 02088 } 02089 #endif 02090 02091 #ifdef YY_NEED_STRLEN 02092 #ifdef YY_USE_PROTOS 02093 static int yy_flex_strlen( yyconst char *s ) 02094 #else 02095 static int yy_flex_strlen( s ) 02096 yyconst char *s; 02097 #endif 02098 { 02099 register int n; 02100 for ( n = 0; s[n]; ++n ) 02101 ; 02102 02103 return n; 02104 } 02105 #endif 02106 02107 02108 #ifdef YY_USE_PROTOS 02109 static void *yy_flex_alloc( yy_size_t size ) 02110 #else 02111 static void *yy_flex_alloc( size ) 02112 yy_size_t size; 02113 #endif 02114 { 02115 return (void *) malloc( size ); 02116 } 02117 02118 #ifdef YY_USE_PROTOS 02119 static void *yy_flex_realloc( void *ptr, yy_size_t size ) 02120 #else 02121 static void *yy_flex_realloc( ptr, size ) 02122 void *ptr; 02123 yy_size_t size; 02124 #endif 02125 { 02126 /* The cast to (char *) in the following accommodates both 02127 * implementations that use char* generic pointers, and those 02128 * that use void* generic pointers. It works with the latter 02129 * because both ANSI C and C++ allow castless assignment from 02130 * any pointer type to void*, and deal with argument conversions 02131 * as though doing an assignment. 02132 */ 02133 return (void *) realloc( (char *) ptr, size ); 02134 } 02135 02136 #ifdef YY_USE_PROTOS 02137 static void yy_flex_free( void *ptr ) 02138 #else 02139 static void yy_flex_free( ptr ) 02140 void *ptr; 02141 #endif 02142 { 02143 free( ptr ); 02144 } 02145 02146 #if YY_MAIN 02147 int main() 02148 { 02149 yylex(); 02150 return 0; 02151 } 02152 #endif 02153 #line 162 "SqlScanner.l" 02154 02155 02156 void 02157 yyerror(const char *s) 02158 { 02159 // delete PxxPtree; 02160 // TODO: In case of an error, clean up the allocated structure! 02161 // Must somehow keep track of all the allocations and clean these up 02162 printf("YYERROR: Line %d: %s at %s\n", lineno, s, yytext); 02163 if (yyin) yyrestart(yyin); 02164 } 02165 02166 // TODO: Change the scope of this function from global 02167 void PxxIgnoring(char* feature) 02168 { 02169 printf("Warning: At line %d, ignoring <%s>, Feature \"%s\" not supported.\n", lineno, yytext, feature); 02170 } 02171 02172 // TODO: Change the scope of this function from global 02173 void PxxNotSupported(const char* feature) 02174 { 02175 printf("Error: At line %d, token <%s>, Feature \"%s\" not supported.\n", lineno, yytext, feature); 02176 Utilities::Quit(); 02177 02178 // if Utilities::Quit didn't exit, then print a warning and quit 02179 cerr << "*** ERROR: Utilities::Quit failed to exit. ***" << endl; 02180 02181 exit(1); 02182 02183 // assert(!"Language Feature not supported"); 02184 } 02185 02186 int yywrap() 02187 { 02188 return 1; 02189 }