GRASS Programmer's Manual 6.4.1(2011)
|
00001 00002 #line 3 "lex.yy.c" 00003 00004 #define YY_INT_ALIGNED short int 00005 00006 /* A lexical scanner generated by flex */ 00007 00008 #define FLEX_SCANNER 00009 #define YY_FLEX_MAJOR_VERSION 2 00010 #define YY_FLEX_MINOR_VERSION 5 00011 #define YY_FLEX_SUBMINOR_VERSION 35 00012 #if YY_FLEX_SUBMINOR_VERSION > 0 00013 #define FLEX_BETA 00014 #endif 00015 00016 /* First, we deal with platform-specific or compiler-specific issues. */ 00017 00018 /* begin standard C headers. */ 00019 #include <stdio.h> 00020 #include <string.h> 00021 #include <errno.h> 00022 #include <stdlib.h> 00023 00024 /* end standard C headers. */ 00025 00026 /* flex integer type definitions */ 00027 00028 #ifndef FLEXINT_H 00029 #define FLEXINT_H 00030 00031 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ 00032 00033 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 00034 00035 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, 00036 * if you want the limit (max/min) macros for int types. 00037 */ 00038 #ifndef __STDC_LIMIT_MACROS 00039 #define __STDC_LIMIT_MACROS 1 00040 #endif 00041 00042 #include <inttypes.h> 00043 typedef int8_t flex_int8_t; 00044 typedef uint8_t flex_uint8_t; 00045 typedef int16_t flex_int16_t; 00046 typedef uint16_t flex_uint16_t; 00047 typedef int32_t flex_int32_t; 00048 typedef uint32_t flex_uint32_t; 00049 #else 00050 typedef signed char flex_int8_t; 00051 typedef short int flex_int16_t; 00052 typedef int flex_int32_t; 00053 typedef unsigned char flex_uint8_t; 00054 typedef unsigned short int flex_uint16_t; 00055 typedef unsigned int flex_uint32_t; 00056 00057 /* Limits of integral types. */ 00058 #ifndef INT8_MIN 00059 #define INT8_MIN (-128) 00060 #endif 00061 #ifndef INT16_MIN 00062 #define INT16_MIN (-32767-1) 00063 #endif 00064 #ifndef INT32_MIN 00065 #define INT32_MIN (-2147483647-1) 00066 #endif 00067 #ifndef INT8_MAX 00068 #define INT8_MAX (127) 00069 #endif 00070 #ifndef INT16_MAX 00071 #define INT16_MAX (32767) 00072 #endif 00073 #ifndef INT32_MAX 00074 #define INT32_MAX (2147483647) 00075 #endif 00076 #ifndef UINT8_MAX 00077 #define UINT8_MAX (255U) 00078 #endif 00079 #ifndef UINT16_MAX 00080 #define UINT16_MAX (65535U) 00081 #endif 00082 #ifndef UINT32_MAX 00083 #define UINT32_MAX (4294967295U) 00084 #endif 00085 00086 #endif /* ! C99 */ 00087 00088 #endif /* ! FLEXINT_H */ 00089 00090 #ifdef __cplusplus 00091 00092 /* The "const" storage-class-modifier is valid. */ 00093 #define YY_USE_CONST 00094 00095 #else /* ! __cplusplus */ 00096 00097 /* C99 requires __STDC__ to be defined as 1. */ 00098 #if defined (__STDC__) 00099 00100 #define YY_USE_CONST 00101 00102 #endif /* defined (__STDC__) */ 00103 #endif /* ! __cplusplus */ 00104 00105 #ifdef YY_USE_CONST 00106 #define yyconst const 00107 #else 00108 #define yyconst 00109 #endif 00110 00111 /* Returned upon end-of-file. */ 00112 #define YY_NULL 0 00113 00114 /* Promotes a possibly negative, possibly signed char to an unsigned 00115 * integer for use as an array index. If the signed char is negative, 00116 * we want to instead treat it as an 8-bit unsigned char, hence the 00117 * double cast. 00118 */ 00119 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) 00120 00121 /* Enter a start condition. This macro really ought to take a parameter, 00122 * but we do it the disgusting crufty way forced on us by the ()-less 00123 * definition of BEGIN. 00124 */ 00125 #define BEGIN (yy_start) = 1 + 2 * 00126 00127 /* Translate the current start state into a value that can be later handed 00128 * to BEGIN to return to the state. The YYSTATE alias is for lex 00129 * compatibility. 00130 */ 00131 #define YY_START (((yy_start) - 1) / 2) 00132 #define YYSTATE YY_START 00133 00134 /* Action number for EOF rule of a given start state. */ 00135 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 00136 00137 /* Special action meaning "start processing a new file". */ 00138 #define YY_NEW_FILE yyrestart(yyin ) 00139 00140 #define YY_END_OF_BUFFER_CHAR 0 00141 00142 /* Size of default input buffer. */ 00143 #ifndef YY_BUF_SIZE 00144 #ifdef __ia64__ 00145 /* On IA-64, the buffer size is 16k, not 8k. 00146 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. 00147 * Ditto for the __ia64__ case accordingly. 00148 */ 00149 #define YY_BUF_SIZE 32768 00150 #else 00151 #define YY_BUF_SIZE 16384 00152 #endif /* __ia64__ */ 00153 #endif 00154 00155 /* The state buf must be large enough to hold one state per character in the main buffer. 00156 */ 00157 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) 00158 00159 #ifndef YY_TYPEDEF_YY_BUFFER_STATE 00160 #define YY_TYPEDEF_YY_BUFFER_STATE 00161 typedef struct yy_buffer_state *YY_BUFFER_STATE; 00162 #endif 00163 00164 extern int yyleng; 00165 00166 extern FILE *yyin, *yyout; 00167 00168 #define EOB_ACT_CONTINUE_SCAN 0 00169 #define EOB_ACT_END_OF_FILE 1 00170 #define EOB_ACT_LAST_MATCH 2 00171 00172 #define YY_LESS_LINENO(n) 00173 00174 /* Return all but the first "n" matched characters back to the input stream. */ 00175 #define yyless(n) \ 00176 do \ 00177 { \ 00178 /* Undo effects of setting up yytext. */ \ 00179 int yyless_macro_arg = (n); \ 00180 YY_LESS_LINENO(yyless_macro_arg);\ 00181 *yy_cp = (yy_hold_char); \ 00182 YY_RESTORE_YY_MORE_OFFSET \ 00183 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ 00184 YY_DO_BEFORE_ACTION; /* set up yytext again */ \ 00185 } \ 00186 while ( 0 ) 00187 00188 #define unput(c) yyunput( c, (yytext_ptr) ) 00189 00190 #ifndef YY_TYPEDEF_YY_SIZE_T 00191 #define YY_TYPEDEF_YY_SIZE_T 00192 typedef size_t yy_size_t; 00193 #endif 00194 00195 #ifndef YY_STRUCT_YY_BUFFER_STATE 00196 #define YY_STRUCT_YY_BUFFER_STATE 00197 struct yy_buffer_state 00198 { 00199 FILE *yy_input_file; 00200 00201 char *yy_ch_buf; /* input buffer */ 00202 char *yy_buf_pos; /* current position in input buffer */ 00203 00204 /* Size of input buffer in bytes, not including room for EOB 00205 * characters. 00206 */ 00207 yy_size_t yy_buf_size; 00208 00209 /* Number of characters read into yy_ch_buf, not including EOB 00210 * characters. 00211 */ 00212 int yy_n_chars; 00213 00214 /* Whether we "own" the buffer - i.e., we know we created it, 00215 * and can realloc() it to grow it, and should free() it to 00216 * delete it. 00217 */ 00218 int yy_is_our_buffer; 00219 00220 /* Whether this is an "interactive" input source; if so, and 00221 * if we're using stdio for input, then we want to use getc() 00222 * instead of fread(), to make sure we stop fetching input after 00223 * each newline. 00224 */ 00225 int yy_is_interactive; 00226 00227 /* Whether we're considered to be at the beginning of a line. 00228 * If so, '^' rules will be active on the next match, otherwise 00229 * not. 00230 */ 00231 int yy_at_bol; 00232 00233 int yy_bs_lineno; 00234 int yy_bs_column; 00236 /* Whether to try to fill the input buffer when we reach the 00237 * end of it. 00238 */ 00239 int yy_fill_buffer; 00240 00241 int yy_buffer_status; 00242 00243 #define YY_BUFFER_NEW 0 00244 #define YY_BUFFER_NORMAL 1 00245 /* When an EOF's been seen but there's still some text to process 00246 * then we mark the buffer as YY_EOF_PENDING, to indicate that we 00247 * shouldn't try reading from the input source any more. We might 00248 * still have a bunch of tokens to match, though, because of 00249 * possible backing-up. 00250 * 00251 * When we actually see the EOF, we change the status to "new" 00252 * (via yyrestart()), so that the user can continue scanning by 00253 * just pointing yyin at a new input file. 00254 */ 00255 #define YY_BUFFER_EOF_PENDING 2 00256 00257 }; 00258 #endif /* !YY_STRUCT_YY_BUFFER_STATE */ 00259 00260 /* Stack of input buffers. */ 00261 static size_t yy_buffer_stack_top = 0; 00262 static size_t yy_buffer_stack_max = 0; 00263 static YY_BUFFER_STATE * yy_buffer_stack = 0; 00265 /* We provide macros for accessing buffer states in case in the 00266 * future we want to put the buffer states in a more general 00267 * "scanner state". 00268 * 00269 * Returns the top of the stack, or NULL. 00270 */ 00271 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ 00272 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ 00273 : NULL) 00274 00275 /* Same as previous macro, but useful when we know that the buffer stack is not 00276 * NULL or when we need an lvalue. For internal use only. 00277 */ 00278 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] 00279 00280 /* yy_hold_char holds the character lost when yytext is formed. */ 00281 static char yy_hold_char; 00282 static int yy_n_chars; /* number of characters read into yy_ch_buf */ 00283 int yyleng; 00284 00285 /* Points to current character in buffer. */ 00286 static char *yy_c_buf_p = (char *) 0; 00287 static int yy_init = 0; /* whether we need to initialize */ 00288 static int yy_start = 0; /* start state number */ 00289 00290 /* Flag which is used to allow yywrap()'s to do buffer switches 00291 * instead of setting up a fresh yyin. A bit of a hack ... 00292 */ 00293 static int yy_did_buffer_switch_on_eof; 00294 00295 void yyrestart (FILE *input_file ); 00296 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); 00297 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); 00298 void yy_delete_buffer (YY_BUFFER_STATE b ); 00299 void yy_flush_buffer (YY_BUFFER_STATE b ); 00300 void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); 00301 void yypop_buffer_state (void ); 00302 00303 static void yyensure_buffer_stack (void ); 00304 static void yy_load_buffer_state (void ); 00305 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); 00306 00307 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) 00308 00309 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); 00310 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); 00311 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); 00312 00313 void *yyalloc (yy_size_t ); 00314 void *yyrealloc (void *,yy_size_t ); 00315 void yyfree (void * ); 00316 00317 #define yy_new_buffer yy_create_buffer 00318 00319 #define yy_set_interactive(is_interactive) \ 00320 { \ 00321 if ( ! YY_CURRENT_BUFFER ){ \ 00322 yyensure_buffer_stack (); \ 00323 YY_CURRENT_BUFFER_LVALUE = \ 00324 yy_create_buffer(yyin,YY_BUF_SIZE ); \ 00325 } \ 00326 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ 00327 } 00328 00329 #define yy_set_bol(at_bol) \ 00330 { \ 00331 if ( ! YY_CURRENT_BUFFER ){\ 00332 yyensure_buffer_stack (); \ 00333 YY_CURRENT_BUFFER_LVALUE = \ 00334 yy_create_buffer(yyin,YY_BUF_SIZE ); \ 00335 } \ 00336 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ 00337 } 00338 00339 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 00340 00341 /* Begin user sect3 */ 00342 00343 typedef unsigned char YY_CHAR; 00344 00345 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; 00346 00347 typedef int yy_state_type; 00348 00349 extern int yylineno; 00350 00351 int yylineno = 1; 00352 00353 extern char *yytext; 00354 #define yytext_ptr yytext 00355 00356 static yy_state_type yy_get_previous_state (void ); 00357 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); 00358 static int yy_get_next_buffer (void ); 00359 static void yy_fatal_error (yyconst char msg[] ); 00360 00361 /* Done after the current pattern has been matched and before the 00362 * corresponding action - sets up yytext. 00363 */ 00364 #define YY_DO_BEFORE_ACTION \ 00365 (yytext_ptr) = yy_bp; \ 00366 (yytext_ptr) -= (yy_more_len); \ 00367 yyleng = (size_t) (yy_cp - (yytext_ptr)); \ 00368 (yy_hold_char) = *yy_cp; \ 00369 *yy_cp = '\0'; \ 00370 (yy_c_buf_p) = yy_cp; 00371 00372 #define YY_NUM_RULES 53 00373 #define YY_END_OF_BUFFER 54 00374 /* This struct is not used in this scanner, 00375 but its presence is necessary. */ 00376 struct yy_trans_info 00377 { 00378 flex_int32_t yy_verify; 00379 flex_int32_t yy_nxt; 00380 }; 00381 static yyconst flex_int16_t yy_accept[164] = 00382 { 0, 00383 0, 0, 54, 53, 51, 50, 53, 40, 40, 40, 00384 42, 35, 33, 36, 41, 41, 41, 41, 41, 41, 00385 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 00386 39, 51, 0, 49, 48, 0, 43, 0, 44, 42, 00387 0, 37, 34, 38, 41, 41, 41, 41, 41, 28, 00388 41, 41, 41, 41, 41, 41, 41, 41, 31, 41, 00389 41, 41, 25, 41, 41, 41, 41, 41, 41, 41, 00390 0, 0, 52, 0, 47, 44, 0, 0, 45, 1, 00391 41, 13, 29, 41, 41, 41, 41, 41, 41, 41, 00392 41, 41, 19, 41, 26, 41, 41, 41, 41, 9, 00393 00394 41, 41, 41, 41, 41, 41, 0, 46, 41, 41, 00395 41, 23, 41, 30, 41, 15, 5, 41, 41, 7, 00396 32, 17, 41, 41, 41, 41, 24, 41, 41, 41, 00397 41, 2, 41, 41, 41, 41, 41, 41, 27, 41, 00398 41, 16, 41, 41, 41, 12, 3, 14, 4, 21, 00399 6, 41, 41, 8, 10, 11, 41, 20, 41, 18, 00400 41, 22, 0 00401 } ; 00402 00403 static yyconst flex_int32_t yy_ec[256] = 00404 { 0, 00405 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 00406 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 00407 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00408 1, 2, 1, 1, 1, 1, 1, 1, 4, 5, 00409 5, 5, 6, 5, 7, 8, 5, 9, 9, 9, 00410 9, 9, 9, 9, 9, 9, 9, 5, 5, 10, 00411 11, 12, 1, 1, 13, 14, 15, 16, 17, 18, 00412 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 00413 22, 29, 30, 31, 32, 33, 34, 22, 35, 22, 00414 1, 1, 1, 1, 36, 1, 13, 14, 15, 16, 00415 00416 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 00417 27, 28, 22, 29, 30, 31, 32, 33, 34, 22, 00418 35, 22, 1, 1, 1, 37, 1, 1, 1, 1, 00419 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00420 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00421 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00422 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00423 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00424 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00425 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00426 00427 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00428 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00429 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00430 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00431 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00432 1, 1, 1, 1, 1 00433 } ; 00434 00435 static yyconst flex_int32_t yy_meta[38] = 00436 { 0, 00437 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 00438 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 00439 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00440 2, 2, 2, 2, 2, 2, 1 00441 } ; 00442 00443 static yyconst flex_int16_t yy_base[168] = 00444 { 0, 00445 0, 0, 194, 195, 191, 195, 35, 195, 185, 31, 00446 33, 32, 195, 180, 29, 155, 20, 39, 0, 160, 00447 28, 167, 19, 158, 157, 168, 44, 156, 170, 162, 00448 195, 179, 57, 176, 195, 176, 53, 65, 58, 68, 00449 72, 195, 195, 195, 0, 162, 146, 160, 160, 0, 00450 150, 156, 141, 39, 139, 143, 142, 52, 0, 145, 00451 136, 142, 149, 147, 49, 149, 137, 145, 60, 143, 00452 155, 155, 195, 148, 147, 77, 81, 146, 145, 0, 00453 136, 0, 0, 120, 138, 133, 132, 133, 133, 118, 00454 120, 127, 74, 126, 0, 118, 124, 125, 122, 0, 00455 00456 114, 120, 123, 103, 119, 104, 123, 122, 101, 104, 00457 97, 0, 96, 0, 102, 0, 0, 96, 105, 0, 00458 0, 0, 94, 101, 106, 103, 0, 88, 101, 97, 00459 99, 0, 89, 97, 96, 95, 80, 93, 0, 79, 00460 77, 0, 83, 69, 85, 0, 0, 0, 0, 0, 00461 0, 68, 75, 0, 0, 0, 66, 0, 66, 0, 00462 66, 0, 195, 101, 62, 103, 105 00463 } ; 00464 00465 static yyconst flex_int16_t yy_def[168] = 00466 { 0, 00467 163, 1, 163, 163, 163, 163, 164, 163, 163, 163, 00468 163, 163, 163, 163, 165, 165, 165, 165, 165, 165, 00469 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 00470 163, 163, 164, 166, 163, 167, 163, 163, 163, 163, 00471 163, 163, 163, 163, 165, 165, 165, 165, 165, 165, 00472 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 00473 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 00474 166, 167, 163, 163, 163, 163, 163, 163, 163, 165, 00475 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 00476 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 00477 00478 165, 165, 165, 165, 165, 165, 163, 163, 165, 165, 00479 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 00480 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 00481 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 00482 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 00483 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 00484 165, 165, 0, 163, 163, 163, 163 00485 } ; 00486 00487 static yyconst flex_int16_t yy_nxt[233] = 00488 { 0, 00489 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, 00490 13, 14, 15, 16, 17, 18, 19, 20, 19, 19, 00491 21, 19, 19, 22, 19, 23, 24, 25, 19, 26, 00492 27, 28, 29, 30, 19, 4, 31, 34, 35, 37, 00493 39, 40, 42, 43, 46, 61, 51, 38, 52, 41, 00494 62, 53, 47, 58, 48, 54, 66, 59, 49, 34, 00495 35, 37, 87, 45, 67, 55, 76, 56, 88, 38, 00496 74, 74, 99, 75, 77, 39, 40, 78, 78, 100, 00497 79, 92, 93, 104, 41, 76, 107, 107, 105, 108, 00498 119, 162, 161, 77, 160, 159, 158, 157, 156, 155, 00499 00500 120, 33, 33, 71, 71, 72, 72, 154, 153, 152, 00501 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, 00502 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 00503 108, 108, 131, 130, 129, 128, 127, 126, 125, 124, 00504 123, 122, 121, 118, 117, 116, 115, 114, 113, 112, 00505 111, 110, 109, 79, 79, 75, 75, 73, 35, 106, 00506 103, 102, 101, 98, 97, 96, 95, 94, 91, 90, 00507 89, 86, 85, 84, 83, 82, 81, 80, 73, 35, 00508 32, 70, 69, 68, 65, 64, 63, 60, 57, 50, 00509 44, 36, 32, 163, 3, 163, 163, 163, 163, 163, 00510 00511 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 00512 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 00513 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 00514 163, 163 00515 } ; 00516 00517 static yyconst flex_int16_t yy_chk[233] = 00518 { 0, 00519 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00520 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00521 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00522 1, 1, 1, 1, 1, 1, 1, 7, 7, 10, 00523 11, 11, 12, 12, 15, 23, 17, 10, 17, 11, 00524 23, 18, 15, 21, 15, 18, 27, 21, 15, 33, 00525 33, 37, 54, 165, 27, 18, 39, 18, 54, 37, 00526 38, 38, 65, 38, 39, 40, 40, 41, 41, 65, 00527 41, 58, 58, 69, 40, 76, 77, 77, 69, 77, 00528 93, 161, 159, 76, 157, 153, 152, 145, 144, 143, 00529 00530 93, 164, 164, 166, 166, 167, 167, 141, 140, 138, 00531 137, 136, 135, 134, 133, 131, 130, 129, 128, 126, 00532 125, 124, 123, 119, 118, 115, 113, 111, 110, 109, 00533 108, 107, 106, 105, 104, 103, 102, 101, 99, 98, 00534 97, 96, 94, 92, 91, 90, 89, 88, 87, 86, 00535 85, 84, 81, 79, 78, 75, 74, 72, 71, 70, 00536 68, 67, 66, 64, 63, 62, 61, 60, 57, 56, 00537 55, 53, 52, 51, 49, 48, 47, 46, 36, 34, 00538 32, 30, 29, 28, 26, 25, 24, 22, 20, 16, 00539 14, 9, 5, 3, 163, 163, 163, 163, 163, 163, 00540 00541 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 00542 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 00543 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 00544 163, 163 00545 } ; 00546 00547 static yy_state_type yy_last_accepting_state; 00548 static char *yy_last_accepting_cpos; 00549 00550 extern int yy_flex_debug; 00551 int yy_flex_debug = 0; 00552 00553 /* The intent behind this definition is that it'll catch 00554 * any uses of REJECT which flex missed. 00555 */ 00556 #define REJECT reject_used_but_not_detected 00557 static int yy_more_flag = 0; 00558 static int yy_more_len = 0; 00559 #define yymore() ((yy_more_flag) = 1) 00560 #define YY_MORE_ADJ (yy_more_len) 00561 #define YY_RESTORE_YY_MORE_OFFSET 00562 char *yytext; 00563 #line 1 "lex.l" 00564 /***************************************************************************** 00565 * 00566 * MODULE: SQL statement parser library 00567 * 00568 * AUTHOR(S): lex.l and yac.y were originaly taken from unixODBC and 00569 * probably written by Peter Harvey <pharvey@codebydesigns.com>, 00570 * modifications and other code by Radim Blazek 00571 * 00572 * PURPOSE: Parse input string containing SQL statement to 00573 * SQLPSTMT structure. 00574 * SQL parser may be used by simple database drivers. 00575 * 00576 * COPYRIGHT: (C) 2000 by the GRASS Development Team 00577 * 00578 * This program is free software under the GNU General Public 00579 * License (>=v2). Read the file COPYING that comes with GRASS 00580 * for details. 00581 * 00582 *****************************************************************************/ 00583 /**************** C-CODE *****************/ 00584 #line 24 "lex.l" 00585 #include <grass/sqlp.h> 00586 #include "y.tab.h" 00587 #include <string.h> 00588 00589 #undef YY_INPUT 00590 #define YY_INPUT(b, r, ms) (r = my_yyinput(b, ms)) 00591 00592 /*************** LEX HEADER **************/ 00593 /**************** LEX BODY ****************/ 00594 #line 595 "lex.yy.c" 00595 00596 #define INITIAL 0 00597 00598 #ifndef YY_NO_UNISTD_H 00599 /* Special case for "unistd.h", since it is non-ANSI. We include it way 00600 * down here because we want the user's section 1 to have been scanned first. 00601 * The user has a chance to override it with an option. 00602 */ 00603 #include <unistd.h> 00604 #endif 00605 00606 #ifndef YY_EXTRA_TYPE 00607 #define YY_EXTRA_TYPE void * 00608 #endif 00609 00610 static int yy_init_globals (void ); 00611 00612 /* Accessor methods to globals. 00613 These are made visible to non-reentrant scanners for convenience. */ 00614 00615 int yylex_destroy (void ); 00616 00617 int yyget_debug (void ); 00618 00619 void yyset_debug (int debug_flag ); 00620 00621 YY_EXTRA_TYPE yyget_extra (void ); 00622 00623 void yyset_extra (YY_EXTRA_TYPE user_defined ); 00624 00625 FILE *yyget_in (void ); 00626 00627 void yyset_in (FILE * in_str ); 00628 00629 FILE *yyget_out (void ); 00630 00631 void yyset_out (FILE * out_str ); 00632 00633 int yyget_leng (void ); 00634 00635 char *yyget_text (void ); 00636 00637 int yyget_lineno (void ); 00638 00639 void yyset_lineno (int line_number ); 00640 00641 /* Macros after this point can all be overridden by user definitions in 00642 * section 1. 00643 */ 00644 00645 #ifndef YY_SKIP_YYWRAP 00646 #ifdef __cplusplus 00647 extern "C" int yywrap (void ); 00648 #else 00649 extern int yywrap (void ); 00650 #endif 00651 #endif 00652 00653 static void yyunput (int c,char *buf_ptr ); 00654 00655 #ifndef yytext_ptr 00656 static void yy_flex_strncpy (char *,yyconst char *,int ); 00657 #endif 00658 00659 #ifdef YY_NEED_STRLEN 00660 static int yy_flex_strlen (yyconst char * ); 00661 #endif 00662 00663 #ifndef YY_NO_INPUT 00664 00665 #ifdef __cplusplus 00666 static int yyinput (void ); 00667 #else 00668 static int input (void ); 00669 #endif 00670 00671 #endif 00672 00673 /* Amount of stuff to slurp up with each read. */ 00674 #ifndef YY_READ_BUF_SIZE 00675 #ifdef __ia64__ 00676 /* On IA-64, the buffer size is 16k, not 8k */ 00677 #define YY_READ_BUF_SIZE 16384 00678 #else 00679 #define YY_READ_BUF_SIZE 8192 00680 #endif /* __ia64__ */ 00681 #endif 00682 00683 /* Copy whatever the last rule matched to the standard output. */ 00684 #ifndef ECHO 00685 /* This used to be an fputs(), but since the string might contain NUL's, 00686 * we now use fwrite(). 00687 */ 00688 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) 00689 #endif 00690 00691 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 00692 * is returned in "result". 00693 */ 00694 #ifndef YY_INPUT 00695 #define YY_INPUT(buf,result,max_size) \ 00696 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 00697 { \ 00698 int c = '*'; \ 00699 size_t n; \ 00700 for ( n = 0; n < max_size && \ 00701 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 00702 buf[n] = (char) c; \ 00703 if ( c == '\n' ) \ 00704 buf[n++] = (char) c; \ 00705 if ( c == EOF && ferror( yyin ) ) \ 00706 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 00707 result = n; \ 00708 } \ 00709 else \ 00710 { \ 00711 errno=0; \ 00712 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ 00713 { \ 00714 if( errno != EINTR) \ 00715 { \ 00716 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 00717 break; \ 00718 } \ 00719 errno=0; \ 00720 clearerr(yyin); \ 00721 } \ 00722 }\ 00723 \ 00724 00725 #endif 00726 00727 /* No semi-colon after return; correct usage is to write "yyterminate();" - 00728 * we don't want an extra ';' after the "return" because that will cause 00729 * some compilers to complain about unreachable statements. 00730 */ 00731 #ifndef yyterminate 00732 #define yyterminate() return YY_NULL 00733 #endif 00734 00735 /* Number of entries by which start-condition stack grows. */ 00736 #ifndef YY_START_STACK_INCR 00737 #define YY_START_STACK_INCR 25 00738 #endif 00739 00740 /* Report a fatal error. */ 00741 #ifndef YY_FATAL_ERROR 00742 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) 00743 #endif 00744 00745 /* end tables serialization structures and prototypes */ 00746 00747 /* Default declaration of generated scanner - a define so the user can 00748 * easily add parameters. 00749 */ 00750 #ifndef YY_DECL 00751 #define YY_DECL_IS_OURS 1 00752 00753 extern int yylex (void); 00754 00755 #define YY_DECL int yylex (void) 00756 #endif /* !YY_DECL */ 00757 00758 /* Code executed at the beginning of each rule, after yytext and yyleng 00759 * have been set up. 00760 */ 00761 #ifndef YY_USER_ACTION 00762 #define YY_USER_ACTION 00763 #endif 00764 00765 /* Code executed at the end of each rule. */ 00766 #ifndef YY_BREAK 00767 #define YY_BREAK break; 00768 #endif 00769 00770 #define YY_RULE_SETUP \ 00771 YY_USER_ACTION 00772 00775 YY_DECL 00776 { 00777 register yy_state_type yy_current_state; 00778 register char *yy_cp, *yy_bp; 00779 register int yy_act; 00780 00781 #line 38 "lex.l" 00782 00783 00784 /*************************************** 00785 * LITERALS KEYWORDS TOKENS 00786 ***************************************/ 00787 00788 /* following case insensitives are ugly 00789 but I do not know better at this time */ 00790 00791 #line 792 "lex.yy.c" 00792 00793 if ( !(yy_init) ) 00794 { 00795 (yy_init) = 1; 00796 00797 #ifdef YY_USER_INIT 00798 YY_USER_INIT; 00799 #endif 00800 00801 if ( ! (yy_start) ) 00802 (yy_start) = 1; /* first start state */ 00803 00804 if ( ! yyin ) 00805 yyin = stdin; 00806 00807 if ( ! yyout ) 00808 yyout = stdout; 00809 00810 if ( ! YY_CURRENT_BUFFER ) { 00811 yyensure_buffer_stack (); 00812 YY_CURRENT_BUFFER_LVALUE = 00813 yy_create_buffer(yyin,YY_BUF_SIZE ); 00814 } 00815 00816 yy_load_buffer_state( ); 00817 } 00818 00819 while ( 1 ) /* loops until end-of-file is reached */ 00820 { 00821 (yy_more_len) = 0; 00822 if ( (yy_more_flag) ) 00823 { 00824 (yy_more_len) = (yy_c_buf_p) - (yytext_ptr); 00825 (yy_more_flag) = 0; 00826 } 00827 yy_cp = (yy_c_buf_p); 00828 00829 /* Support of yytext. */ 00830 *yy_cp = (yy_hold_char); 00831 00832 /* yy_bp points to the position in yy_ch_buf of the start of 00833 * the current run. 00834 */ 00835 yy_bp = yy_cp; 00836 00837 yy_current_state = (yy_start); 00838 yy_match: 00839 do 00840 { 00841 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; 00842 if ( yy_accept[yy_current_state] ) 00843 { 00844 (yy_last_accepting_state) = yy_current_state; 00845 (yy_last_accepting_cpos) = yy_cp; 00846 } 00847 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 00848 { 00849 yy_current_state = (int) yy_def[yy_current_state]; 00850 if ( yy_current_state >= 164 ) 00851 yy_c = yy_meta[(unsigned int) yy_c]; 00852 } 00853 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 00854 ++yy_cp; 00855 } 00856 while ( yy_base[yy_current_state] != 195 ); 00857 00858 yy_find_action: 00859 yy_act = yy_accept[yy_current_state]; 00860 if ( yy_act == 0 ) 00861 { /* have to back up */ 00862 yy_cp = (yy_last_accepting_cpos); 00863 yy_current_state = (yy_last_accepting_state); 00864 yy_act = yy_accept[yy_current_state]; 00865 } 00866 00867 YY_DO_BEFORE_ACTION; 00868 00869 do_action: /* This label is used only to access EOF actions. */ 00870 00871 switch ( yy_act ) 00872 { /* beginning of action switch */ 00873 case 0: /* must back up */ 00874 /* undo the effects of YY_DO_BEFORE_ACTION */ 00875 *yy_cp = (yy_hold_char); 00876 yy_cp = (yy_last_accepting_cpos); 00877 yy_current_state = (yy_last_accepting_state); 00878 goto yy_find_action; 00879 00880 case 1: 00881 YY_RULE_SETUP 00882 #line 47 "lex.l" 00883 { return ADD; } 00884 YY_BREAK 00885 case 2: 00886 YY_RULE_SETUP 00887 #line 48 "lex.l" 00888 { return ALTER; } 00889 YY_BREAK 00890 case 3: 00891 YY_RULE_SETUP 00892 #line 49 "lex.l" 00893 { return COLUMN; } 00894 YY_BREAK 00895 case 4: 00896 YY_RULE_SETUP 00897 #line 50 "lex.l" 00898 { return DELETE; } 00899 YY_BREAK 00900 case 5: 00901 YY_RULE_SETUP 00902 #line 51 "lex.l" 00903 { return FROM; } 00904 YY_BREAK 00905 case 6: 00906 YY_RULE_SETUP 00907 #line 52 "lex.l" 00908 { return INSERT; } 00909 YY_BREAK 00910 case 7: 00911 YY_RULE_SETUP 00912 #line 53 "lex.l" 00913 { return INTO; } 00914 YY_BREAK 00915 case 8: 00916 YY_RULE_SETUP 00917 #line 54 "lex.l" 00918 { return SELECT; } 00919 YY_BREAK 00920 case 9: 00921 YY_RULE_SETUP 00922 #line 55 "lex.l" 00923 { return SET; } 00924 YY_BREAK 00925 case 10: 00926 YY_RULE_SETUP 00927 #line 56 "lex.l" 00928 { return UPDATE; } 00929 YY_BREAK 00930 case 11: 00931 YY_RULE_SETUP 00932 #line 57 "lex.l" 00933 { return VALUES; } 00934 YY_BREAK 00935 case 12: 00936 YY_RULE_SETUP 00937 #line 58 "lex.l" 00938 { return WHERE; } 00939 YY_BREAK 00940 case 13: 00941 YY_RULE_SETUP 00942 #line 59 "lex.l" 00943 { return AND; } 00944 YY_BREAK 00945 case 14: 00946 YY_RULE_SETUP 00947 #line 60 "lex.l" 00948 { return CREATE; } 00949 YY_BREAK 00950 case 15: 00951 YY_RULE_SETUP 00952 #line 61 "lex.l" 00953 { return DROP; } 00954 YY_BREAK 00955 case 16: 00956 YY_RULE_SETUP 00957 #line 62 "lex.l" 00958 { return TABLE; } 00959 YY_BREAK 00960 case 17: 00961 YY_RULE_SETUP 00962 #line 63 "lex.l" 00963 { return NULL_VALUE; } 00964 YY_BREAK 00965 case 18: 00966 YY_RULE_SETUP 00967 #line 64 "lex.l" 00968 { return VARCHAR; } 00969 YY_BREAK 00970 case 19: 00971 YY_RULE_SETUP 00972 #line 65 "lex.l" 00973 { return INT; } 00974 YY_BREAK 00975 case 20: 00976 YY_RULE_SETUP 00977 #line 66 "lex.l" 00978 { return INTEGER; } 00979 YY_BREAK 00980 case 21: 00981 YY_RULE_SETUP 00982 #line 67 "lex.l" 00983 { return DOUBLE; } 00984 YY_BREAK 00985 case 22: 00986 YY_RULE_SETUP 00987 #line 68 "lex.l" 00988 { return PRECISION; } 00989 YY_BREAK 00990 case 23: 00991 YY_RULE_SETUP 00992 #line 69 "lex.l" 00993 { return DATE; } 00994 YY_BREAK 00995 case 24: 00996 YY_RULE_SETUP 00997 #line 70 "lex.l" 00998 { return TIME; } 00999 YY_BREAK 01000 case 25: 01001 YY_RULE_SETUP 01002 #line 71 "lex.l" 01003 { return OR; } 01004 YY_BREAK 01005 case 26: 01006 YY_RULE_SETUP 01007 #line 72 "lex.l" 01008 { return NOT; } 01009 YY_BREAK 01010 case 27: 01011 YY_RULE_SETUP 01012 #line 73 "lex.l" 01013 { return ORDER; } 01014 YY_BREAK 01015 case 28: 01016 YY_RULE_SETUP 01017 #line 74 "lex.l" 01018 { return BY; } 01019 YY_BREAK 01020 case 29: 01021 YY_RULE_SETUP 01022 #line 75 "lex.l" 01023 { return ASC; } 01024 YY_BREAK 01025 case 30: 01026 YY_RULE_SETUP 01027 #line 76 "lex.l" 01028 { return DESC; } 01029 YY_BREAK 01030 case 31: 01031 YY_RULE_SETUP 01032 #line 77 "lex.l" 01033 { return IS; } 01034 YY_BREAK 01035 case 32: 01036 YY_RULE_SETUP 01037 #line 78 "lex.l" 01038 { 01039 yylval.strval = (char*)strdup("~"); 01040 return COMPARISON_OPERATOR; 01041 } 01042 YY_BREAK 01043 01044 /* [Dd][Ii][Ss][Tt][Ii][Nn][Cc][Tt] { return DISTINCT; } */ 01045 /*************************************** 01046 * EQUAL 01047 ***************************************/ 01048 01049 case 33: 01050 YY_RULE_SETUP 01051 #line 88 "lex.l" 01052 { 01053 return EQUAL; 01054 } 01055 YY_BREAK 01056 01057 /*************************************** 01058 * COMPARISON OPERATOR 01059 ***************************************/ 01060 01061 case 34: 01062 #line 97 "lex.l" 01063 case 35: 01064 #line 98 "lex.l" 01065 case 36: 01066 #line 99 "lex.l" 01067 case 37: 01068 #line 100 "lex.l" 01069 case 38: 01070 #line 101 "lex.l" 01071 case 39: 01072 YY_RULE_SETUP 01073 #line 101 "lex.l" 01074 { 01075 yylval.strval = (char*)strdup(yytext); 01076 return COMPARISON_OPERATOR; 01077 } 01078 YY_BREAK 01079 01080 /*************************************** 01081 * PUNCTUATION 01082 ***************************************/ 01083 01084 case 40: 01085 YY_RULE_SETUP 01086 #line 110 "lex.l" 01087 { 01088 yylval.strval = (char*)strdup(yytext); 01089 return yytext[0]; 01090 } 01091 YY_BREAK 01092 01093 /*************************************** 01094 * NAMES 01095 ***************************************/ 01096 01097 case 41: 01098 YY_RULE_SETUP 01099 #line 119 "lex.l" 01100 { 01101 yylval.strval = (char*)strdup(yytext); 01102 return NAME; 01103 } 01104 YY_BREAK 01105 01106 /*************************************** 01107 * INTEGER 01108 ***************************************/ 01109 01110 case 42: 01111 YY_RULE_SETUP 01112 #line 129 "lex.l" 01113 { 01114 yylval.intval = atoi(yytext); 01115 /* yylval.strval = (char*)strdup(yytext); */ 01116 return INTNUM; 01117 } 01118 YY_BREAK 01119 01120 /*************************************** 01121 * FLOATING POINT NUM 01122 ***************************************/ 01123 01124 case 43: 01125 #line 140 "lex.l" 01126 case 44: 01127 #line 141 "lex.l" 01128 case 45: 01129 #line 142 "lex.l" 01130 case 46: 01131 #line 143 "lex.l" 01132 case 47: 01133 YY_RULE_SETUP 01134 #line 143 "lex.l" 01135 { 01136 yylval.floatval = atof(yytext); 01137 /* yylval.strval = (char*)strdup(yytext); */ 01138 return FLOATNUM; 01139 } 01140 YY_BREAK 01141 01142 /*************************************** 01143 * STRINGS (single quotes) 01144 ***************************************/ 01145 01146 case 48: 01147 /* rule 48 can match eol */ 01148 YY_RULE_SETUP 01149 #line 154 "lex.l" 01150 { 01151 char *Buffer, *ptra, *ptrb; 01152 int c = input(); 01153 int len; 01154 01155 Buffer = (char*)strdup(yytext); /* store here because we lose it when unput() */ 01156 unput( c ); /* just peeking - checking for a double quote... embedded quote */ 01157 01158 if ( c != '\'' ) 01159 { 01160 len = strlen (Buffer); 01161 Buffer[len-1] = '\0'; 01162 /* Hopefully replace all '' by ' */ 01163 ptrb = Buffer + 1; 01164 while ( (ptra = strchr(ptrb, '\'')) != NULL ) { 01165 ptra++; ptrb = ptra; 01166 while ( ptra[1] != 0 ) { ptra[0] = ptra[1]; ptra++; } 01167 ptra[0] = 0; 01168 } 01169 01170 yylval.strval = (char*)strdup(Buffer+1); 01171 free( Buffer ); 01172 return STRING; 01173 } 01174 else 01175 { 01176 free( Buffer ); 01177 yymore(); 01178 } 01179 } 01180 YY_BREAK 01181 01182 /*************************************** 01183 * STRINGS (unterminated) 01184 ***************************************/ 01185 01186 case 49: 01187 *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ 01188 (yy_c_buf_p) = yy_cp -= 1; 01189 YY_DO_BEFORE_ACTION; /* set up yytext again */ 01190 YY_RULE_SETUP 01191 #line 189 "lex.l" 01192 { yyerror("Unterminated string"); } 01193 YY_BREAK 01194 01195 /*************************************** 01196 * NEW LINE (ignored) 01197 ***************************************/ 01198 01199 case 50: 01200 /* rule 50 can match eol */ 01201 YY_RULE_SETUP 01202 #line 195 "lex.l" 01203 ; 01204 YY_BREAK 01205 01206 /*************************************** 01207 * WHITE SPACE (ignored) 01208 ***************************************/ 01209 01210 case 51: 01211 YY_RULE_SETUP 01212 #line 201 "lex.l" 01213 ; /* white space */ 01214 YY_BREAK 01215 01216 /*************************************** 01217 * COMMENTS (ignored) 01218 ***************************************/ 01219 01220 case 52: 01221 *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ 01222 (yy_c_buf_p) = yy_cp -= 1; 01223 YY_DO_BEFORE_ACTION; /* set up yytext again */ 01224 YY_RULE_SETUP 01225 #line 207 "lex.l" 01226 ; /* comment */ 01227 YY_BREAK 01228 case 53: 01229 YY_RULE_SETUP 01230 #line 209 "lex.l" 01231 ECHO; 01232 YY_BREAK 01233 #line 1234 "lex.yy.c" 01234 case YY_STATE_EOF(INITIAL): 01235 yyterminate(); 01236 01237 case YY_END_OF_BUFFER: 01238 { 01239 /* Amount of text matched not including the EOB char. */ 01240 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; 01241 01242 /* Undo the effects of YY_DO_BEFORE_ACTION. */ 01243 *yy_cp = (yy_hold_char); 01244 YY_RESTORE_YY_MORE_OFFSET 01245 01246 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) 01247 { 01248 /* We're scanning a new file or input source. It's 01249 * possible that this happened because the user 01250 * just pointed yyin at a new source and called 01251 * yylex(). If so, then we have to assure 01252 * consistency between YY_CURRENT_BUFFER and our 01253 * globals. Here is the right place to do so, because 01254 * this is the first action (other than possibly a 01255 * back-up) that will match for the new input source. 01256 */ 01257 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 01258 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; 01259 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; 01260 } 01261 01262 /* Note that here we test for yy_c_buf_p "<=" to the position 01263 * of the first EOB in the buffer, since yy_c_buf_p will 01264 * already have been incremented past the NUL character 01265 * (since all states make transitions on EOB to the 01266 * end-of-buffer state). Contrast this with the test 01267 * in input(). 01268 */ 01269 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 01270 { /* This was really a NUL. */ 01271 yy_state_type yy_next_state; 01272 01273 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; 01274 01275 yy_current_state = yy_get_previous_state( ); 01276 01277 /* Okay, we're now positioned to make the NUL 01278 * transition. We couldn't have 01279 * yy_get_previous_state() go ahead and do it 01280 * for us because it doesn't know how to deal 01281 * with the possibility of jamming (and we don't 01282 * want to build jamming into it because then it 01283 * will run more slowly). 01284 */ 01285 01286 yy_next_state = yy_try_NUL_trans( yy_current_state ); 01287 01288 yy_bp = (yytext_ptr) + YY_MORE_ADJ; 01289 01290 if ( yy_next_state ) 01291 { 01292 /* Consume the NUL. */ 01293 yy_cp = ++(yy_c_buf_p); 01294 yy_current_state = yy_next_state; 01295 goto yy_match; 01296 } 01297 01298 else 01299 { 01300 yy_cp = (yy_c_buf_p); 01301 goto yy_find_action; 01302 } 01303 } 01304 01305 else switch ( yy_get_next_buffer( ) ) 01306 { 01307 case EOB_ACT_END_OF_FILE: 01308 { 01309 (yy_did_buffer_switch_on_eof) = 0; 01310 01311 if ( yywrap( ) ) 01312 { 01313 /* Note: because we've taken care in 01314 * yy_get_next_buffer() to have set up 01315 * yytext, we can now set up 01316 * yy_c_buf_p so that if some total 01317 * hoser (like flex itself) wants to 01318 * call the scanner after we return the 01319 * YY_NULL, it'll still work - another 01320 * YY_NULL will get returned. 01321 */ 01322 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; 01323 01324 yy_act = YY_STATE_EOF(YY_START); 01325 goto do_action; 01326 } 01327 01328 else 01329 { 01330 if ( ! (yy_did_buffer_switch_on_eof) ) 01331 YY_NEW_FILE; 01332 } 01333 break; 01334 } 01335 01336 case EOB_ACT_CONTINUE_SCAN: 01337 (yy_c_buf_p) = 01338 (yytext_ptr) + yy_amount_of_matched_text; 01339 01340 yy_current_state = yy_get_previous_state( ); 01341 01342 yy_cp = (yy_c_buf_p); 01343 yy_bp = (yytext_ptr) + YY_MORE_ADJ; 01344 goto yy_match; 01345 01346 case EOB_ACT_LAST_MATCH: 01347 (yy_c_buf_p) = 01348 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; 01349 01350 yy_current_state = yy_get_previous_state( ); 01351 01352 yy_cp = (yy_c_buf_p); 01353 yy_bp = (yytext_ptr) + YY_MORE_ADJ; 01354 goto yy_find_action; 01355 } 01356 break; 01357 } 01358 01359 default: 01360 YY_FATAL_ERROR( 01361 "fatal flex scanner internal error--no action found" ); 01362 } /* end of action switch */ 01363 } /* end of scanning one token */ 01364 } /* end of yylex */ 01365 01366 /* yy_get_next_buffer - try to read in a new buffer 01367 * 01368 * Returns a code representing an action: 01369 * EOB_ACT_LAST_MATCH - 01370 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position 01371 * EOB_ACT_END_OF_FILE - end of file 01372 */ 01373 static int yy_get_next_buffer (void) 01374 { 01375 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; 01376 register char *source = (yytext_ptr); 01377 register int number_to_move, i; 01378 int ret_val; 01379 01380 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) 01381 YY_FATAL_ERROR( 01382 "fatal flex scanner internal error--end of buffer missed" ); 01383 01384 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) 01385 { /* Don't try to fill the buffer, so this is an EOF. */ 01386 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) 01387 { 01388 /* We matched a single character, the EOB, so 01389 * treat this as a final EOF. 01390 */ 01391 return EOB_ACT_END_OF_FILE; 01392 } 01393 01394 else 01395 { 01396 /* We matched some text prior to the EOB, first 01397 * process it. 01398 */ 01399 return EOB_ACT_LAST_MATCH; 01400 } 01401 } 01402 01403 /* Try to read more data. */ 01404 01405 /* First move last chars to start of buffer. */ 01406 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; 01407 01408 for ( i = 0; i < number_to_move; ++i ) 01409 *(dest++) = *(source++); 01410 01411 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 01412 /* don't do the read, it's not guaranteed to return an EOF, 01413 * just force an EOF 01414 */ 01415 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; 01416 01417 else 01418 { 01419 int num_to_read = 01420 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; 01421 01422 while ( num_to_read <= 0 ) 01423 { /* Not enough room in the buffer - grow it. */ 01424 01425 /* just a shorter name for the current buffer */ 01426 YY_BUFFER_STATE b = YY_CURRENT_BUFFER; 01427 01428 int yy_c_buf_p_offset = 01429 (int) ((yy_c_buf_p) - b->yy_ch_buf); 01430 01431 if ( b->yy_is_our_buffer ) 01432 { 01433 int new_size = b->yy_buf_size * 2; 01434 01435 if ( new_size <= 0 ) 01436 b->yy_buf_size += b->yy_buf_size / 8; 01437 else 01438 b->yy_buf_size *= 2; 01439 01440 b->yy_ch_buf = (char *) 01441 /* Include room in for 2 EOB chars. */ 01442 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); 01443 } 01444 else 01445 /* Can't grow it, we don't own it. */ 01446 b->yy_ch_buf = 0; 01447 01448 if ( ! b->yy_ch_buf ) 01449 YY_FATAL_ERROR( 01450 "fatal error - scanner input buffer overflow" ); 01451 01452 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; 01453 01454 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - 01455 number_to_move - 1; 01456 01457 } 01458 01459 if ( num_to_read > YY_READ_BUF_SIZE ) 01460 num_to_read = YY_READ_BUF_SIZE; 01461 01462 /* Read in more data. */ 01463 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), 01464 (yy_n_chars), (size_t) num_to_read ); 01465 01466 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 01467 } 01468 01469 if ( (yy_n_chars) == 0 ) 01470 { 01471 if ( number_to_move == YY_MORE_ADJ ) 01472 { 01473 ret_val = EOB_ACT_END_OF_FILE; 01474 yyrestart(yyin ); 01475 } 01476 01477 else 01478 { 01479 ret_val = EOB_ACT_LAST_MATCH; 01480 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = 01481 YY_BUFFER_EOF_PENDING; 01482 } 01483 } 01484 01485 else 01486 ret_val = EOB_ACT_CONTINUE_SCAN; 01487 01488 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { 01489 /* Extend the array by 50%, plus the number we really need. */ 01490 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); 01491 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); 01492 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) 01493 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); 01494 } 01495 01496 (yy_n_chars) += number_to_move; 01497 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; 01498 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; 01499 01500 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; 01501 01502 return ret_val; 01503 } 01504 01505 /* yy_get_previous_state - get the state just before the EOB char was reached */ 01506 01507 static yy_state_type yy_get_previous_state (void) 01508 { 01509 register yy_state_type yy_current_state; 01510 register char *yy_cp; 01511 01512 yy_current_state = (yy_start); 01513 01514 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) 01515 { 01516 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 01517 if ( yy_accept[yy_current_state] ) 01518 { 01519 (yy_last_accepting_state) = yy_current_state; 01520 (yy_last_accepting_cpos) = yy_cp; 01521 } 01522 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 01523 { 01524 yy_current_state = (int) yy_def[yy_current_state]; 01525 if ( yy_current_state >= 164 ) 01526 yy_c = yy_meta[(unsigned int) yy_c]; 01527 } 01528 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 01529 } 01530 01531 return yy_current_state; 01532 } 01533 01534 /* yy_try_NUL_trans - try to make a transition on the NUL character 01535 * 01536 * synopsis 01537 * next_state = yy_try_NUL_trans( current_state ); 01538 */ 01539 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) 01540 { 01541 register int yy_is_jam; 01542 register char *yy_cp = (yy_c_buf_p); 01543 01544 register YY_CHAR yy_c = 1; 01545 if ( yy_accept[yy_current_state] ) 01546 { 01547 (yy_last_accepting_state) = yy_current_state; 01548 (yy_last_accepting_cpos) = yy_cp; 01549 } 01550 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 01551 { 01552 yy_current_state = (int) yy_def[yy_current_state]; 01553 if ( yy_current_state >= 164 ) 01554 yy_c = yy_meta[(unsigned int) yy_c]; 01555 } 01556 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 01557 yy_is_jam = (yy_current_state == 163); 01558 01559 return yy_is_jam ? 0 : yy_current_state; 01560 } 01561 01562 static void yyunput (int c, register char * yy_bp ) 01563 { 01564 register char *yy_cp; 01565 01566 yy_cp = (yy_c_buf_p); 01567 01568 /* undo effects of setting up yytext */ 01569 *yy_cp = (yy_hold_char); 01570 01571 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) 01572 { /* need to shift things up to make room */ 01573 /* +2 for EOB chars. */ 01574 register int number_to_move = (yy_n_chars) + 2; 01575 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ 01576 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; 01577 register char *source = 01578 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; 01579 01580 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) 01581 *--dest = *--source; 01582 01583 yy_cp += (int) (dest - source); 01584 yy_bp += (int) (dest - source); 01585 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = 01586 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; 01587 01588 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) 01589 YY_FATAL_ERROR( "flex scanner push-back overflow" ); 01590 } 01591 01592 *--yy_cp = (char) c; 01593 01594 (yytext_ptr) = yy_bp; 01595 (yy_hold_char) = *yy_cp; 01596 (yy_c_buf_p) = yy_cp; 01597 } 01598 01599 #ifndef YY_NO_INPUT 01600 #ifdef __cplusplus 01601 static int yyinput (void) 01602 #else 01603 static int input (void) 01604 #endif 01605 01606 { 01607 int c; 01608 01609 *(yy_c_buf_p) = (yy_hold_char); 01610 01611 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) 01612 { 01613 /* yy_c_buf_p now points to the character we want to return. 01614 * If this occurs *before* the EOB characters, then it's a 01615 * valid NUL; if not, then we've hit the end of the buffer. 01616 */ 01617 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 01618 /* This was really a NUL. */ 01619 *(yy_c_buf_p) = '\0'; 01620 01621 else 01622 { /* need more input */ 01623 int offset = (yy_c_buf_p) - (yytext_ptr); 01624 ++(yy_c_buf_p); 01625 01626 switch ( yy_get_next_buffer( ) ) 01627 { 01628 case EOB_ACT_LAST_MATCH: 01629 /* This happens because yy_g_n_b() 01630 * sees that we've accumulated a 01631 * token and flags that we need to 01632 * try matching the token before 01633 * proceeding. But for input(), 01634 * there's no matching to consider. 01635 * So convert the EOB_ACT_LAST_MATCH 01636 * to EOB_ACT_END_OF_FILE. 01637 */ 01638 01639 /* Reset buffer status. */ 01640 yyrestart(yyin ); 01641 01642 /*FALLTHROUGH*/ 01643 01644 case EOB_ACT_END_OF_FILE: 01645 { 01646 if ( yywrap( ) ) 01647 return EOF; 01648 01649 if ( ! (yy_did_buffer_switch_on_eof) ) 01650 YY_NEW_FILE; 01651 #ifdef __cplusplus 01652 return yyinput(); 01653 #else 01654 return input(); 01655 #endif 01656 } 01657 01658 case EOB_ACT_CONTINUE_SCAN: 01659 (yy_c_buf_p) = (yytext_ptr) + offset; 01660 break; 01661 } 01662 } 01663 } 01664 01665 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ 01666 *(yy_c_buf_p) = '\0'; /* preserve yytext */ 01667 (yy_hold_char) = *++(yy_c_buf_p); 01668 01669 return c; 01670 } 01671 #endif /* ifndef YY_NO_INPUT */ 01672 01678 void yyrestart (FILE * input_file ) 01679 { 01680 01681 if ( ! YY_CURRENT_BUFFER ){ 01682 yyensure_buffer_stack (); 01683 YY_CURRENT_BUFFER_LVALUE = 01684 yy_create_buffer(yyin,YY_BUF_SIZE ); 01685 } 01686 01687 yy_init_buffer(YY_CURRENT_BUFFER,input_file ); 01688 yy_load_buffer_state( ); 01689 } 01690 01695 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) 01696 { 01697 01698 /* TODO. We should be able to replace this entire function body 01699 * with 01700 * yypop_buffer_state(); 01701 * yypush_buffer_state(new_buffer); 01702 */ 01703 yyensure_buffer_stack (); 01704 if ( YY_CURRENT_BUFFER == new_buffer ) 01705 return; 01706 01707 if ( YY_CURRENT_BUFFER ) 01708 { 01709 /* Flush out information for old buffer. */ 01710 *(yy_c_buf_p) = (yy_hold_char); 01711 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 01712 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 01713 } 01714 01715 YY_CURRENT_BUFFER_LVALUE = new_buffer; 01716 yy_load_buffer_state( ); 01717 01718 /* We don't actually know whether we did this switch during 01719 * EOF (yywrap()) processing, but the only time this flag 01720 * is looked at is after yywrap() is called, so it's safe 01721 * to go ahead and always set it. 01722 */ 01723 (yy_did_buffer_switch_on_eof) = 1; 01724 } 01725 01726 static void yy_load_buffer_state (void) 01727 { 01728 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 01729 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; 01730 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; 01731 (yy_hold_char) = *(yy_c_buf_p); 01732 } 01733 01740 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) 01741 { 01742 YY_BUFFER_STATE b; 01743 01744 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); 01745 if ( ! b ) 01746 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 01747 01748 b->yy_buf_size = size; 01749 01750 /* yy_ch_buf has to be 2 characters longer than the size given because 01751 * we need to put in 2 end-of-buffer characters. 01752 */ 01753 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); 01754 if ( ! b->yy_ch_buf ) 01755 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 01756 01757 b->yy_is_our_buffer = 1; 01758 01759 yy_init_buffer(b,file ); 01760 01761 return b; 01762 } 01763 01768 void yy_delete_buffer (YY_BUFFER_STATE b ) 01769 { 01770 01771 if ( ! b ) 01772 return; 01773 01774 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ 01775 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; 01776 01777 if ( b->yy_is_our_buffer ) 01778 yyfree((void *) b->yy_ch_buf ); 01779 01780 yyfree((void *) b ); 01781 } 01782 01783 #ifndef __cplusplus 01784 extern int isatty (int ); 01785 #endif /* __cplusplus */ 01786 01787 /* Initializes or reinitializes a buffer. 01788 * This function is sometimes called more than once on the same buffer, 01789 * such as during a yyrestart() or at EOF. 01790 */ 01791 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) 01792 01793 { 01794 int oerrno = errno; 01795 01796 yy_flush_buffer(b ); 01797 01798 b->yy_input_file = file; 01799 b->yy_fill_buffer = 1; 01800 01801 /* If b is the current buffer, then yy_init_buffer was _probably_ 01802 * called from yyrestart() or through yy_get_next_buffer. 01803 * In that case, we don't want to reset the lineno or column. 01804 */ 01805 if (b != YY_CURRENT_BUFFER){ 01806 b->yy_bs_lineno = 1; 01807 b->yy_bs_column = 0; 01808 } 01809 01810 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 01811 01812 errno = oerrno; 01813 } 01814 01819 void yy_flush_buffer (YY_BUFFER_STATE b ) 01820 { 01821 if ( ! b ) 01822 return; 01823 01824 b->yy_n_chars = 0; 01825 01826 /* We always need two end-of-buffer characters. The first causes 01827 * a transition to the end-of-buffer state. The second causes 01828 * a jam in that state. 01829 */ 01830 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 01831 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 01832 01833 b->yy_buf_pos = &b->yy_ch_buf[0]; 01834 01835 b->yy_at_bol = 1; 01836 b->yy_buffer_status = YY_BUFFER_NEW; 01837 01838 if ( b == YY_CURRENT_BUFFER ) 01839 yy_load_buffer_state( ); 01840 } 01841 01848 void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) 01849 { 01850 if (new_buffer == NULL) 01851 return; 01852 01853 yyensure_buffer_stack(); 01854 01855 /* This block is copied from yy_switch_to_buffer. */ 01856 if ( YY_CURRENT_BUFFER ) 01857 { 01858 /* Flush out information for old buffer. */ 01859 *(yy_c_buf_p) = (yy_hold_char); 01860 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 01861 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 01862 } 01863 01864 /* Only push if top exists. Otherwise, replace top. */ 01865 if (YY_CURRENT_BUFFER) 01866 (yy_buffer_stack_top)++; 01867 YY_CURRENT_BUFFER_LVALUE = new_buffer; 01868 01869 /* copied from yy_switch_to_buffer. */ 01870 yy_load_buffer_state( ); 01871 (yy_did_buffer_switch_on_eof) = 1; 01872 } 01873 01878 void yypop_buffer_state (void) 01879 { 01880 if (!YY_CURRENT_BUFFER) 01881 return; 01882 01883 yy_delete_buffer(YY_CURRENT_BUFFER ); 01884 YY_CURRENT_BUFFER_LVALUE = NULL; 01885 if ((yy_buffer_stack_top) > 0) 01886 --(yy_buffer_stack_top); 01887 01888 if (YY_CURRENT_BUFFER) { 01889 yy_load_buffer_state( ); 01890 (yy_did_buffer_switch_on_eof) = 1; 01891 } 01892 } 01893 01894 /* Allocates the stack if it does not exist. 01895 * Guarantees space for at least one push. 01896 */ 01897 static void yyensure_buffer_stack (void) 01898 { 01899 int num_to_alloc; 01900 01901 if (!(yy_buffer_stack)) { 01902 01903 /* First allocation is just for 2 elements, since we don't know if this 01904 * scanner will even need a stack. We use 2 instead of 1 to avoid an 01905 * immediate realloc on the next call. 01906 */ 01907 num_to_alloc = 1; 01908 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc 01909 (num_to_alloc * sizeof(struct yy_buffer_state*) 01910 ); 01911 if ( ! (yy_buffer_stack) ) 01912 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); 01913 01914 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 01915 01916 (yy_buffer_stack_max) = num_to_alloc; 01917 (yy_buffer_stack_top) = 0; 01918 return; 01919 } 01920 01921 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ 01922 01923 /* Increase the buffer to prepare for a possible push. */ 01924 int grow_size = 8 /* arbitrary grow size */; 01925 01926 num_to_alloc = (yy_buffer_stack_max) + grow_size; 01927 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc 01928 ((yy_buffer_stack), 01929 num_to_alloc * sizeof(struct yy_buffer_state*) 01930 ); 01931 if ( ! (yy_buffer_stack) ) 01932 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); 01933 01934 /* zero only the new slots.*/ 01935 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); 01936 (yy_buffer_stack_max) = num_to_alloc; 01937 } 01938 } 01939 01946 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) 01947 { 01948 YY_BUFFER_STATE b; 01949 01950 if ( size < 2 || 01951 base[size-2] != YY_END_OF_BUFFER_CHAR || 01952 base[size-1] != YY_END_OF_BUFFER_CHAR ) 01953 /* They forgot to leave room for the EOB's. */ 01954 return 0; 01955 01956 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); 01957 if ( ! b ) 01958 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); 01959 01960 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ 01961 b->yy_buf_pos = b->yy_ch_buf = base; 01962 b->yy_is_our_buffer = 0; 01963 b->yy_input_file = 0; 01964 b->yy_n_chars = b->yy_buf_size; 01965 b->yy_is_interactive = 0; 01966 b->yy_at_bol = 1; 01967 b->yy_fill_buffer = 0; 01968 b->yy_buffer_status = YY_BUFFER_NEW; 01969 01970 yy_switch_to_buffer(b ); 01971 01972 return b; 01973 } 01974 01983 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) 01984 { 01985 01986 return yy_scan_bytes(yystr,strlen(yystr) ); 01987 } 01988 01996 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) 01997 { 01998 YY_BUFFER_STATE b; 01999 char *buf; 02000 yy_size_t n; 02001 int i; 02002 02003 /* Get memory for full buffer, including space for trailing EOB's. */ 02004 n = _yybytes_len + 2; 02005 buf = (char *) yyalloc(n ); 02006 if ( ! buf ) 02007 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); 02008 02009 for ( i = 0; i < _yybytes_len; ++i ) 02010 buf[i] = yybytes[i]; 02011 02012 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; 02013 02014 b = yy_scan_buffer(buf,n ); 02015 if ( ! b ) 02016 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); 02017 02018 /* It's okay to grow etc. this buffer, and we should throw it 02019 * away when we're done. 02020 */ 02021 b->yy_is_our_buffer = 1; 02022 02023 return b; 02024 } 02025 02026 #ifndef YY_EXIT_FAILURE 02027 #define YY_EXIT_FAILURE 2 02028 #endif 02029 02030 static void yy_fatal_error (yyconst char* msg ) 02031 { 02032 (void) fprintf( stderr, "%s\n", msg ); 02033 exit( YY_EXIT_FAILURE ); 02034 } 02035 02036 /* Redefine yyless() so it works in section 3 code. */ 02037 02038 #undef yyless 02039 #define yyless(n) \ 02040 do \ 02041 { \ 02042 /* Undo effects of setting up yytext. */ \ 02043 int yyless_macro_arg = (n); \ 02044 YY_LESS_LINENO(yyless_macro_arg);\ 02045 yytext[yyleng] = (yy_hold_char); \ 02046 (yy_c_buf_p) = yytext + yyless_macro_arg; \ 02047 (yy_hold_char) = *(yy_c_buf_p); \ 02048 *(yy_c_buf_p) = '\0'; \ 02049 yyleng = yyless_macro_arg; \ 02050 } \ 02051 while ( 0 ) 02052 02053 /* Accessor methods (get/set functions) to struct members. */ 02054 02058 int yyget_lineno (void) 02059 { 02060 02061 return yylineno; 02062 } 02063 02067 FILE *yyget_in (void) 02068 { 02069 return yyin; 02070 } 02071 02075 FILE *yyget_out (void) 02076 { 02077 return yyout; 02078 } 02079 02083 int yyget_leng (void) 02084 { 02085 return yyleng; 02086 } 02087 02092 char *yyget_text (void) 02093 { 02094 return yytext; 02095 } 02096 02101 void yyset_lineno (int line_number ) 02102 { 02103 02104 yylineno = line_number; 02105 } 02106 02113 void yyset_in (FILE * in_str ) 02114 { 02115 yyin = in_str ; 02116 } 02117 02118 void yyset_out (FILE * out_str ) 02119 { 02120 yyout = out_str ; 02121 } 02122 02123 int yyget_debug (void) 02124 { 02125 return yy_flex_debug; 02126 } 02127 02128 void yyset_debug (int bdebug ) 02129 { 02130 yy_flex_debug = bdebug ; 02131 } 02132 02133 static int yy_init_globals (void) 02134 { 02135 /* Initialization is the same as for the non-reentrant scanner. 02136 * This function is called from yylex_destroy(), so don't allocate here. 02137 */ 02138 02139 (yy_buffer_stack) = 0; 02140 (yy_buffer_stack_top) = 0; 02141 (yy_buffer_stack_max) = 0; 02142 (yy_c_buf_p) = (char *) 0; 02143 (yy_init) = 0; 02144 (yy_start) = 0; 02145 02146 /* Defined in main.c */ 02147 #ifdef YY_STDINIT 02148 yyin = stdin; 02149 yyout = stdout; 02150 #else 02151 yyin = (FILE *) 0; 02152 yyout = (FILE *) 0; 02153 #endif 02154 02155 /* For future reference: Set errno on error, since we are called by 02156 * yylex_init() 02157 */ 02158 return 0; 02159 } 02160 02161 /* yylex_destroy is for both reentrant and non-reentrant scanners. */ 02162 int yylex_destroy (void) 02163 { 02164 02165 /* Pop the buffer stack, destroying each element. */ 02166 while(YY_CURRENT_BUFFER){ 02167 yy_delete_buffer(YY_CURRENT_BUFFER ); 02168 YY_CURRENT_BUFFER_LVALUE = NULL; 02169 yypop_buffer_state(); 02170 } 02171 02172 /* Destroy the stack itself. */ 02173 yyfree((yy_buffer_stack) ); 02174 (yy_buffer_stack) = NULL; 02175 02176 /* Reset the globals. This is important in a non-reentrant scanner so the next time 02177 * yylex() is called, initialization will occur. */ 02178 yy_init_globals( ); 02179 02180 return 0; 02181 } 02182 02183 /* 02184 * Internal utility routines. 02185 */ 02186 02187 #ifndef yytext_ptr 02188 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) 02189 { 02190 register int i; 02191 for ( i = 0; i < n; ++i ) 02192 s1[i] = s2[i]; 02193 } 02194 #endif 02195 02196 #ifdef YY_NEED_STRLEN 02197 static int yy_flex_strlen (yyconst char * s ) 02198 { 02199 register int n; 02200 for ( n = 0; s[n]; ++n ) 02201 ; 02202 02203 return n; 02204 } 02205 #endif 02206 02207 void *yyalloc (yy_size_t size ) 02208 { 02209 return (void *) malloc( size ); 02210 } 02211 02212 void *yyrealloc (void * ptr, yy_size_t size ) 02213 { 02214 /* The cast to (char *) in the following accommodates both 02215 * implementations that use char* generic pointers, and those 02216 * that use void* generic pointers. It works with the latter 02217 * because both ANSI C and C++ allow castless assignment from 02218 * any pointer type to void*, and deal with argument conversions 02219 * as though doing an assignment. 02220 */ 02221 return (void *) realloc( (char *) ptr, size ); 02222 } 02223 02224 void yyfree (void * ptr ) 02225 { 02226 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ 02227 } 02228 02229 #define YYTABLES_NAME "yytables" 02230 02231 #line 209 "lex.l" 02232 02233 02234 /********************************************************************** 02235 * 02236 * C-CODE 02237 * 02238 **********************************************************************/ 02239 02240 02241 02242 /********************************************************************** 02243 * my_yyinput 02244 * 02245 * Lexer will ask this function for input when it requires more. 02246 * 02247 **********************************************************************/ 02248 int my_yyinput(char *buf, int max_size) 02249 { 02250 int rest, n; 02251 02252 rest = sqlpStmt->stmt + strlen( sqlpStmt->stmt) - sqlpStmt->cur; 02253 n = ( max_size < rest ? max_size : rest ); 02254 02255 if ( n > 0 ) 02256 { 02257 memcpy( buf, sqlpStmt->cur, n ); 02258 sqlpStmt->cur += n; 02259 } 02260 02261 return n; 02262 } 02263 02264 /********************************************************************** 02265 * yyerror 02266 * 02267 * This should be called just before failing. It formats a meaningfull 02268 * message and deposits it in a usefull place. 02269 * 02270 **********************************************************************/ 02271 void yyerror( char *s ) 02272 { 02273 snprintf( sqlpStmt->errmsg, 500, "%s processing '%s'", s, yytext ); 02274 02275 #ifdef YY_CURRENT_BUFFER 02276 yy_flush_buffer(YY_CURRENT_BUFFER); 02277 #endif 02278 02279 } 02280 02281 /********************************************************************** 02282 * yywrap 02283 * 02284 * We are not doing any buffer switching but lets not use the Flex version of 02285 * of this func anyway so we can avoid the link dependency. 02286 * 02287 **********************************************************************/ 02288 int yywrap() 02289 { 02290 return 1; 02291 } 02292 02293