Drizzled Public API Documentation

scanner.cc
00001 #line 2 "drizzled/execute/scanner.cc"
00002 #line 41 "drizzled/execute/scanner.l"
00003 
00004 #include <config.h>
00005 #include <drizzled/execute/parser.h>  
00006 #include <drizzled/execute/context.h>
00007 #include <drizzled/execute/symbol.h>
00008 #include <drizzled/lex_string.h>
00009 
00010 using namespace drizzled;
00011 
00012 #ifndef __INTEL_COMPILER
00013 #pragma GCC diagnostic ignored "-Wold-style-cast"
00014 #pragma GCC diagnostic ignored "-Wsign-compare"
00015 #pragma GCC diagnostic ignored "-Wunused-parameter"
00016 #pragma GCC diagnostic ignored "-Wmissing-declarations"
00017 #endif
00018 
00019 #define YY_EXTRA_TYPE ::drizzled::execute::Context*
00020 
00021 
00022 
00023 
00024 #line 25 "drizzled/execute/scanner.cc"
00025 
00026 #define  YY_INT_ALIGNED short int
00027 
00028 /* A lexical scanner generated by flex */
00029 
00030 /* %not-for-header */
00031 
00032 /* %if-c-only */
00033 /* %if-not-reentrant */
00034 /* %endif */
00035 /* %endif */
00036 /* %ok-for-header */
00037 
00038 #define FLEX_SCANNER
00039 #define YY_FLEX_MAJOR_VERSION 2
00040 #define YY_FLEX_MINOR_VERSION 5
00041 #define YY_FLEX_SUBMINOR_VERSION 35
00042 #if YY_FLEX_SUBMINOR_VERSION > 0
00043 #define FLEX_BETA
00044 #endif
00045 
00046 /* %if-c++-only */
00047 /* %endif */
00048 
00049 /* %if-c-only */
00050     
00051 /* %endif */
00052 
00053 /* %if-c-only */
00054 
00055 /* %endif */
00056 
00057 /* First, we deal with  platform-specific or compiler-specific issues. */
00058 
00059 /* begin standard C headers. */
00060 /* %if-c-only */
00061 #include <stdio.h>
00062 #include <string.h>
00063 #include <errno.h>
00064 #include <stdlib.h>
00065 /* %endif */
00066 
00067 /* %if-tables-serialization */
00068 /* %endif */
00069 /* end standard C headers. */
00070 
00071 /* %if-c-or-c++ */
00072 /* flex integer type definitions */
00073 
00074 #ifndef FLEXINT_H
00075 #define FLEXINT_H
00076 
00077 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
00078 
00079 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
00080 
00081 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
00082  * if you want the limit (max/min) macros for int types. 
00083  */
00084 #ifndef __STDC_LIMIT_MACROS
00085 #define __STDC_LIMIT_MACROS 1
00086 #endif
00087 
00088 #include <inttypes.h>
00089 typedef int8_t flex_int8_t;
00090 typedef uint8_t flex_uint8_t;
00091 typedef int16_t flex_int16_t;
00092 typedef uint16_t flex_uint16_t;
00093 typedef int32_t flex_int32_t;
00094 typedef uint32_t flex_uint32_t;
00095 #else
00096 typedef signed char flex_int8_t;
00097 typedef short int flex_int16_t;
00098 typedef int flex_int32_t;
00099 typedef unsigned char flex_uint8_t; 
00100 typedef unsigned short int flex_uint16_t;
00101 typedef unsigned int flex_uint32_t;
00102 
00103 /* Limits of integral types. */
00104 #ifndef INT8_MIN
00105 #define INT8_MIN               (-128)
00106 #endif
00107 #ifndef INT16_MIN
00108 #define INT16_MIN              (-32767-1)
00109 #endif
00110 #ifndef INT32_MIN
00111 #define INT32_MIN              (-2147483647-1)
00112 #endif
00113 #ifndef INT8_MAX
00114 #define INT8_MAX               (127)
00115 #endif
00116 #ifndef INT16_MAX
00117 #define INT16_MAX              (32767)
00118 #endif
00119 #ifndef INT32_MAX
00120 #define INT32_MAX              (2147483647)
00121 #endif
00122 #ifndef UINT8_MAX
00123 #define UINT8_MAX              (255U)
00124 #endif
00125 #ifndef UINT16_MAX
00126 #define UINT16_MAX             (65535U)
00127 #endif
00128 #ifndef UINT32_MAX
00129 #define UINT32_MAX             (4294967295U)
00130 #endif
00131 
00132 #endif /* ! C99 */
00133 
00134 #endif /* ! FLEXINT_H */
00135 
00136 /* %endif */
00137 
00138 /* %if-c++-only */
00139 /* %endif */
00140 
00141 #ifdef __cplusplus
00142 
00143 /* The "const" storage-class-modifier is valid. */
00144 #define YY_USE_CONST
00145 
00146 #else /* ! __cplusplus */
00147 
00148 /* C99 requires __STDC__ to be defined as 1. */
00149 #if defined (__STDC__)
00150 
00151 #define YY_USE_CONST
00152 
00153 #endif  /* defined (__STDC__) */
00154 #endif  /* ! __cplusplus */
00155 
00156 #ifdef YY_USE_CONST
00157 #define yyconst const
00158 #else
00159 #define yyconst
00160 #endif
00161 
00162 /* %not-for-header */
00163 
00164 /* Returned upon end-of-file. */
00165 #define YY_NULL 0
00166 /* %ok-for-header */
00167 
00168 /* %not-for-header */
00169 
00170 /* Promotes a possibly negative, possibly signed char to an unsigned
00171  * integer for use as an array index.  If the signed char is negative,
00172  * we want to instead treat it as an 8-bit unsigned char, hence the
00173  * double cast.
00174  */
00175 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
00176 /* %ok-for-header */
00177 
00178 /* %if-reentrant */
00179 
00180 /* An opaque pointer. */
00181 #ifndef YY_TYPEDEF_YY_SCANNER_T
00182 #define YY_TYPEDEF_YY_SCANNER_T
00183 typedef void* yyscan_t;
00184 #endif
00185 
00186 /* For convenience, these vars (plus the bison vars far below)
00187    are macros in the reentrant scanner. */
00188 #define yyin yyg->yyin_r
00189 #define yyout yyg->yyout_r
00190 #define yyextra yyg->yyextra_r
00191 #define yyleng yyg->yyleng_r
00192 #define yytext yyg->yytext_r
00193 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
00194 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
00195 #define yy_flex_debug yyg->yy_flex_debug_r
00196 
00197 /* %endif */
00198 
00199 /* %if-not-reentrant */
00200 /* %endif */
00201 
00202 /* Enter a start condition.  This macro really ought to take a parameter,
00203  * but we do it the disgusting crufty way forced on us by the ()-less
00204  * definition of BEGIN.
00205  */
00206 #define BEGIN yyg->yy_start = 1 + 2 *
00207 
00208 /* Translate the current start state into a value that can be later handed
00209  * to BEGIN to return to the state.  The YYSTATE alias is for lex
00210  * compatibility.
00211  */
00212 #define YY_START ((yyg->yy_start - 1) / 2)
00213 #define YYSTATE YY_START
00214 
00215 /* Action number for EOF rule of a given start state. */
00216 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
00217 
00218 /* Special action meaning "start processing a new file". */
00219 #define YY_NEW_FILE execute_restart(yyin ,yyscanner )
00220 
00221 #define YY_END_OF_BUFFER_CHAR 0
00222 
00223 /* Size of default input buffer. */
00224 #ifndef YY_BUF_SIZE
00225 #ifdef __ia64__
00226 /* On IA-64, the buffer size is 16k, not 8k.
00227  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
00228  * Ditto for the __ia64__ case accordingly.
00229  */
00230 #define YY_BUF_SIZE 32768
00231 #else
00232 #define YY_BUF_SIZE 16384
00233 #endif /* __ia64__ */
00234 #endif
00235 
00236 /* The state buf must be large enough to hold one state per character in the main buffer.
00237  */
00238 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
00239 
00240 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
00241 #define YY_TYPEDEF_YY_BUFFER_STATE
00242 typedef struct yy_buffer_state *YY_BUFFER_STATE;
00243 #endif
00244 
00245 /* %if-not-reentrant */
00246 /* %endif */
00247 
00248 /* %if-c-only */
00249 /* %if-not-reentrant */
00250 /* %endif */
00251 /* %endif */
00252 
00253 #define EOB_ACT_CONTINUE_SCAN 0
00254 #define EOB_ACT_END_OF_FILE 1
00255 #define EOB_ACT_LAST_MATCH 2
00256 
00257     #define YY_LESS_LINENO(n)
00258     
00259 /* Return all but the first "n" matched characters back to the input stream. */
00260 #define yyless(n) \
00261   do \
00262     { \
00263     /* Undo effects of setting up yytext. */ \
00264         int yyless_macro_arg = (n); \
00265         YY_LESS_LINENO(yyless_macro_arg);\
00266     *yy_cp = yyg->yy_hold_char; \
00267     YY_RESTORE_YY_MORE_OFFSET \
00268     yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
00269     YY_DO_BEFORE_ACTION; /* set up yytext again */ \
00270     } \
00271   while ( 0 )
00272 
00273 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
00274 
00275 #ifndef YY_TYPEDEF_YY_SIZE_T
00276 #define YY_TYPEDEF_YY_SIZE_T
00277 typedef size_t yy_size_t;
00278 #endif
00279 
00280 #ifndef YY_STRUCT_YY_BUFFER_STATE
00281 #define YY_STRUCT_YY_BUFFER_STATE
00282 struct yy_buffer_state
00283   {
00284 /* %if-c-only */
00285   FILE *yy_input_file;
00286 /* %endif */
00287 
00288 /* %if-c++-only */
00289 /* %endif */
00290 
00291   char *yy_ch_buf;    /* input buffer */
00292   char *yy_buf_pos;   /* current position in input buffer */
00293 
00294   /* Size of input buffer in bytes, not including room for EOB
00295    * characters.
00296    */
00297   yy_size_t yy_buf_size;
00298 
00299   /* Number of characters read into yy_ch_buf, not including EOB
00300    * characters.
00301    */
00302   int yy_n_chars;
00303 
00304   /* Whether we "own" the buffer - i.e., we know we created it,
00305    * and can realloc() it to grow it, and should free() it to
00306    * delete it.
00307    */
00308   int yy_is_our_buffer;
00309 
00310   /* Whether this is an "interactive" input source; if so, and
00311    * if we're using stdio for input, then we want to use getc()
00312    * instead of fread(), to make sure we stop fetching input after
00313    * each newline.
00314    */
00315   int yy_is_interactive;
00316 
00317   /* Whether we're considered to be at the beginning of a line.
00318    * If so, '^' rules will be active on the next match, otherwise
00319    * not.
00320    */
00321   int yy_at_bol;
00322 
00323     int yy_bs_lineno; 
00324     int yy_bs_column; 
00326   /* Whether to try to fill the input buffer when we reach the
00327    * end of it.
00328    */
00329   int yy_fill_buffer;
00330 
00331   int yy_buffer_status;
00332 
00333 #define YY_BUFFER_NEW 0
00334 #define YY_BUFFER_NORMAL 1
00335   /* When an EOF's been seen but there's still some text to process
00336    * then we mark the buffer as YY_EOF_PENDING, to indicate that we
00337    * shouldn't try reading from the input source any more.  We might
00338    * still have a bunch of tokens to match, though, because of
00339    * possible backing-up.
00340    *
00341    * When we actually see the EOF, we change the status to "new"
00342    * (via execute_restart()), so that the user can continue scanning by
00343    * just pointing yyin at a new input file.
00344    */
00345 #define YY_BUFFER_EOF_PENDING 2
00346 
00347   };
00348 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
00349 
00350 /* %if-c-only Standard (non-C++) definition */
00351 /* %not-for-header */
00352 
00353 /* %if-not-reentrant */
00354 /* %endif */
00355 /* %ok-for-header */
00356 
00357 /* %endif */
00358 
00359 /* We provide macros for accessing buffer states in case in the
00360  * future we want to put the buffer states in a more general
00361  * "scanner state".
00362  *
00363  * Returns the top of the stack, or NULL.
00364  */
00365 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
00366                           ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
00367                           : NULL)
00368 
00369 /* Same as previous macro, but useful when we know that the buffer stack is not
00370  * NULL or when we need an lvalue. For internal use only.
00371  */
00372 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
00373 
00374 /* %if-c-only Standard (non-C++) definition */
00375 
00376 /* %if-not-reentrant */
00377 /* %not-for-header */
00378 
00379 /* %ok-for-header */
00380 
00381 /* %endif */
00382 
00383 void execute_restart (FILE *input_file ,yyscan_t yyscanner );
00384 void execute__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
00385 YY_BUFFER_STATE execute__create_buffer (FILE *file,int size ,yyscan_t yyscanner );
00386 void execute__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
00387 void execute__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
00388 void execute_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
00389 void execute_pop_buffer_state (yyscan_t yyscanner );
00390 
00391 static void execute_ensure_buffer_stack (yyscan_t yyscanner );
00392 static void execute__load_buffer_state (yyscan_t yyscanner );
00393 static void execute__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
00394 
00395 #define YY_FLUSH_BUFFER execute__flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
00396 
00397 YY_BUFFER_STATE execute__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
00398 YY_BUFFER_STATE execute__scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
00399 YY_BUFFER_STATE execute__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
00400 
00401 /* %endif */
00402 
00403 void *execute_alloc (yy_size_t ,yyscan_t yyscanner );
00404 void *execute_realloc (void *,yy_size_t ,yyscan_t yyscanner );
00405 void execute_free (void * ,yyscan_t yyscanner );
00406 
00407 #define yy_new_buffer execute__create_buffer
00408 
00409 #define yy_set_interactive(is_interactive) \
00410   { \
00411   if ( ! YY_CURRENT_BUFFER ){ \
00412         execute_ensure_buffer_stack (yyscanner); \
00413     YY_CURRENT_BUFFER_LVALUE =    \
00414             execute__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
00415   } \
00416   YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
00417   }
00418 
00419 #define yy_set_bol(at_bol) \
00420   { \
00421   if ( ! YY_CURRENT_BUFFER ){\
00422         execute_ensure_buffer_stack (yyscanner); \
00423     YY_CURRENT_BUFFER_LVALUE =    \
00424             execute__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
00425   } \
00426   YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
00427   }
00428 
00429 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
00430 
00431 /* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
00432 /* Begin user sect3 */
00433 
00434 #define execute_wrap(n) 1
00435 #define YY_SKIP_YYWRAP
00436 
00437 #define FLEX_DEBUG
00438 
00439 typedef unsigned char YY_CHAR;
00440 
00441 typedef int yy_state_type;
00442 
00443 #define yytext_ptr yytext_r
00444 
00445 /* %if-c-only Standard (non-C++) definition */
00446 
00447 static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
00448 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  ,yyscan_t yyscanner);
00449 static int yy_get_next_buffer (yyscan_t yyscanner );
00450 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
00451 
00452 /* %endif */
00453 
00454 /* Done after the current pattern has been matched and before the
00455  * corresponding action - sets up yytext.
00456  */
00457 #define YY_DO_BEFORE_ACTION \
00458   yyg->yytext_ptr = yy_bp; \
00459 /* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
00460   yyleng = (size_t) (yy_cp - yy_bp); \
00461   yyg->yy_hold_char = *yy_cp; \
00462   *yy_cp = '\0'; \
00463 /* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
00464   yyg->yy_c_buf_p = yy_cp;
00465 
00466 /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
00467 #define YY_NUM_RULES 5
00468 #define YY_END_OF_BUFFER 6
00469 /* This struct is not used in this scanner,
00470    but its presence is necessary. */
00471 struct yy_trans_info
00472   {
00473   flex_int32_t yy_verify;
00474   flex_int32_t yy_nxt;
00475   };
00476 static yyconst flex_int16_t yy_accept[46] =
00477     {   0,
00478         3,    3,    6,    3,    2,    2,    3,    3,    3,    3,
00479         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
00480         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
00481         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
00482         3,    1,    3,    3,    0
00483     } ;
00484 
00485 static yyconst flex_int32_t yy_ec[256] =
00486     {   0,
00487         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
00488         1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
00489         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00490         1,    2,    4,    5,    4,    4,    4,    4,    4,    4,
00491         4,    4,    4,    4,    5,    5,    4,    6,    7,    7,
00492         7,    7,    7,    7,    7,    7,    7,    4,    4,    4,
00493         4,    4,    4,    4,    8,    1,    1,    1,    1,    9,
00494         1,    1,    1,    1,    1,    8,    8,    8,    1,    1,
00495         1,    1,    1,    1,    8,    1,    1,    9,    1,    1,
00496         4,    4,    4,    4,    5,    4,    8,    1,    1,    1,
00497 
00498         1,    9,    1,    1,    1,    1,    1,    8,    8,    8,
00499         1,    1,    1,    1,    1,    1,    8,    1,    1,    9,
00500         1,    1,    5,    4,    5,    4,    1,   10,   10,   10,
00501        10,   10,   10,   10,   10,   10,   10,   10,   10,   10,
00502        10,   10,   10,   11,   11,   11,   11,   11,   11,   11,
00503        11,   11,   11,   11,   11,   11,   11,   11,   11,   12,
00504        12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
00505        12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
00506        12,   12,   12,   12,   12,   12,   13,   12,   12,   12,
00507        14,    1,    1,   15,   15,   15,   15,   15,   15,   15,
00508 
00509        15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
00510        15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
00511        15,   15,   15,   16,   17,   17,   17,   17,   17,   17,
00512        17,   17,   17,   17,   17,   17,   18,   19,   20,    1,
00513        21,   21,   21,   22,    1,    1,    1,    1,    1,    1,
00514         1,    1,    1,    1,    1
00515     } ;
00516 
00517 static yyconst flex_int32_t yy_meta[23] =
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
00522     } ;
00523 
00524 static yyconst flex_int16_t yy_base[46] =
00525     {   0,
00526         0,    0,  114,   22,    0,   34,    0,    0,   38,    0,
00527         0,   42,   47,   50,   55,   60,   62,  100,   67,  102,
00528         0,   71,    0,   75,    0,    0,   78,    0,   83,    0,
00529         0,  101,   85,    0,    0,    0,    0,   96,   90,   95,
00530         0,    0,    0,    0,  115
00531     } ;
00532 
00533 static yyconst flex_int16_t yy_def[46] =
00534     {   0,
00535        45,    1,   45,   45,    4,    4,    4,    4,    4,    4,
00536         4,    4,    4,    4,    4,    4,    4,   17,   17,    4,
00537         4,    4,    4,    4,    4,   13,    4,   15,    4,   17,
00538        19,    4,    4,   13,   13,   13,   13,   13,   13,   13,
00539        13,    4,   13,   13,    0
00540     } ;
00541 
00542 static yyconst flex_int16_t yy_nxt[138] =
00543     {   0,
00544         4,    5,    6,    7,    8,    9,   10,   11,   12,    4,
00545         4,    4,    4,    4,   13,   14,   15,   16,   17,   18,
00546        19,   20,   21,   21,   22,   21,   23,   24,   25,   23,
00547        22,   21,   21,   21,   21,   21,   26,   27,   28,   29,
00548        30,   30,   31,   32,   33,   33,   33,   33,   33,   33,
00549        33,   33,   33,   33,   33,   33,   25,   25,   25,   25,
00550        25,   34,   34,   34,   35,   35,   35,   35,   35,   36,
00551        36,   37,   37,   37,   37,   37,   39,   39,   39,   39,
00552        39,   33,   33,   33,   33,   33,   33,   33,   33,   34,
00553        34,   34,   36,   36,   41,   41,   41,   41,   41,   43,
00554 
00555        43,   43,   43,   43,   44,   44,   44,   44,   44,   42,
00556        40,   40,   38,   45,    3,   45,   45,   45,   45,   45,
00557        45,   45,   45,   45,   45,   45,   45,   45,   45,   45,
00558        45,   45,   45,   45,   45,   45,   45
00559     } ;
00560 
00561 static yyconst flex_int16_t yy_chk[138] =
00562     {   0,
00563         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00564         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00565         1,    1,    4,    4,    4,    4,    4,    4,    4,    4,
00566         4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
00567         4,    4,    4,    4,    6,    6,    6,    6,    9,    9,
00568         9,    9,   12,   12,   12,   12,   13,   13,   13,   13,
00569        13,   14,   14,   14,   15,   15,   15,   15,   15,   16,
00570        16,   17,   17,   17,   17,   17,   19,   19,   19,   19,
00571        19,   22,   22,   22,   22,   24,   24,   24,   24,   27,
00572        27,   27,   29,   29,   33,   33,   33,   33,   33,   39,
00573 
00574        39,   39,   39,   39,   40,   40,   40,   40,   40,   38,
00575        32,   20,   18,    3,   45,   45,   45,   45,   45,   45,
00576        45,   45,   45,   45,   45,   45,   45,   45,   45,   45,
00577        45,   45,   45,   45,   45,   45,   45
00578     } ;
00579 
00580 static yyconst flex_int16_t yy_rule_linenum[5] =
00581     {   0,
00582       121,  123,  126,  131
00583     } ;
00584 
00585 /* The intent behind this definition is that it'll catch
00586  * any uses of REJECT which flex missed.
00587  */
00588 #define REJECT reject_used_but_not_detected
00589 #define yymore() yymore_used_but_not_detected
00590 #define YY_MORE_ADJ 0
00591 #define YY_RESTORE_YY_MORE_OFFSET
00592 #line 1 "drizzled/execute/scanner.l"
00593 /*  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00594  * 
00595  *  Drizzle Execute Parser
00596  *
00597  *  Copyright (C) 2011 Data Differential, http://datadifferential.com/
00598  *  Copyright (C) 2011 Vijay Samuel, vjsamuel1990@gmail.com
00599  *
00600  *  All rights reserved.
00601  *
00602  *  Redistribution and use in source and binary forms, with or without
00603  *  modification, are permitted provided that the following conditions are
00604  *  met:
00605  *
00606  *      * Redistributions of source code must retain the above copyright
00607  *  notice, this list of conditions and the following disclaimer.
00608  *
00609  *      * Redistributions in binary form must reproduce the above
00610  *  copyright notice, this list of conditions and the following disclaimer
00611  *  in the documentation and/or other materials provided with the
00612  *  distribution.
00613  *
00614  *      * The names of its contributors may not be used to endorse or
00615  *  promote products derived from this software without specific prior
00616  *  written permission.
00617  *
00618  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00619  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00620  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00621  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00622  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00623  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00624  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00625  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00626  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00627  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00628  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00629  *
00630  */
00631 
00632 #line 63 "drizzled/execute/scanner.l"
00633 #include <cstdio>
00634 #include <cstdlib>
00635 #include <cstring>
00636 
00637 #define PARAM execute_get_extra(yyscanner)
00638 
00639 #define get_lex_chars(buffer, result, max_size, context) \
00640 { \
00641   if (context->pos >= context->length) \
00642   { \
00643     result= YY_NULL; \
00644   } \
00645   else \
00646   { \
00647     result= (int)(context->length - context->pos); \
00648     (size_t)result > (size_t)max_size ? result= max_size : 0; \
00649     memcpy(buffer, context->buf + context->pos, result); \
00650     context->pos += result; \
00651   } \
00652 }
00653 
00654 
00655 #define YY_INPUT(buffer, result, max_size) get_lex_chars(buffer, result, max_size, PARAM)
00656 
00657 #define YY_NO_UNISTD_H 1
00658 #line 659 "drizzled/execute/scanner.cc"
00659 
00660 #define INITIAL 0
00661 
00662 #ifndef YY_NO_UNISTD_H
00663 /* Special case for "unistd.h", since it is non-ANSI. We include it way
00664  * down here because we want the user's section 1 to have been scanned first.
00665  * The user has a chance to override it with an option.
00666  */
00667 /* %if-c-only */
00668 #include <unistd.h>
00669 /* %endif */
00670 /* %if-c++-only */
00671 /* %endif */
00672 #endif
00673 
00674 #ifndef YY_EXTRA_TYPE
00675 #define YY_EXTRA_TYPE void *
00676 #endif
00677 
00678 /* %if-c-only Reentrant structure and macros (non-C++). */
00679 /* %if-reentrant */
00680 
00681 /* Holds the entire state of the reentrant scanner. */
00682 struct yyguts_t
00683     {
00684 
00685     /* User-defined. Not touched by flex. */
00686     YY_EXTRA_TYPE yyextra_r;
00687 
00688     /* The rest are the same as the globals declared in the non-reentrant scanner. */
00689     FILE *yyin_r, *yyout_r;
00690     size_t yy_buffer_stack_top; 
00691     size_t yy_buffer_stack_max; 
00692     YY_BUFFER_STATE * yy_buffer_stack; 
00693     char yy_hold_char;
00694     int yy_n_chars;
00695     int yyleng_r;
00696     char *yy_c_buf_p;
00697     int yy_init;
00698     int yy_start;
00699     int yy_did_buffer_switch_on_eof;
00700     int yy_start_stack_ptr;
00701     int yy_start_stack_depth;
00702     int *yy_start_stack;
00703     yy_state_type yy_last_accepting_state;
00704     char* yy_last_accepting_cpos;
00705 
00706     int yylineno_r;
00707     int yy_flex_debug_r;
00708 
00709     char *yytext_r;
00710     int yy_more_flag;
00711     int yy_more_len;
00712 
00713     YYSTYPE * yylval_r;
00714 
00715     }; /* end struct yyguts_t */
00716 
00717 /* %if-c-only */
00718 
00719 static int yy_init_globals (yyscan_t yyscanner );
00720 
00721 /* %endif */
00722 
00723 /* %if-reentrant */
00724 
00725     /* This must go here because YYSTYPE and YYLTYPE are included
00726      * from bison output in section 1.*/
00727     #    define yylval yyg->yylval_r
00728     
00729 int execute_lex_init (yyscan_t* scanner);
00730 
00731 int execute_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
00732 
00733 /* %endif */
00734 
00735 /* %endif End reentrant structures and macros. */
00736 
00737 /* Accessor methods to globals.
00738    These are made visible to non-reentrant scanners for convenience. */
00739 
00740 int execute_lex_destroy (yyscan_t yyscanner );
00741 
00742 int execute_get_debug (yyscan_t yyscanner );
00743 
00744 void execute_set_debug (int debug_flag ,yyscan_t yyscanner );
00745 
00746 YY_EXTRA_TYPE execute_get_extra (yyscan_t yyscanner );
00747 
00748 void execute_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
00749 
00750 FILE *execute_get_in (yyscan_t yyscanner );
00751 
00752 void execute_set_in  (FILE * in_str ,yyscan_t yyscanner );
00753 
00754 FILE *execute_get_out (yyscan_t yyscanner );
00755 
00756 void execute_set_out  (FILE * out_str ,yyscan_t yyscanner );
00757 
00758 int execute_get_leng (yyscan_t yyscanner );
00759 
00760 char *execute_get_text (yyscan_t yyscanner );
00761 
00762 int execute_get_lineno (yyscan_t yyscanner );
00763 
00764 void execute_set_lineno (int line_number ,yyscan_t yyscanner );
00765 
00766 /* %if-bison-bridge */
00767 
00768 YYSTYPE * execute_get_lval (yyscan_t yyscanner );
00769 
00770 void execute_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
00771 
00772 /* %endif */
00773 
00774 /* Macros after this point can all be overridden by user definitions in
00775  * section 1.
00776  */
00777 
00778 #ifndef YY_SKIP_YYWRAP
00779 #ifdef __cplusplus
00780 extern "C" int execute_wrap (yyscan_t yyscanner );
00781 #else
00782 extern int execute_wrap (yyscan_t yyscanner );
00783 #endif
00784 #endif
00785 
00786 /* %not-for-header */
00787 
00788 /* %ok-for-header */
00789 
00790 /* %endif */
00791 
00792 #ifndef yytext_ptr
00793 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
00794 #endif
00795 
00796 #ifdef YY_NEED_STRLEN
00797 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
00798 #endif
00799 
00800 #ifndef YY_NO_INPUT
00801 /* %if-c-only Standard (non-C++) definition */
00802 /* %not-for-header */
00803 
00804 #ifdef __cplusplus
00805 static int yyinput (yyscan_t yyscanner );
00806 #else
00807 static int input (yyscan_t yyscanner );
00808 #endif
00809 /* %ok-for-header */
00810 
00811 /* %endif */
00812 #endif
00813 
00814 /* %if-c-only */
00815 
00816 /* %endif */
00817 
00818 /* Amount of stuff to slurp up with each read. */
00819 #ifndef YY_READ_BUF_SIZE
00820 #ifdef __ia64__
00821 /* On IA-64, the buffer size is 16k, not 8k */
00822 #define YY_READ_BUF_SIZE 16384
00823 #else
00824 #define YY_READ_BUF_SIZE 8192
00825 #endif /* __ia64__ */
00826 #endif
00827 
00828 /* Copy whatever the last rule matched to the standard output. */
00829 #ifndef ECHO
00830 /* %if-c-only Standard (non-C++) definition */
00831 /* This used to be an fputs(), but since the string might contain NUL's,
00832  * we now use fwrite().
00833  */
00834 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
00835 /* %endif */
00836 /* %if-c++-only C++ definition */
00837 /* %endif */
00838 #endif
00839 
00840 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
00841  * is returned in "result".
00842  */
00843 #ifndef YY_INPUT
00844 #define YY_INPUT(buf,result,max_size) \
00845 /* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
00846   if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
00847     { \
00848     int c = '*'; \
00849     size_t n; \
00850     for ( n = 0; n < max_size && \
00851            (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
00852       buf[n] = (char) c; \
00853     if ( c == '\n' ) \
00854       buf[n++] = (char) c; \
00855     if ( c == EOF && ferror( yyin ) ) \
00856       YY_FATAL_ERROR( "input in flex scanner failed" ); \
00857     result = n; \
00858     } \
00859   else \
00860     { \
00861     errno=0; \
00862     while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
00863       { \
00864       if( errno != EINTR) \
00865         { \
00866         YY_FATAL_ERROR( "input in flex scanner failed" ); \
00867         break; \
00868         } \
00869       errno=0; \
00870       clearerr(yyin); \
00871       } \
00872     }\
00873 \
00874 /* %if-c++-only C++ definition \ */\
00875 /* %endif */
00876 
00877 #endif
00878 
00879 /* No semi-colon after return; correct usage is to write "yyterminate();" -
00880  * we don't want an extra ';' after the "return" because that will cause
00881  * some compilers to complain about unreachable statements.
00882  */
00883 #ifndef yyterminate
00884 #define yyterminate() return YY_NULL
00885 #endif
00886 
00887 /* Number of entries by which start-condition stack grows. */
00888 #ifndef YY_START_STACK_INCR
00889 #define YY_START_STACK_INCR 25
00890 #endif
00891 
00892 /* Report a fatal error. */
00893 #ifndef YY_FATAL_ERROR
00894 /* %if-c-only */
00895 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
00896 /* %endif */
00897 /* %if-c++-only */
00898 /* %endif */
00899 #endif
00900 
00901 /* %if-tables-serialization structures and prototypes */
00902 /* %not-for-header */
00903 
00904 /* %ok-for-header */
00905 
00906 /* %not-for-header */
00907 
00908 /* %tables-yydmap generated elements */
00909 /* %endif */
00910 /* end tables serialization structures and prototypes */
00911 
00912 /* %ok-for-header */
00913 
00914 /* Default declaration of generated scanner - a define so the user can
00915  * easily add parameters.
00916  */
00917 #ifndef YY_DECL
00918 #define YY_DECL_IS_OURS 1
00919 /* %if-c-only Standard (non-C++) definition */
00920 
00921 extern int execute_lex \
00922                (YYSTYPE * yylval_param ,yyscan_t yyscanner);
00923 
00924 #define YY_DECL int execute_lex \
00925                (YYSTYPE * yylval_param , yyscan_t yyscanner)
00926 /* %endif */
00927 /* %if-c++-only C++ definition */
00928 /* %endif */
00929 #endif /* !YY_DECL */
00930 
00931 /* Code executed at the beginning of each rule, after yytext and yyleng
00932  * have been set up.
00933  */
00934 #ifndef YY_USER_ACTION
00935 #define YY_USER_ACTION
00936 #endif
00937 
00938 /* Code executed at the end of each rule. */
00939 #ifndef YY_BREAK
00940 #define YY_BREAK break;
00941 #endif
00942 
00943 /* %% [6.0] YY_RULE_SETUP definition goes here */
00944 #define YY_RULE_SETUP \
00945   YY_USER_ACTION
00946 
00947 /* %not-for-header */
00948 
00951 YY_DECL
00952 {
00953   register yy_state_type yy_current_state;
00954   register char *yy_cp, *yy_bp;
00955   register int yy_act;
00956     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
00957 
00958 /* %% [7.0] user's declarations go here */
00959 #line 119 "drizzled/execute/scanner.l"
00960 
00961 
00962 #line 963 "drizzled/execute/scanner.cc"
00963 
00964     yylval = yylval_param;
00965 
00966   if ( !yyg->yy_init )
00967     {
00968     yyg->yy_init = 1;
00969 
00970 #ifdef YY_USER_INIT
00971     YY_USER_INIT;
00972 #endif
00973 
00974     if ( ! yyg->yy_start )
00975       yyg->yy_start = 1;  /* first start state */
00976 
00977     if ( ! yyin )
00978 /* %if-c-only */
00979       yyin = stdin;
00980 /* %endif */
00981 /* %if-c++-only */
00982 /* %endif */
00983 
00984     if ( ! yyout )
00985 /* %if-c-only */
00986       yyout = stdout;
00987 /* %endif */
00988 /* %if-c++-only */
00989 /* %endif */
00990 
00991     if ( ! YY_CURRENT_BUFFER ) {
00992       execute_ensure_buffer_stack (yyscanner);
00993       YY_CURRENT_BUFFER_LVALUE =
00994         execute__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
00995     }
00996 
00997     execute__load_buffer_state(yyscanner );
00998     }
00999 
01000   while ( 1 )   /* loops until end-of-file is reached */
01001     {
01002 /* %% [8.0] yymore()-related code goes here */
01003     yy_cp = yyg->yy_c_buf_p;
01004 
01005     /* Support of yytext. */
01006     *yy_cp = yyg->yy_hold_char;
01007 
01008     /* yy_bp points to the position in yy_ch_buf of the start of
01009      * the current run.
01010      */
01011     yy_bp = yy_cp;
01012 
01013 /* %% [9.0] code to set up and find next match goes here */
01014     yy_current_state = yyg->yy_start;
01015 yy_match:
01016     do
01017       {
01018       register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
01019       if ( yy_accept[yy_current_state] )
01020         {
01021         yyg->yy_last_accepting_state = yy_current_state;
01022         yyg->yy_last_accepting_cpos = yy_cp;
01023         }
01024       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01025         {
01026         yy_current_state = (int) yy_def[yy_current_state];
01027         if ( yy_current_state >= 46 )
01028           yy_c = yy_meta[(unsigned int) yy_c];
01029         }
01030       yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01031       ++yy_cp;
01032       }
01033     while ( yy_base[yy_current_state] != 115 );
01034 
01035 yy_find_action:
01036 /* %% [10.0] code to find the action number goes here */
01037     yy_act = yy_accept[yy_current_state];
01038     if ( yy_act == 0 )
01039       { /* have to back up */
01040       yy_cp = yyg->yy_last_accepting_cpos;
01041       yy_current_state = yyg->yy_last_accepting_state;
01042       yy_act = yy_accept[yy_current_state];
01043       }
01044 
01045     YY_DO_BEFORE_ACTION;
01046 
01047 /* %% [11.0] code for yylineno update goes here */
01048 
01049 do_action:  /* This label is used only to access EOF actions. */
01050 
01051 /* %% [12.0] debug code goes here */
01052     if ( yy_flex_debug )
01053       {
01054       if ( yy_act == 0 )
01055         fprintf( stderr, "--scanner backing up\n" );
01056       else if ( yy_act < 5 )
01057         fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
01058                  (long)yy_rule_linenum[yy_act], yytext );
01059       else if ( yy_act == 5 )
01060         fprintf( stderr, "--accepting default rule (\"%s\")\n",
01061                  yytext );
01062       else if ( yy_act == 6 )
01063         fprintf( stderr, "--(end of buffer or a NUL)\n" );
01064       else
01065         fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
01066       }
01067 
01068     switch ( yy_act )
01069   { /* beginning of action switch */
01070 /* %% [13.0] actions go here */
01071       case 0: /* must back up */
01072       /* undo the effects of YY_DO_BEFORE_ACTION */
01073       *yy_cp = yyg->yy_hold_char;
01074       yy_cp = yyg->yy_last_accepting_cpos;
01075       yy_current_state = yyg->yy_last_accepting_state;
01076       goto yy_find_action;
01077 
01078 case 1:
01079 YY_RULE_SETUP
01080 #line 121 "drizzled/execute/scanner.l"
01081 {  /*  Byte Order Mark */   } 
01082   YY_BREAK
01083 case 2:
01084 /* rule 2 can match eol */
01085 YY_RULE_SETUP
01086 #line 123 "drizzled/execute/scanner.l"
01087 ; /* skip whitespace */
01088   YY_BREAK
01089 case 3:
01090 /* rule 3 can match eol */
01091 YY_RULE_SETUP
01092 #line 126 "drizzled/execute/scanner.l"
01093 {
01094       yylval->string.assign(yytext, yyleng);
01095       return STRING;
01096     }
01097   YY_BREAK
01098 case 4:
01099 YY_RULE_SETUP
01100 #line 131 "drizzled/execute/scanner.l"
01101 {
01102       yyextra->begin= yytext;
01103       return UNKNOWN;
01104     }
01105   YY_BREAK
01106 case 5:
01107 YY_RULE_SETUP
01108 #line 136 "drizzled/execute/scanner.l"
01109 ECHO;
01110   YY_BREAK
01111 #line 1112 "drizzled/execute/scanner.cc"
01112 case YY_STATE_EOF(INITIAL):
01113   yyterminate();
01114 
01115   case YY_END_OF_BUFFER:
01116     {
01117     /* Amount of text matched not including the EOB char. */
01118     int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
01119 
01120     /* Undo the effects of YY_DO_BEFORE_ACTION. */
01121     *yy_cp = yyg->yy_hold_char;
01122     YY_RESTORE_YY_MORE_OFFSET
01123 
01124     if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
01125       {
01126       /* We're scanning a new file or input source.  It's
01127        * possible that this happened because the user
01128        * just pointed yyin at a new source and called
01129        * execute_lex().  If so, then we have to assure
01130        * consistency between YY_CURRENT_BUFFER and our
01131        * globals.  Here is the right place to do so, because
01132        * this is the first action (other than possibly a
01133        * back-up) that will match for the new input source.
01134        */
01135       yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
01136       YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
01137       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
01138       }
01139 
01140     /* Note that here we test for yy_c_buf_p "<=" to the position
01141      * of the first EOB in the buffer, since yy_c_buf_p will
01142      * already have been incremented past the NUL character
01143      * (since all states make transitions on EOB to the
01144      * end-of-buffer state).  Contrast this with the test
01145      * in input().
01146      */
01147     if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
01148       { /* This was really a NUL. */
01149       yy_state_type yy_next_state;
01150 
01151       yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
01152 
01153       yy_current_state = yy_get_previous_state( yyscanner );
01154 
01155       /* Okay, we're now positioned to make the NUL
01156        * transition.  We couldn't have
01157        * yy_get_previous_state() go ahead and do it
01158        * for us because it doesn't know how to deal
01159        * with the possibility of jamming (and we don't
01160        * want to build jamming into it because then it
01161        * will run more slowly).
01162        */
01163 
01164       yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
01165 
01166       yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
01167 
01168       if ( yy_next_state )
01169         {
01170         /* Consume the NUL. */
01171         yy_cp = ++yyg->yy_c_buf_p;
01172         yy_current_state = yy_next_state;
01173         goto yy_match;
01174         }
01175 
01176       else
01177         {
01178 /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
01179         yy_cp = yyg->yy_c_buf_p;
01180         goto yy_find_action;
01181         }
01182       }
01183 
01184     else switch ( yy_get_next_buffer( yyscanner ) )
01185       {
01186       case EOB_ACT_END_OF_FILE:
01187         {
01188         yyg->yy_did_buffer_switch_on_eof = 0;
01189 
01190         if ( execute_wrap(yyscanner ) )
01191           {
01192           /* Note: because we've taken care in
01193            * yy_get_next_buffer() to have set up
01194            * yytext, we can now set up
01195            * yy_c_buf_p so that if some total
01196            * hoser (like flex itself) wants to
01197            * call the scanner after we return the
01198            * YY_NULL, it'll still work - another
01199            * YY_NULL will get returned.
01200            */
01201           yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
01202 
01203           yy_act = YY_STATE_EOF(YY_START);
01204           goto do_action;
01205           }
01206 
01207         else
01208           {
01209           if ( ! yyg->yy_did_buffer_switch_on_eof )
01210             YY_NEW_FILE;
01211           }
01212         break;
01213         }
01214 
01215       case EOB_ACT_CONTINUE_SCAN:
01216         yyg->yy_c_buf_p =
01217           yyg->yytext_ptr + yy_amount_of_matched_text;
01218 
01219         yy_current_state = yy_get_previous_state( yyscanner );
01220 
01221         yy_cp = yyg->yy_c_buf_p;
01222         yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
01223         goto yy_match;
01224 
01225       case EOB_ACT_LAST_MATCH:
01226         yyg->yy_c_buf_p =
01227         &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
01228 
01229         yy_current_state = yy_get_previous_state( yyscanner );
01230 
01231         yy_cp = yyg->yy_c_buf_p;
01232         yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
01233         goto yy_find_action;
01234       }
01235     break;
01236     }
01237 
01238   default:
01239     YY_FATAL_ERROR(
01240       "fatal flex scanner internal error--no action found" );
01241   } /* end of action switch */
01242     } /* end of scanning one token */
01243 } /* end of execute_lex */
01244 /* %ok-for-header */
01245 
01246 /* %if-c++-only */
01247 /* %not-for-header */
01248 
01249 /* %ok-for-header */
01250 
01251 /* %endif */
01252 
01253 /* yy_get_next_buffer - try to read in a new buffer
01254  *
01255  * Returns a code representing an action:
01256  *  EOB_ACT_LAST_MATCH -
01257  *  EOB_ACT_CONTINUE_SCAN - continue scanning from current position
01258  *  EOB_ACT_END_OF_FILE - end of file
01259  */
01260 /* %if-c-only */
01261 static int yy_get_next_buffer (yyscan_t yyscanner)
01262 /* %endif */
01263 /* %if-c++-only */
01264 /* %endif */
01265 {
01266     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01267   register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
01268   register char *source = yyg->yytext_ptr;
01269   register int number_to_move, i;
01270   int ret_val;
01271 
01272   if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
01273     YY_FATAL_ERROR(
01274     "fatal flex scanner internal error--end of buffer missed" );
01275 
01276   if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
01277     { /* Don't try to fill the buffer, so this is an EOF. */
01278     if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
01279       {
01280       /* We matched a single character, the EOB, so
01281        * treat this as a final EOF.
01282        */
01283       return EOB_ACT_END_OF_FILE;
01284       }
01285 
01286     else
01287       {
01288       /* We matched some text prior to the EOB, first
01289        * process it.
01290        */
01291       return EOB_ACT_LAST_MATCH;
01292       }
01293     }
01294 
01295   /* Try to read more data. */
01296 
01297   /* First move last chars to start of buffer. */
01298   number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
01299 
01300   for ( i = 0; i < number_to_move; ++i )
01301     *(dest++) = *(source++);
01302 
01303   if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
01304     /* don't do the read, it's not guaranteed to return an EOF,
01305      * just force an EOF
01306      */
01307     YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
01308 
01309   else
01310     {
01311       int num_to_read =
01312       YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
01313 
01314     while ( num_to_read <= 0 )
01315       { /* Not enough room in the buffer - grow it. */
01316 
01317       /* just a shorter name for the current buffer */
01318       YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
01319 
01320       int yy_c_buf_p_offset =
01321         (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
01322 
01323       if ( b->yy_is_our_buffer )
01324         {
01325         int new_size = b->yy_buf_size * 2;
01326 
01327         if ( new_size <= 0 )
01328           b->yy_buf_size += b->yy_buf_size / 8;
01329         else
01330           b->yy_buf_size *= 2;
01331 
01332         b->yy_ch_buf = (char *)
01333           /* Include room in for 2 EOB chars. */
01334           execute_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
01335         }
01336       else
01337         /* Can't grow it, we don't own it. */
01338         b->yy_ch_buf = 0;
01339 
01340       if ( ! b->yy_ch_buf )
01341         YY_FATAL_ERROR(
01342         "fatal error - scanner input buffer overflow" );
01343 
01344       yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
01345 
01346       num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
01347             number_to_move - 1;
01348 
01349       }
01350 
01351     if ( num_to_read > YY_READ_BUF_SIZE )
01352       num_to_read = YY_READ_BUF_SIZE;
01353 
01354     /* Read in more data. */
01355     YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
01356       yyg->yy_n_chars, (size_t) num_to_read );
01357 
01358     YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
01359     }
01360 
01361   if ( yyg->yy_n_chars == 0 )
01362     {
01363     if ( number_to_move == YY_MORE_ADJ )
01364       {
01365       ret_val = EOB_ACT_END_OF_FILE;
01366       execute_restart(yyin  ,yyscanner);
01367       }
01368 
01369     else
01370       {
01371       ret_val = EOB_ACT_LAST_MATCH;
01372       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
01373         YY_BUFFER_EOF_PENDING;
01374       }
01375     }
01376 
01377   else
01378     ret_val = EOB_ACT_CONTINUE_SCAN;
01379 
01380   if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
01381     /* Extend the array by 50%, plus the number we really need. */
01382     yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
01383     YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) execute_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
01384     if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
01385       YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
01386   }
01387 
01388   yyg->yy_n_chars += number_to_move;
01389   YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
01390   YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
01391 
01392   yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
01393 
01394   return ret_val;
01395 }
01396 
01397 /* yy_get_previous_state - get the state just before the EOB char was reached */
01398 
01399 /* %if-c-only */
01400 /* %not-for-header */
01401 
01402     static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
01403 /* %endif */
01404 /* %if-c++-only */
01405 /* %endif */
01406 {
01407   register yy_state_type yy_current_state;
01408   register char *yy_cp;
01409     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01410 
01411 /* %% [15.0] code to get the start state into yy_current_state goes here */
01412   yy_current_state = yyg->yy_start;
01413 
01414   for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
01415     {
01416 /* %% [16.0] code to find the next state goes here */
01417     register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
01418     if ( yy_accept[yy_current_state] )
01419       {
01420       yyg->yy_last_accepting_state = yy_current_state;
01421       yyg->yy_last_accepting_cpos = yy_cp;
01422       }
01423     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01424       {
01425       yy_current_state = (int) yy_def[yy_current_state];
01426       if ( yy_current_state >= 46 )
01427         yy_c = yy_meta[(unsigned int) yy_c];
01428       }
01429     yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01430     }
01431 
01432   return yy_current_state;
01433 }
01434 
01435 /* yy_try_NUL_trans - try to make a transition on the NUL character
01436  *
01437  * synopsis
01438  *  next_state = yy_try_NUL_trans( current_state );
01439  */
01440 /* %if-c-only */
01441     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
01442 /* %endif */
01443 /* %if-c++-only */
01444 /* %endif */
01445 {
01446   register int yy_is_jam;
01447     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
01448 /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
01449   register char *yy_cp = yyg->yy_c_buf_p;
01450 
01451   register YY_CHAR yy_c = 1;
01452   if ( yy_accept[yy_current_state] )
01453     {
01454     yyg->yy_last_accepting_state = yy_current_state;
01455     yyg->yy_last_accepting_cpos = yy_cp;
01456     }
01457   while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01458     {
01459     yy_current_state = (int) yy_def[yy_current_state];
01460     if ( yy_current_state >= 46 )
01461       yy_c = yy_meta[(unsigned int) yy_c];
01462     }
01463   yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01464   yy_is_jam = (yy_current_state == 45);
01465 
01466   return yy_is_jam ? 0 : yy_current_state;
01467 }
01468 
01469 /* %if-c-only */
01470 
01471 /* %endif */
01472 
01473 /* %if-c-only */
01474 #ifndef YY_NO_INPUT
01475 #ifdef __cplusplus
01476     static int yyinput (yyscan_t yyscanner)
01477 #else
01478     static int input  (yyscan_t yyscanner)
01479 #endif
01480 
01481 /* %endif */
01482 /* %if-c++-only */
01483 /* %endif */
01484 {
01485   int c;
01486     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01487 
01488   *yyg->yy_c_buf_p = yyg->yy_hold_char;
01489 
01490   if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
01491     {
01492     /* yy_c_buf_p now points to the character we want to return.
01493      * If this occurs *before* the EOB characters, then it's a
01494      * valid NUL; if not, then we've hit the end of the buffer.
01495      */
01496     if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
01497       /* This was really a NUL. */
01498       *yyg->yy_c_buf_p = '\0';
01499 
01500     else
01501       { /* need more input */
01502       int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
01503       ++yyg->yy_c_buf_p;
01504 
01505       switch ( yy_get_next_buffer( yyscanner ) )
01506         {
01507         case EOB_ACT_LAST_MATCH:
01508           /* This happens because yy_g_n_b()
01509            * sees that we've accumulated a
01510            * token and flags that we need to
01511            * try matching the token before
01512            * proceeding.  But for input(),
01513            * there's no matching to consider.
01514            * So convert the EOB_ACT_LAST_MATCH
01515            * to EOB_ACT_END_OF_FILE.
01516            */
01517 
01518           /* Reset buffer status. */
01519           execute_restart(yyin ,yyscanner);
01520 
01521           /*FALLTHROUGH*/
01522 
01523         case EOB_ACT_END_OF_FILE:
01524           {
01525           if ( execute_wrap(yyscanner ) )
01526             return EOF;
01527 
01528           if ( ! yyg->yy_did_buffer_switch_on_eof )
01529             YY_NEW_FILE;
01530 #ifdef __cplusplus
01531           return yyinput(yyscanner);
01532 #else
01533           return input(yyscanner);
01534 #endif
01535           }
01536 
01537         case EOB_ACT_CONTINUE_SCAN:
01538           yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
01539           break;
01540         }
01541       }
01542     }
01543 
01544   c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
01545   *yyg->yy_c_buf_p = '\0';  /* preserve yytext */
01546   yyg->yy_hold_char = *++yyg->yy_c_buf_p;
01547 
01548 /* %% [19.0] update BOL and yylineno */
01549 
01550   return c;
01551 }
01552 /* %if-c-only */
01553 #endif  /* ifndef YY_NO_INPUT */
01554 /* %endif */
01555 
01561 /* %if-c-only */
01562     void execute_restart  (FILE * input_file , yyscan_t yyscanner)
01563 /* %endif */
01564 /* %if-c++-only */
01565 /* %endif */
01566 {
01567     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01568 
01569   if ( ! YY_CURRENT_BUFFER ){
01570         execute_ensure_buffer_stack (yyscanner);
01571     YY_CURRENT_BUFFER_LVALUE =
01572             execute__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
01573   }
01574 
01575   execute__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
01576   execute__load_buffer_state(yyscanner );
01577 }
01578 
01583 /* %if-c-only */
01584     void execute__switch_to_buffer  (YY_BUFFER_STATE  new_buffer , yyscan_t yyscanner)
01585 /* %endif */
01586 /* %if-c++-only */
01587 /* %endif */
01588 {
01589     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01590 
01591   /* TODO. We should be able to replace this entire function body
01592    * with
01593    *    execute_pop_buffer_state();
01594    *    execute_push_buffer_state(new_buffer);
01595      */
01596   execute_ensure_buffer_stack (yyscanner);
01597   if ( YY_CURRENT_BUFFER == new_buffer )
01598     return;
01599 
01600   if ( YY_CURRENT_BUFFER )
01601     {
01602     /* Flush out information for old buffer. */
01603     *yyg->yy_c_buf_p = yyg->yy_hold_char;
01604     YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
01605     YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
01606     }
01607 
01608   YY_CURRENT_BUFFER_LVALUE = new_buffer;
01609   execute__load_buffer_state(yyscanner );
01610 
01611   /* We don't actually know whether we did this switch during
01612    * EOF (execute_wrap()) processing, but the only time this flag
01613    * is looked at is after execute_wrap() is called, so it's safe
01614    * to go ahead and always set it.
01615    */
01616   yyg->yy_did_buffer_switch_on_eof = 1;
01617 }
01618 
01619 /* %if-c-only */
01620 static void execute__load_buffer_state  (yyscan_t yyscanner)
01621 /* %endif */
01622 /* %if-c++-only */
01623 /* %endif */
01624 {
01625     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01626   yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
01627   yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
01628   yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
01629   yyg->yy_hold_char = *yyg->yy_c_buf_p;
01630 }
01631 
01638 /* %if-c-only */
01639     YY_BUFFER_STATE execute__create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
01640 /* %endif */
01641 /* %if-c++-only */
01642 /* %endif */
01643 {
01644   YY_BUFFER_STATE b;
01645     
01646   b = (YY_BUFFER_STATE) execute_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
01647   if ( ! b )
01648     YY_FATAL_ERROR( "out of dynamic memory in execute__create_buffer()" );
01649 
01650   b->yy_buf_size = size;
01651 
01652   /* yy_ch_buf has to be 2 characters longer than the size given because
01653    * we need to put in 2 end-of-buffer characters.
01654    */
01655   b->yy_ch_buf = (char *) execute_alloc(b->yy_buf_size + 2 ,yyscanner );
01656   if ( ! b->yy_ch_buf )
01657     YY_FATAL_ERROR( "out of dynamic memory in execute__create_buffer()" );
01658 
01659   b->yy_is_our_buffer = 1;
01660 
01661   execute__init_buffer(b,file ,yyscanner);
01662 
01663   return b;
01664 }
01665 
01670 /* %if-c-only */
01671     void execute__delete_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
01672 /* %endif */
01673 /* %if-c++-only */
01674 /* %endif */
01675 {
01676     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01677 
01678   if ( ! b )
01679     return;
01680 
01681   if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
01682     YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
01683 
01684   if ( b->yy_is_our_buffer )
01685     execute_free((void *) b->yy_ch_buf ,yyscanner );
01686 
01687   execute_free((void *) b ,yyscanner );
01688 }
01689 
01690 /* %if-c-only */
01691 
01692 #ifndef __cplusplus
01693 extern int isatty (int );
01694 #endif /* __cplusplus */
01695     
01696 /* %endif */
01697 
01698 /* %if-c++-only */
01699 /* %endif */
01700 
01701 /* Initializes or reinitializes a buffer.
01702  * This function is sometimes called more than once on the same buffer,
01703  * such as during a execute_restart() or at EOF.
01704  */
01705 /* %if-c-only */
01706     static void execute__init_buffer  (YY_BUFFER_STATE  b, FILE * file , yyscan_t yyscanner)
01707 /* %endif */
01708 /* %if-c++-only */
01709 /* %endif */
01710 
01711 {
01712   int oerrno = errno;
01713     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01714 
01715   execute__flush_buffer(b ,yyscanner);
01716 
01717   b->yy_input_file = file;
01718   b->yy_fill_buffer = 1;
01719 
01720     /* If b is the current buffer, then execute__init_buffer was _probably_
01721      * called from execute_restart() or through yy_get_next_buffer.
01722      * In that case, we don't want to reset the lineno or column.
01723      */
01724     if (b != YY_CURRENT_BUFFER){
01725         b->yy_bs_lineno = 1;
01726         b->yy_bs_column = 0;
01727     }
01728 
01729 /* %if-c-only */
01730 
01731         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
01732     
01733 /* %endif */
01734 /* %if-c++-only */
01735 /* %endif */
01736   errno = oerrno;
01737 }
01738 
01743 /* %if-c-only */
01744     void execute__flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
01745 /* %endif */
01746 /* %if-c++-only */
01747 /* %endif */
01748 {
01749     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01750   if ( ! b )
01751     return;
01752 
01753   b->yy_n_chars = 0;
01754 
01755   /* We always need two end-of-buffer characters.  The first causes
01756    * a transition to the end-of-buffer state.  The second causes
01757    * a jam in that state.
01758    */
01759   b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
01760   b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
01761 
01762   b->yy_buf_pos = &b->yy_ch_buf[0];
01763 
01764   b->yy_at_bol = 1;
01765   b->yy_buffer_status = YY_BUFFER_NEW;
01766 
01767   if ( b == YY_CURRENT_BUFFER )
01768     execute__load_buffer_state(yyscanner );
01769 }
01770 
01771 /* %if-c-or-c++ */
01778 /* %if-c-only */
01779 void execute_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
01780 /* %endif */
01781 /* %if-c++-only */
01782 /* %endif */
01783 {
01784     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01785   if (new_buffer == NULL)
01786     return;
01787 
01788   execute_ensure_buffer_stack(yyscanner);
01789 
01790   /* This block is copied from execute__switch_to_buffer. */
01791   if ( YY_CURRENT_BUFFER )
01792     {
01793     /* Flush out information for old buffer. */
01794     *yyg->yy_c_buf_p = yyg->yy_hold_char;
01795     YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
01796     YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
01797     }
01798 
01799   /* Only push if top exists. Otherwise, replace top. */
01800   if (YY_CURRENT_BUFFER)
01801     yyg->yy_buffer_stack_top++;
01802   YY_CURRENT_BUFFER_LVALUE = new_buffer;
01803 
01804   /* copied from execute__switch_to_buffer. */
01805   execute__load_buffer_state(yyscanner );
01806   yyg->yy_did_buffer_switch_on_eof = 1;
01807 }
01808 /* %endif */
01809 
01810 /* %if-c-or-c++ */
01815 /* %if-c-only */
01816 void execute_pop_buffer_state (yyscan_t yyscanner)
01817 /* %endif */
01818 /* %if-c++-only */
01819 /* %endif */
01820 {
01821     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01822   if (!YY_CURRENT_BUFFER)
01823     return;
01824 
01825   execute__delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
01826   YY_CURRENT_BUFFER_LVALUE = NULL;
01827   if (yyg->yy_buffer_stack_top > 0)
01828     --yyg->yy_buffer_stack_top;
01829 
01830   if (YY_CURRENT_BUFFER) {
01831     execute__load_buffer_state(yyscanner );
01832     yyg->yy_did_buffer_switch_on_eof = 1;
01833   }
01834 }
01835 /* %endif */
01836 
01837 /* %if-c-or-c++ */
01838 /* Allocates the stack if it does not exist.
01839  *  Guarantees space for at least one push.
01840  */
01841 /* %if-c-only */
01842 static void execute_ensure_buffer_stack (yyscan_t yyscanner)
01843 /* %endif */
01844 /* %if-c++-only */
01845 /* %endif */
01846 {
01847   int num_to_alloc;
01848     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01849 
01850   if (!yyg->yy_buffer_stack) {
01851 
01852     /* First allocation is just for 2 elements, since we don't know if this
01853      * scanner will even need a stack. We use 2 instead of 1 to avoid an
01854      * immediate realloc on the next call.
01855          */
01856     num_to_alloc = 1;
01857     yyg->yy_buffer_stack = (struct yy_buffer_state**)execute_alloc
01858                 (num_to_alloc * sizeof(struct yy_buffer_state*)
01859                 , yyscanner);
01860     if ( ! yyg->yy_buffer_stack )
01861       YY_FATAL_ERROR( "out of dynamic memory in execute_ensure_buffer_stack()" );
01862                   
01863     memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
01864         
01865     yyg->yy_buffer_stack_max = num_to_alloc;
01866     yyg->yy_buffer_stack_top = 0;
01867     return;
01868   }
01869 
01870   if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
01871 
01872     /* Increase the buffer to prepare for a possible push. */
01873     int grow_size = 8 /* arbitrary grow size */;
01874 
01875     num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
01876     yyg->yy_buffer_stack = (struct yy_buffer_state**)execute_realloc
01877                 (yyg->yy_buffer_stack,
01878                 num_to_alloc * sizeof(struct yy_buffer_state*)
01879                 , yyscanner);
01880     if ( ! yyg->yy_buffer_stack )
01881       YY_FATAL_ERROR( "out of dynamic memory in execute_ensure_buffer_stack()" );
01882 
01883     /* zero only the new slots.*/
01884     memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
01885     yyg->yy_buffer_stack_max = num_to_alloc;
01886   }
01887 }
01888 /* %endif */
01889 
01890 /* %if-c-only */
01897 YY_BUFFER_STATE execute__scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
01898 {
01899   YY_BUFFER_STATE b;
01900     
01901   if ( size < 2 ||
01902        base[size-2] != YY_END_OF_BUFFER_CHAR ||
01903        base[size-1] != YY_END_OF_BUFFER_CHAR )
01904     /* They forgot to leave room for the EOB's. */
01905     return 0;
01906 
01907   b = (YY_BUFFER_STATE) execute_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
01908   if ( ! b )
01909     YY_FATAL_ERROR( "out of dynamic memory in execute__scan_buffer()" );
01910 
01911   b->yy_buf_size = size - 2;  /* "- 2" to take care of EOB's */
01912   b->yy_buf_pos = b->yy_ch_buf = base;
01913   b->yy_is_our_buffer = 0;
01914   b->yy_input_file = 0;
01915   b->yy_n_chars = b->yy_buf_size;
01916   b->yy_is_interactive = 0;
01917   b->yy_at_bol = 1;
01918   b->yy_fill_buffer = 0;
01919   b->yy_buffer_status = YY_BUFFER_NEW;
01920 
01921   execute__switch_to_buffer(b ,yyscanner );
01922 
01923   return b;
01924 }
01925 /* %endif */
01926 
01927 /* %if-c-only */
01936 YY_BUFFER_STATE execute__scan_string (yyconst char * yystr , yyscan_t yyscanner)
01937 {
01938     
01939   return execute__scan_bytes(yystr,strlen(yystr) ,yyscanner);
01940 }
01941 /* %endif */
01942 
01943 /* %if-c-only */
01951 YY_BUFFER_STATE execute__scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
01952 {
01953   YY_BUFFER_STATE b;
01954   char *buf;
01955   yy_size_t n;
01956   int i;
01957     
01958   /* Get memory for full buffer, including space for trailing EOB's. */
01959   n = _yybytes_len + 2;
01960   buf = (char *) execute_alloc(n ,yyscanner );
01961   if ( ! buf )
01962     YY_FATAL_ERROR( "out of dynamic memory in execute__scan_bytes()" );
01963 
01964   for ( i = 0; i < _yybytes_len; ++i )
01965     buf[i] = yybytes[i];
01966 
01967   buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
01968 
01969   b = execute__scan_buffer(buf,n ,yyscanner);
01970   if ( ! b )
01971     YY_FATAL_ERROR( "bad buffer in execute__scan_bytes()" );
01972 
01973   /* It's okay to grow etc. this buffer, and we should throw it
01974    * away when we're done.
01975    */
01976   b->yy_is_our_buffer = 1;
01977 
01978   return b;
01979 }
01980 /* %endif */
01981 
01982 #ifndef YY_EXIT_FAILURE
01983 #define YY_EXIT_FAILURE 2
01984 #endif
01985 
01986 /* %if-c-only */
01987 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
01988 {
01989       (void) fprintf( stderr, "%s\n", msg );
01990   exit( YY_EXIT_FAILURE );
01991 }
01992 /* %endif */
01993 /* %if-c++-only */
01994 /* %endif */
01995 
01996 /* Redefine yyless() so it works in section 3 code. */
01997 
01998 #undef yyless
01999 #define yyless(n) \
02000   do \
02001     { \
02002     /* Undo effects of setting up yytext. */ \
02003         int yyless_macro_arg = (n); \
02004         YY_LESS_LINENO(yyless_macro_arg);\
02005     yytext[yyleng] = yyg->yy_hold_char; \
02006     yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
02007     yyg->yy_hold_char = *yyg->yy_c_buf_p; \
02008     *yyg->yy_c_buf_p = '\0'; \
02009     yyleng = yyless_macro_arg; \
02010     } \
02011   while ( 0 )
02012 
02013 /* Accessor  methods (get/set functions) to struct members. */
02014 
02015 /* %if-c-only */
02016 /* %if-reentrant */
02017 
02021 YY_EXTRA_TYPE execute_get_extra  (yyscan_t yyscanner)
02022 {
02023     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02024     return yyextra;
02025 }
02026 
02027 /* %endif */
02028 
02032 int execute_get_lineno  (yyscan_t yyscanner)
02033 {
02034     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02035     
02036         if (! YY_CURRENT_BUFFER)
02037             return 0;
02038     
02039     return yylineno;
02040 }
02041 
02045 int execute_get_column  (yyscan_t yyscanner)
02046 {
02047     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02048     
02049         if (! YY_CURRENT_BUFFER)
02050             return 0;
02051     
02052     return yycolumn;
02053 }
02054 
02058 FILE *execute_get_in  (yyscan_t yyscanner)
02059 {
02060     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02061     return yyin;
02062 }
02063 
02067 FILE *execute_get_out  (yyscan_t yyscanner)
02068 {
02069     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02070     return yyout;
02071 }
02072 
02076 int execute_get_leng  (yyscan_t yyscanner)
02077 {
02078     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02079     return yyleng;
02080 }
02081 
02086 char *execute_get_text  (yyscan_t yyscanner)
02087 {
02088     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02089     return yytext;
02090 }
02091 
02092 /* %if-reentrant */
02093 
02098 void execute_set_extra (YY_EXTRA_TYPE  user_defined , yyscan_t yyscanner)
02099 {
02100     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02101     yyextra = user_defined ;
02102 }
02103 
02104 /* %endif */
02105 
02110 void execute_set_lineno (int  line_number , yyscan_t yyscanner)
02111 {
02112     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02113 
02114         /* lineno is only valid if an input buffer exists. */
02115         if (! YY_CURRENT_BUFFER )
02116            yy_fatal_error( "execute_set_lineno called with no buffer" , yyscanner); 
02117     
02118     yylineno = line_number;
02119 }
02120 
02125 void execute_set_column (int  column_no , yyscan_t yyscanner)
02126 {
02127     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02128 
02129         /* column is only valid if an input buffer exists. */
02130         if (! YY_CURRENT_BUFFER )
02131            yy_fatal_error( "execute_set_column called with no buffer" , yyscanner); 
02132     
02133     yycolumn = column_no;
02134 }
02135 
02142 void execute_set_in (FILE *  in_str , yyscan_t yyscanner)
02143 {
02144     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02145     yyin = in_str ;
02146 }
02147 
02148 void execute_set_out (FILE *  out_str , yyscan_t yyscanner)
02149 {
02150     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02151     yyout = out_str ;
02152 }
02153 
02154 int execute_get_debug  (yyscan_t yyscanner)
02155 {
02156     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02157     return yy_flex_debug;
02158 }
02159 
02160 void execute_set_debug (int  bdebug , yyscan_t yyscanner)
02161 {
02162     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02163     yy_flex_debug = bdebug ;
02164 }
02165 
02166 /* %endif */
02167 
02168 /* %if-reentrant */
02169 /* Accessor methods for yylval and yylloc */
02170 
02171 /* %if-bison-bridge */
02172 
02173 YYSTYPE * execute_get_lval  (yyscan_t yyscanner)
02174 {
02175     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02176     return yylval;
02177 }
02178 
02179 void execute_set_lval (YYSTYPE *  yylval_param , yyscan_t yyscanner)
02180 {
02181     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02182     yylval = yylval_param;
02183 }
02184 
02185 /* %endif */
02186 
02187 /* User-visible API */
02188 
02189 /* execute_lex_init is special because it creates the scanner itself, so it is
02190  * the ONLY reentrant function that doesn't take the scanner as the last argument.
02191  * That's why we explicitly handle the declaration, instead of using our macros.
02192  */
02193 
02194 int execute_lex_init(yyscan_t* ptr_yy_globals)
02195 
02196 {
02197     if (ptr_yy_globals == NULL){
02198         errno = EINVAL;
02199         return 1;
02200     }
02201 
02202     *ptr_yy_globals = (yyscan_t) execute_alloc ( sizeof( struct yyguts_t ), NULL );
02203 
02204     if (*ptr_yy_globals == NULL){
02205         errno = ENOMEM;
02206         return 1;
02207     }
02208 
02209     /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
02210     memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
02211 
02212     return yy_init_globals ( *ptr_yy_globals );
02213 }
02214 
02215 /* execute_lex_init_extra has the same functionality as execute_lex_init, but follows the
02216  * convention of taking the scanner as the last argument. Note however, that
02217  * this is a *pointer* to a scanner, as it will be allocated by this call (and
02218  * is the reason, too, why this function also must handle its own declaration).
02219  * The user defined value in the first argument will be available to execute_alloc in
02220  * the yyextra field.
02221  */
02222 
02223 int execute_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
02224 
02225 {
02226     struct yyguts_t dummy_yyguts;
02227 
02228     execute_set_extra (yy_user_defined, &dummy_yyguts);
02229 
02230     if (ptr_yy_globals == NULL){
02231         errno = EINVAL;
02232         return 1;
02233     }
02234   
02235     *ptr_yy_globals = (yyscan_t) execute_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
02236   
02237     if (*ptr_yy_globals == NULL){
02238         errno = ENOMEM;
02239         return 1;
02240     }
02241     
02242     /* By setting to 0xAA, we expose bugs in
02243     yy_init_globals. Leave at 0x00 for releases. */
02244     memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
02245     
02246     execute_set_extra (yy_user_defined, *ptr_yy_globals);
02247     
02248     return yy_init_globals ( *ptr_yy_globals );
02249 }
02250 
02251 /* %endif if-c-only */
02252 
02253 /* %if-c-only */
02254 static int yy_init_globals (yyscan_t yyscanner)
02255 {
02256     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02257     /* Initialization is the same as for the non-reentrant scanner.
02258      * This function is called from execute_lex_destroy(), so don't allocate here.
02259      */
02260 
02261     yyg->yy_buffer_stack = 0;
02262     yyg->yy_buffer_stack_top = 0;
02263     yyg->yy_buffer_stack_max = 0;
02264     yyg->yy_c_buf_p = (char *) 0;
02265     yyg->yy_init = 0;
02266     yyg->yy_start = 0;
02267 
02268     yyg->yy_start_stack_ptr = 0;
02269     yyg->yy_start_stack_depth = 0;
02270     yyg->yy_start_stack =  NULL;
02271 
02272 /* Defined in main.c */
02273 #ifdef YY_STDINIT
02274     yyin = stdin;
02275     yyout = stdout;
02276 #else
02277     yyin = (FILE *) 0;
02278     yyout = (FILE *) 0;
02279 #endif
02280 
02281     /* For future reference: Set errno on error, since we are called by
02282      * execute_lex_init()
02283      */
02284     return 0;
02285 }
02286 /* %endif */
02287 
02288 /* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
02289 /* execute_lex_destroy is for both reentrant and non-reentrant scanners. */
02290 int execute_lex_destroy  (yyscan_t yyscanner)
02291 {
02292     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02293 
02294     /* Pop the buffer stack, destroying each element. */
02295   while(YY_CURRENT_BUFFER){
02296     execute__delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
02297     YY_CURRENT_BUFFER_LVALUE = NULL;
02298     execute_pop_buffer_state(yyscanner);
02299   }
02300 
02301   /* Destroy the stack itself. */
02302   execute_free(yyg->yy_buffer_stack ,yyscanner);
02303   yyg->yy_buffer_stack = NULL;
02304 
02305     /* Destroy the start condition stack. */
02306         execute_free(yyg->yy_start_stack ,yyscanner );
02307         yyg->yy_start_stack = NULL;
02308 
02309     /* Reset the globals. This is important in a non-reentrant scanner so the next time
02310      * execute_lex() is called, initialization will occur. */
02311     yy_init_globals( yyscanner);
02312 
02313 /* %if-reentrant */
02314     /* Destroy the main struct (reentrant only). */
02315     execute_free ( yyscanner , yyscanner );
02316     yyscanner = NULL;
02317 /* %endif */
02318     return 0;
02319 }
02320 /* %endif */
02321 
02322 /*
02323  * Internal utility routines.
02324  */
02325 
02326 #ifndef yytext_ptr
02327 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
02328 {
02329   register int i;
02330   for ( i = 0; i < n; ++i )
02331     s1[i] = s2[i];
02332 }
02333 #endif
02334 
02335 #ifdef YY_NEED_STRLEN
02336 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
02337 {
02338   register int n;
02339   for ( n = 0; s[n]; ++n )
02340     ;
02341 
02342   return n;
02343 }
02344 #endif
02345 
02346 void *execute_alloc (yy_size_t  size , yyscan_t yyscanner)
02347 {
02348   return (void *) malloc( size );
02349 }
02350 
02351 void *execute_realloc  (void * ptr, yy_size_t  size , yyscan_t yyscanner)
02352 {
02353   /* The cast to (char *) in the following accommodates both
02354    * implementations that use char* generic pointers, and those
02355    * that use void* generic pointers.  It works with the latter
02356    * because both ANSI C and C++ allow castless assignment from
02357    * any pointer type to void*, and deal with argument conversions
02358    * as though doing an assignment.
02359    */
02360   return (void *) realloc( (char *) ptr, size );
02361 }
02362 
02363 void execute_free (void * ptr , yyscan_t yyscanner)
02364 {
02365   free( (char *) ptr ); /* see execute_realloc() for (char *) cast */
02366 }
02367 
02368 /* %if-tables-serialization definitions */
02369 /* %define-yytables   The name for this specific scanner's tables. */
02370 #define YYTABLES_NAME "yytables"
02371 /* %endif */
02372 
02373 /* %ok-for-header */
02374 
02375 #line 136 "drizzled/execute/scanner.l"
02376 
02377 
02378 namespace drizzled {
02379 namespace execute {
02380 
02381 void Context::init_scanner()
02382 {
02383   execute_lex_init(&scanner);
02384   execute_set_extra(this,scanner);
02385 }
02386 
02387 void Context::destroy_scanner()
02388 {
02389   execute_lex_destroy(scanner);
02390 }
02391 
02392 } // namespace execute
02393 } // namespace drizzled
02394 
02395