Drizzled Public API Documentation

scanner.cc
1 #line 2 "drizzled/execute/scanner.cc"
2 #line 41 "drizzled/execute/scanner.l"
3 
4 #include <config.h>
5 #include <unistd.h>
6 #include <drizzled/execute/parser.h>
7 #include <drizzled/execute/context.h>
8 #include <drizzled/execute/symbol.h>
9 #include <drizzled/lex_string.h>
10 
11 using namespace drizzled;
12 
13 #ifndef __INTEL_COMPILER
14 #pragma GCC diagnostic ignored "-Wold-style-cast"
15 #pragma GCC diagnostic ignored "-Wsign-compare"
16 #pragma GCC diagnostic ignored "-Wunused-parameter"
17 #pragma GCC diagnostic ignored "-Wmissing-declarations"
18 #endif
19 
20 #define YY_EXTRA_TYPE ::drizzled::execute::Context*
21 
22 
23 
24 
25 #line 26 "drizzled/execute/scanner.cc"
26 
27 #define YY_INT_ALIGNED short int
28 
29 /* A lexical scanner generated by flex */
30 
31 /* %not-for-header */
32 
33 /* %if-c-only */
34 /* %if-not-reentrant */
35 /* %endif */
36 /* %endif */
37 /* %ok-for-header */
38 
39 #define FLEX_SCANNER
40 #define YY_FLEX_MAJOR_VERSION 2
41 #define YY_FLEX_MINOR_VERSION 5
42 #define YY_FLEX_SUBMINOR_VERSION 35
43 #if YY_FLEX_SUBMINOR_VERSION > 0
44 #define FLEX_BETA
45 #endif
46 
47 /* %if-c++-only */
48 /* %endif */
49 
50 /* %if-c-only */
51 
52 /* %endif */
53 
54 /* %if-c-only */
55 
56 /* %endif */
57 
58 /* First, we deal with platform-specific or compiler-specific issues. */
59 
60 /* begin standard C headers. */
61 /* %if-c-only */
62 #include <stdio.h>
63 #include <string.h>
64 #include <errno.h>
65 #include <stdlib.h>
66 /* %endif */
67 
68 /* %if-tables-serialization */
69 /* %endif */
70 /* end standard C headers. */
71 
72 /* %if-c-or-c++ */
73 /* flex integer type definitions */
74 
75 #ifndef FLEXINT_H
76 #define FLEXINT_H
77 
78 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
79 
80 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
81 
82 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
83  * if you want the limit (max/min) macros for int types.
84  */
85 #ifndef __STDC_LIMIT_MACROS
86 #define __STDC_LIMIT_MACROS 1
87 #endif
88 
89 #include <inttypes.h>
90 typedef int8_t flex_int8_t;
91 typedef uint8_t flex_uint8_t;
92 typedef int16_t flex_int16_t;
93 typedef uint16_t flex_uint16_t;
94 typedef int32_t flex_int32_t;
95 typedef uint32_t flex_uint32_t;
96 #else
97 typedef signed char flex_int8_t;
98 typedef short int flex_int16_t;
99 typedef int flex_int32_t;
100 typedef unsigned char flex_uint8_t;
101 typedef unsigned short int flex_uint16_t;
102 typedef unsigned int flex_uint32_t;
103 
104 /* Limits of integral types. */
105 #ifndef INT8_MIN
106 #define INT8_MIN (-128)
107 #endif
108 #ifndef INT16_MIN
109 #define INT16_MIN (-32767-1)
110 #endif
111 #ifndef INT32_MIN
112 #define INT32_MIN (-2147483647-1)
113 #endif
114 #ifndef INT8_MAX
115 #define INT8_MAX (127)
116 #endif
117 #ifndef INT16_MAX
118 #define INT16_MAX (32767)
119 #endif
120 #ifndef INT32_MAX
121 #define INT32_MAX (2147483647)
122 #endif
123 #ifndef UINT8_MAX
124 #define UINT8_MAX (255U)
125 #endif
126 #ifndef UINT16_MAX
127 #define UINT16_MAX (65535U)
128 #endif
129 #ifndef UINT32_MAX
130 #define UINT32_MAX (4294967295U)
131 #endif
132 
133 #endif /* ! C99 */
134 
135 #endif /* ! FLEXINT_H */
136 
137 /* %endif */
138 
139 /* %if-c++-only */
140 /* %endif */
141 
142 #ifdef __cplusplus
143 
144 /* The "const" storage-class-modifier is valid. */
145 #define YY_USE_CONST
146 
147 #else /* ! __cplusplus */
148 
149 /* C99 requires __STDC__ to be defined as 1. */
150 #if defined (__STDC__)
151 
152 #define YY_USE_CONST
153 
154 #endif /* defined (__STDC__) */
155 #endif /* ! __cplusplus */
156 
157 #ifdef YY_USE_CONST
158 #define yyconst const
159 #else
160 #define yyconst
161 #endif
162 
163 /* %not-for-header */
164 
165 /* Returned upon end-of-file. */
166 #define YY_NULL 0
167 /* %ok-for-header */
168 
169 /* %not-for-header */
170 
171 /* Promotes a possibly negative, possibly signed char to an unsigned
172  * integer for use as an array index. If the signed char is negative,
173  * we want to instead treat it as an 8-bit unsigned char, hence the
174  * double cast.
175  */
176 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
177 /* %ok-for-header */
178 
179 /* %if-reentrant */
180 
181 /* An opaque pointer. */
182 #ifndef YY_TYPEDEF_YY_SCANNER_T
183 #define YY_TYPEDEF_YY_SCANNER_T
184 typedef void* yyscan_t;
185 #endif
186 
187 /* For convenience, these vars (plus the bison vars far below)
188  are macros in the reentrant scanner. */
189 #define yyin yyg->yyin_r
190 #define yyout yyg->yyout_r
191 #define yyextra yyg->yyextra_r
192 #define yyleng yyg->yyleng_r
193 #define yytext yyg->yytext_r
194 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
195 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
196 #define yy_flex_debug yyg->yy_flex_debug_r
197 
198 /* %endif */
199 
200 /* %if-not-reentrant */
201 /* %endif */
202 
203 /* Enter a start condition. This macro really ought to take a parameter,
204  * but we do it the disgusting crufty way forced on us by the ()-less
205  * definition of BEGIN.
206  */
207 #define BEGIN yyg->yy_start = 1 + 2 *
208 
209 /* Translate the current start state into a value that can be later handed
210  * to BEGIN to return to the state. The YYSTATE alias is for lex
211  * compatibility.
212  */
213 #define YY_START ((yyg->yy_start - 1) / 2)
214 #define YYSTATE YY_START
215 
216 /* Action number for EOF rule of a given start state. */
217 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
218 
219 /* Special action meaning "start processing a new file". */
220 #define YY_NEW_FILE execute_restart(yyin ,yyscanner )
221 
222 #define YY_END_OF_BUFFER_CHAR 0
223 
224 /* Size of default input buffer. */
225 #ifndef YY_BUF_SIZE
226 #ifdef __ia64__
227 /* On IA-64, the buffer size is 16k, not 8k.
228  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
229  * Ditto for the __ia64__ case accordingly.
230  */
231 #define YY_BUF_SIZE 32768
232 #else
233 #define YY_BUF_SIZE 16384
234 #endif /* __ia64__ */
235 #endif
236 
237 /* The state buf must be large enough to hold one state per character in the main buffer.
238  */
239 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
240 
241 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
242 #define YY_TYPEDEF_YY_BUFFER_STATE
243 typedef struct yy_buffer_state *YY_BUFFER_STATE;
244 #endif
245 
246 /* %if-not-reentrant */
247 /* %endif */
248 
249 /* %if-c-only */
250 /* %if-not-reentrant */
251 /* %endif */
252 /* %endif */
253 
254 #define EOB_ACT_CONTINUE_SCAN 0
255 #define EOB_ACT_END_OF_FILE 1
256 #define EOB_ACT_LAST_MATCH 2
257 
258  #define YY_LESS_LINENO(n)
259 
260 /* Return all but the first "n" matched characters back to the input stream. */
261 #define yyless(n) \
262  do \
263  { \
264  /* Undo effects of setting up yytext. */ \
265  int yyless_macro_arg = (n); \
266  YY_LESS_LINENO(yyless_macro_arg);\
267  *yy_cp = yyg->yy_hold_char; \
268  YY_RESTORE_YY_MORE_OFFSET \
269  yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
270  YY_DO_BEFORE_ACTION; /* set up yytext again */ \
271  } \
272  while ( 0 )
273 
274 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
275 
276 #ifndef YY_TYPEDEF_YY_SIZE_T
277 #define YY_TYPEDEF_YY_SIZE_T
278 typedef size_t yy_size_t;
279 #endif
280 
281 #ifndef YY_STRUCT_YY_BUFFER_STATE
282 #define YY_STRUCT_YY_BUFFER_STATE
284  {
285 /* %if-c-only */
286  FILE *yy_input_file;
287 /* %endif */
288 
289 /* %if-c++-only */
290 /* %endif */
291 
292  char *yy_ch_buf; /* input buffer */
293  char *yy_buf_pos; /* current position in input buffer */
294 
295  /* Size of input buffer in bytes, not including room for EOB
296  * characters.
297  */
298  yy_size_t yy_buf_size;
299 
300  /* Number of characters read into yy_ch_buf, not including EOB
301  * characters.
302  */
303  int yy_n_chars;
304 
305  /* Whether we "own" the buffer - i.e., we know we created it,
306  * and can realloc() it to grow it, and should free() it to
307  * delete it.
308  */
309  int yy_is_our_buffer;
310 
311  /* Whether this is an "interactive" input source; if so, and
312  * if we're using stdio for input, then we want to use getc()
313  * instead of fread(), to make sure we stop fetching input after
314  * each newline.
315  */
316  int yy_is_interactive;
317 
318  /* Whether we're considered to be at the beginning of a line.
319  * If so, '^' rules will be active on the next match, otherwise
320  * not.
321  */
322  int yy_at_bol;
323 
327  /* Whether to try to fill the input buffer when we reach the
328  * end of it.
329  */
330  int yy_fill_buffer;
331 
332  int yy_buffer_status;
333 
334 #define YY_BUFFER_NEW 0
335 #define YY_BUFFER_NORMAL 1
336  /* When an EOF's been seen but there's still some text to process
337  * then we mark the buffer as YY_EOF_PENDING, to indicate that we
338  * shouldn't try reading from the input source any more. We might
339  * still have a bunch of tokens to match, though, because of
340  * possible backing-up.
341  *
342  * When we actually see the EOF, we change the status to "new"
343  * (via execute_restart()), so that the user can continue scanning by
344  * just pointing yyin at a new input file.
345  */
346 #define YY_BUFFER_EOF_PENDING 2
347 
348  };
349 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
350 
351 /* %if-c-only Standard (non-C++) definition */
352 /* %not-for-header */
353 
354 /* %if-not-reentrant */
355 /* %endif */
356 /* %ok-for-header */
357 
358 /* %endif */
359 
360 /* We provide macros for accessing buffer states in case in the
361  * future we want to put the buffer states in a more general
362  * "scanner state".
363  *
364  * Returns the top of the stack, or NULL.
365  */
366 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
367  ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
368  : NULL)
369 
370 /* Same as previous macro, but useful when we know that the buffer stack is not
371  * NULL or when we need an lvalue. For internal use only.
372  */
373 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
374 
375 /* %if-c-only Standard (non-C++) definition */
376 
377 /* %if-not-reentrant */
378 /* %not-for-header */
379 
380 /* %ok-for-header */
381 
382 /* %endif */
383 
384 void execute_restart (FILE *input_file ,yyscan_t yyscanner );
385 void execute__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
386 YY_BUFFER_STATE execute__create_buffer (FILE *file,int size ,yyscan_t yyscanner );
387 void execute__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
388 void execute__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
389 void execute_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
390 void execute_pop_buffer_state (yyscan_t yyscanner );
391 
392 static void execute_ensure_buffer_stack (yyscan_t yyscanner );
393 static void execute__load_buffer_state (yyscan_t yyscanner );
394 static void execute__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
395 
396 #define YY_FLUSH_BUFFER execute__flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
397 
398 YY_BUFFER_STATE execute__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
399 YY_BUFFER_STATE execute__scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
400 YY_BUFFER_STATE execute__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
401 
402 /* %endif */
403 
404 void *execute_alloc (yy_size_t ,yyscan_t yyscanner );
405 void *execute_realloc (void *,yy_size_t ,yyscan_t yyscanner );
406 void execute_free (void * ,yyscan_t yyscanner );
407 
408 #define yy_new_buffer execute__create_buffer
409 
410 #define yy_set_interactive(is_interactive) \
411  { \
412  if ( ! YY_CURRENT_BUFFER ){ \
413  execute_ensure_buffer_stack (yyscanner); \
414  YY_CURRENT_BUFFER_LVALUE = \
415  execute__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
416  } \
417  YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
418  }
419 
420 #define yy_set_bol(at_bol) \
421  { \
422  if ( ! YY_CURRENT_BUFFER ){\
423  execute_ensure_buffer_stack (yyscanner); \
424  YY_CURRENT_BUFFER_LVALUE = \
425  execute__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
426  } \
427  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
428  }
429 
430 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
431 
432 /* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
433 /* Begin user sect3 */
434 
435 #define execute_wrap(n) 1
436 #define YY_SKIP_YYWRAP
437 
438 #define FLEX_DEBUG
439 
440 typedef unsigned char YY_CHAR;
441 
442 typedef int yy_state_type;
443 
444 #define yytext_ptr yytext_r
445 
446 /* %if-c-only Standard (non-C++) definition */
447 
448 static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
449 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
450 static int yy_get_next_buffer (yyscan_t yyscanner );
451 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
452 
453 /* %endif */
454 
455 /* Done after the current pattern has been matched and before the
456  * corresponding action - sets up yytext.
457  */
458 #define YY_DO_BEFORE_ACTION \
459  yyg->yytext_ptr = yy_bp; \
460 /* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
461  yyleng = (size_t) (yy_cp - yy_bp); \
462  yyg->yy_hold_char = *yy_cp; \
463  *yy_cp = '\0'; \
464 /* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
465  yyg->yy_c_buf_p = yy_cp;
466 
467 /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
468 #define YY_NUM_RULES 5
469 #define YY_END_OF_BUFFER 6
470 /* This struct is not used in this scanner,
471  but its presence is necessary. */
473  {
474  flex_int32_t yy_verify;
475  flex_int32_t yy_nxt;
476  };
477 static yyconst flex_int16_t yy_accept[46] =
478  { 0,
479  3, 3, 6, 3, 2, 2, 3, 3, 3, 3,
480  3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
481  3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
482  3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
483  3, 1, 3, 3, 0
484  } ;
485 
486 static yyconst flex_int32_t yy_ec[256] =
487  { 0,
488  1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
489  1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
490  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
491  1, 2, 4, 5, 4, 4, 4, 4, 4, 4,
492  4, 4, 4, 4, 5, 5, 4, 6, 7, 7,
493  7, 7, 7, 7, 7, 7, 7, 4, 4, 4,
494  4, 4, 4, 4, 8, 1, 1, 1, 1, 9,
495  1, 1, 1, 1, 1, 8, 8, 8, 1, 1,
496  1, 1, 1, 1, 8, 1, 1, 9, 1, 1,
497  4, 4, 4, 4, 5, 4, 8, 1, 1, 1,
498 
499  1, 9, 1, 1, 1, 1, 1, 8, 8, 8,
500  1, 1, 1, 1, 1, 1, 8, 1, 1, 9,
501  1, 1, 5, 4, 5, 4, 1, 10, 10, 10,
502  10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
503  10, 10, 10, 11, 11, 11, 11, 11, 11, 11,
504  11, 11, 11, 11, 11, 11, 11, 11, 11, 12,
505  12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
506  12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
507  12, 12, 12, 12, 12, 12, 13, 12, 12, 12,
508  14, 1, 1, 15, 15, 15, 15, 15, 15, 15,
509 
510  15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
511  15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
512  15, 15, 15, 16, 17, 17, 17, 17, 17, 17,
513  17, 17, 17, 17, 17, 17, 18, 19, 20, 1,
514  21, 21, 21, 22, 1, 1, 1, 1, 1, 1,
515  1, 1, 1, 1, 1
516  } ;
517 
518 static yyconst flex_int32_t yy_meta[23] =
519  { 0,
520  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
521  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
522  1, 1
523  } ;
524 
525 static yyconst flex_int16_t yy_base[46] =
526  { 0,
527  0, 0, 114, 22, 0, 34, 0, 0, 38, 0,
528  0, 42, 47, 50, 55, 60, 62, 100, 67, 102,
529  0, 71, 0, 75, 0, 0, 78, 0, 83, 0,
530  0, 101, 85, 0, 0, 0, 0, 96, 90, 95,
531  0, 0, 0, 0, 115
532  } ;
533 
534 static yyconst flex_int16_t yy_def[46] =
535  { 0,
536  45, 1, 45, 45, 4, 4, 4, 4, 4, 4,
537  4, 4, 4, 4, 4, 4, 4, 17, 17, 4,
538  4, 4, 4, 4, 4, 13, 4, 15, 4, 17,
539  19, 4, 4, 13, 13, 13, 13, 13, 13, 13,
540  13, 4, 13, 13, 0
541  } ;
542 
543 static yyconst flex_int16_t yy_nxt[138] =
544  { 0,
545  4, 5, 6, 7, 8, 9, 10, 11, 12, 4,
546  4, 4, 4, 4, 13, 14, 15, 16, 17, 18,
547  19, 20, 21, 21, 22, 21, 23, 24, 25, 23,
548  22, 21, 21, 21, 21, 21, 26, 27, 28, 29,
549  30, 30, 31, 32, 33, 33, 33, 33, 33, 33,
550  33, 33, 33, 33, 33, 33, 25, 25, 25, 25,
551  25, 34, 34, 34, 35, 35, 35, 35, 35, 36,
552  36, 37, 37, 37, 37, 37, 39, 39, 39, 39,
553  39, 33, 33, 33, 33, 33, 33, 33, 33, 34,
554  34, 34, 36, 36, 41, 41, 41, 41, 41, 43,
555 
556  43, 43, 43, 43, 44, 44, 44, 44, 44, 42,
557  40, 40, 38, 45, 3, 45, 45, 45, 45, 45,
558  45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
559  45, 45, 45, 45, 45, 45, 45
560  } ;
561 
562 static yyconst flex_int16_t yy_chk[138] =
563  { 0,
564  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
565  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
566  1, 1, 4, 4, 4, 4, 4, 4, 4, 4,
567  4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
568  4, 4, 4, 4, 6, 6, 6, 6, 9, 9,
569  9, 9, 12, 12, 12, 12, 13, 13, 13, 13,
570  13, 14, 14, 14, 15, 15, 15, 15, 15, 16,
571  16, 17, 17, 17, 17, 17, 19, 19, 19, 19,
572  19, 22, 22, 22, 22, 24, 24, 24, 24, 27,
573  27, 27, 29, 29, 33, 33, 33, 33, 33, 39,
574 
575  39, 39, 39, 39, 40, 40, 40, 40, 40, 38,
576  32, 20, 18, 3, 45, 45, 45, 45, 45, 45,
577  45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
578  45, 45, 45, 45, 45, 45, 45
579  } ;
580 
581 static yyconst flex_int16_t yy_rule_linenum[5] =
582  { 0,
583  123, 125, 128, 133
584  } ;
585 
586 /* The intent behind this definition is that it'll catch
587  * any uses of REJECT which flex missed.
588  */
589 #define REJECT reject_used_but_not_detected
590 #define yymore() yymore_used_but_not_detected
591 #define YY_MORE_ADJ 0
592 #define YY_RESTORE_YY_MORE_OFFSET
593 #line 1 "drizzled/execute/scanner.l"
594 /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
595  *
596  * Drizzle Execute Parser
597  *
598  * Copyright (C) 2011 Data Differential, http://datadifferential.com/
599  * Copyright (C) 2011 Vijay Samuel, vjsamuel1990@gmail.com
600  *
601  * All rights reserved.
602  *
603  * Redistribution and use in source and binary forms, with or without
604  * modification, are permitted provided that the following conditions are
605  * met:
606  *
607  * * Redistributions of source code must retain the above copyright
608  * notice, this list of conditions and the following disclaimer.
609  *
610  * * Redistributions in binary form must reproduce the above
611  * copyright notice, this list of conditions and the following disclaimer
612  * in the documentation and/or other materials provided with the
613  * distribution.
614  *
615  * * The names of its contributors may not be used to endorse or
616  * promote products derived from this software without specific prior
617  * written permission.
618  *
619  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
620  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
621  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
622  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
623  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
624  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
625  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
626  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
627  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
628  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
629  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
630  *
631  */
632 
633 #line 64 "drizzled/execute/scanner.l"
634 #include <cstdio>
635 #include <cstdlib>
636 #include <cstring>
637 
638 #define PARAM execute_get_extra(yyscanner)
639 
640 #define get_lex_chars(buffer, result, max_size, context) \
641 { \
642  if (context->pos >= context->length) \
643  { \
644  result= YY_NULL; \
645  } \
646  else \
647  { \
648  result= (int)(context->length - context->pos); \
649  (size_t)result > (size_t)max_size ? result= max_size : 0; \
650  memcpy(buffer, context->buf + context->pos, result); \
651  context->pos += result; \
652  } \
653 }
654 
655 
656 #define YY_INPUT(buffer, result, max_size) get_lex_chars(buffer, result, max_size, PARAM)
657 
658 #define YY_NO_UNISTD_H 1
659 #line 660 "drizzled/execute/scanner.cc"
660 
661 #define INITIAL 0
662 
663 #ifndef YY_NO_UNISTD_H
664 /* Special case for "unistd.h", since it is non-ANSI. We include it way
665  * down here because we want the user's section 1 to have been scanned first.
666  * The user has a chance to override it with an option.
667  */
668 /* %if-c-only */
669 #include <unistd.h>
670 /* %endif */
671 /* %if-c++-only */
672 /* %endif */
673 #endif
674 
675 #ifndef YY_EXTRA_TYPE
676 #define YY_EXTRA_TYPE void *
677 #endif
678 
679 /* %if-c-only Reentrant structure and macros (non-C++). */
680 /* %if-reentrant */
681 
682 /* Holds the entire state of the reentrant scanner. */
683 struct yyguts_t
684  {
685 
686  /* User-defined. Not touched by flex. */
687  YY_EXTRA_TYPE yyextra_r;
688 
689  /* The rest are the same as the globals declared in the non-reentrant scanner. */
690  FILE *yyin_r, *yyout_r;
694  char yy_hold_char;
695  int yy_n_chars;
696  int yyleng_r;
697  char *yy_c_buf_p;
698  int yy_init;
699  int yy_start;
700  int yy_did_buffer_switch_on_eof;
701  int yy_start_stack_ptr;
702  int yy_start_stack_depth;
703  int *yy_start_stack;
704  yy_state_type yy_last_accepting_state;
705  char* yy_last_accepting_cpos;
706 
707  int yylineno_r;
708  int yy_flex_debug_r;
709 
710  char *yytext_r;
711  int yy_more_flag;
712  int yy_more_len;
713 
714  YYSTYPE * yylval_r;
715 
716  }; /* end struct yyguts_t */
717 
718 /* %if-c-only */
719 
720 static int yy_init_globals (yyscan_t yyscanner );
721 
722 /* %endif */
723 
724 /* %if-reentrant */
725 
726  /* This must go here because YYSTYPE and YYLTYPE are included
727  * from bison output in section 1.*/
728  # define yylval yyg->yylval_r
729 
730 int execute_lex_init (yyscan_t* scanner);
731 
732 int execute_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
733 
734 /* %endif */
735 
736 /* %endif End reentrant structures and macros. */
737 
738 /* Accessor methods to globals.
739  These are made visible to non-reentrant scanners for convenience. */
740 
741 int execute_lex_destroy (yyscan_t yyscanner );
742 
743 int execute_get_debug (yyscan_t yyscanner );
744 
745 void execute_set_debug (int debug_flag ,yyscan_t yyscanner );
746 
747 YY_EXTRA_TYPE execute_get_extra (yyscan_t yyscanner );
748 
749 void execute_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
750 
751 FILE *execute_get_in (yyscan_t yyscanner );
752 
753 void execute_set_in (FILE * in_str ,yyscan_t yyscanner );
754 
755 FILE *execute_get_out (yyscan_t yyscanner );
756 
757 void execute_set_out (FILE * out_str ,yyscan_t yyscanner );
758 
759 int execute_get_leng (yyscan_t yyscanner );
760 
761 char *execute_get_text (yyscan_t yyscanner );
762 
763 int execute_get_lineno (yyscan_t yyscanner );
764 
765 void execute_set_lineno (int line_number ,yyscan_t yyscanner );
766 
767 /* %if-bison-bridge */
768 
769 YYSTYPE * execute_get_lval (yyscan_t yyscanner );
770 
771 void execute_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
772 
773 /* %endif */
774 
775 /* Macros after this point can all be overridden by user definitions in
776  * section 1.
777  */
778 
779 #ifndef YY_SKIP_YYWRAP
780 #ifdef __cplusplus
781 extern "C" int execute_wrap (yyscan_t yyscanner );
782 #else
783 extern int execute_wrap (yyscan_t yyscanner );
784 #endif
785 #endif
786 
787 /* %not-for-header */
788 
789 /* %ok-for-header */
790 
791 /* %endif */
792 
793 #ifndef yytext_ptr
794 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
795 #endif
796 
797 #ifdef YY_NEED_STRLEN
798 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
799 #endif
800 
801 #ifndef YY_NO_INPUT
802 /* %if-c-only Standard (non-C++) definition */
803 /* %not-for-header */
804 
805 #ifdef __cplusplus
806 static int yyinput (yyscan_t yyscanner );
807 #else
808 static int input (yyscan_t yyscanner );
809 #endif
810 /* %ok-for-header */
811 
812 /* %endif */
813 #endif
814 
815 /* %if-c-only */
816 
817 /* %endif */
818 
819 /* Amount of stuff to slurp up with each read. */
820 #ifndef YY_READ_BUF_SIZE
821 #ifdef __ia64__
822 /* On IA-64, the buffer size is 16k, not 8k */
823 #define YY_READ_BUF_SIZE 16384
824 #else
825 #define YY_READ_BUF_SIZE 8192
826 #endif /* __ia64__ */
827 #endif
828 
829 /* Copy whatever the last rule matched to the standard output. */
830 #ifndef ECHO
831 /* %if-c-only Standard (non-C++) definition */
832 /* This used to be an fputs(), but since the string might contain NUL's,
833  * we now use fwrite().
834  */
835 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
836 /* %endif */
837 /* %if-c++-only C++ definition */
838 /* %endif */
839 #endif
840 
841 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
842  * is returned in "result".
843  */
844 #ifndef YY_INPUT
845 #define YY_INPUT(buf,result,max_size) \
846 /* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
847  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
848  { \
849  int c = '*'; \
850  size_t n; \
851  for ( n = 0; n < max_size && \
852  (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
853  buf[n] = (char) c; \
854  if ( c == '\n' ) \
855  buf[n++] = (char) c; \
856  if ( c == EOF && ferror( yyin ) ) \
857  YY_FATAL_ERROR( "input in flex scanner failed" ); \
858  result = n; \
859  } \
860  else \
861  { \
862  errno=0; \
863  while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
864  { \
865  if( errno != EINTR) \
866  { \
867  YY_FATAL_ERROR( "input in flex scanner failed" ); \
868  break; \
869  } \
870  errno=0; \
871  clearerr(yyin); \
872  } \
873  }\
874 \
875 /* %if-c++-only C++ definition \ */\
876 /* %endif */
877 
878 #endif
879 
880 /* No semi-colon after return; correct usage is to write "yyterminate();" -
881  * we don't want an extra ';' after the "return" because that will cause
882  * some compilers to complain about unreachable statements.
883  */
884 #ifndef yyterminate
885 #define yyterminate() return YY_NULL
886 #endif
887 
888 /* Number of entries by which start-condition stack grows. */
889 #ifndef YY_START_STACK_INCR
890 #define YY_START_STACK_INCR 25
891 #endif
892 
893 /* Report a fatal error. */
894 #ifndef YY_FATAL_ERROR
895 /* %if-c-only */
896 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
897 /* %endif */
898 /* %if-c++-only */
899 /* %endif */
900 #endif
901 
902 /* %if-tables-serialization structures and prototypes */
903 /* %not-for-header */
904 
905 /* %ok-for-header */
906 
907 /* %not-for-header */
908 
909 /* %tables-yydmap generated elements */
910 /* %endif */
911 /* end tables serialization structures and prototypes */
912 
913 /* %ok-for-header */
914 
915 /* Default declaration of generated scanner - a define so the user can
916  * easily add parameters.
917  */
918 #ifndef YY_DECL
919 #define YY_DECL_IS_OURS 1
920 /* %if-c-only Standard (non-C++) definition */
921 
922 extern int execute_lex \
923  (YYSTYPE * yylval_param ,yyscan_t yyscanner);
924 
925 #define YY_DECL int execute_lex \
926  (YYSTYPE * yylval_param , yyscan_t yyscanner)
927 /* %endif */
928 /* %if-c++-only C++ definition */
929 /* %endif */
930 #endif /* !YY_DECL */
931 
932 /* Code executed at the beginning of each rule, after yytext and yyleng
933  * have been set up.
934  */
935 #ifndef YY_USER_ACTION
936 #define YY_USER_ACTION
937 #endif
938 
939 /* Code executed at the end of each rule. */
940 #ifndef YY_BREAK
941 #define YY_BREAK break;
942 #endif
943 
944 /* %% [6.0] YY_RULE_SETUP definition goes here */
945 #define YY_RULE_SETUP \
946  YY_USER_ACTION
947 
948 /* %not-for-header */
949 
952 YY_DECL
953 {
954  register yy_state_type yy_current_state;
955  register char *yy_cp, *yy_bp;
956  register int yy_act;
957  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
958 
959 /* %% [7.0] user's declarations go here */
960 #line 121 "drizzled/execute/scanner.l"
961 
962 
963 #line 964 "drizzled/execute/scanner.cc"
964 
965  yylval = yylval_param;
966 
967  if ( !yyg->yy_init )
968  {
969  yyg->yy_init = 1;
970 
971 #ifdef YY_USER_INIT
972  YY_USER_INIT;
973 #endif
974 
975  if ( ! yyg->yy_start )
976  yyg->yy_start = 1; /* first start state */
977 
978  if ( ! yyin )
979 /* %if-c-only */
980  yyin = stdin;
981 /* %endif */
982 /* %if-c++-only */
983 /* %endif */
984 
985  if ( ! yyout )
986 /* %if-c-only */
987  yyout = stdout;
988 /* %endif */
989 /* %if-c++-only */
990 /* %endif */
991 
992  if ( ! YY_CURRENT_BUFFER ) {
993  execute_ensure_buffer_stack (yyscanner);
994  YY_CURRENT_BUFFER_LVALUE =
995  execute__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
996  }
997 
998  execute__load_buffer_state(yyscanner );
999  }
1000 
1001  while ( 1 ) /* loops until end-of-file is reached */
1002  {
1003 /* %% [8.0] yymore()-related code goes here */
1004  yy_cp = yyg->yy_c_buf_p;
1005 
1006  /* Support of yytext. */
1007  *yy_cp = yyg->yy_hold_char;
1008 
1009  /* yy_bp points to the position in yy_ch_buf of the start of
1010  * the current run.
1011  */
1012  yy_bp = yy_cp;
1013 
1014 /* %% [9.0] code to set up and find next match goes here */
1015  yy_current_state = yyg->yy_start;
1016 yy_match:
1017  do
1018  {
1019  register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1020  if ( yy_accept[yy_current_state] )
1021  {
1022  yyg->yy_last_accepting_state = yy_current_state;
1023  yyg->yy_last_accepting_cpos = yy_cp;
1024  }
1025  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1026  {
1027  yy_current_state = (int) yy_def[yy_current_state];
1028  if ( yy_current_state >= 46 )
1029  yy_c = yy_meta[(unsigned int) yy_c];
1030  }
1031  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1032  ++yy_cp;
1033  }
1034  while ( yy_current_state != 45 );
1035  yy_cp = yyg->yy_last_accepting_cpos;
1036  yy_current_state = yyg->yy_last_accepting_state;
1037 
1038 yy_find_action:
1039 /* %% [10.0] code to find the action number goes here */
1040  yy_act = yy_accept[yy_current_state];
1041 
1042  YY_DO_BEFORE_ACTION;
1043 
1044 /* %% [11.0] code for yylineno update goes here */
1045 
1046 do_action: /* This label is used only to access EOF actions. */
1047 
1048 /* %% [12.0] debug code goes here */
1049  if ( yy_flex_debug )
1050  {
1051  if ( yy_act == 0 )
1052  fprintf( stderr, "--scanner backing up\n" );
1053  else if ( yy_act < 5 )
1054  fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
1055  (long)yy_rule_linenum[yy_act], yytext );
1056  else if ( yy_act == 5 )
1057  fprintf( stderr, "--accepting default rule (\"%s\")\n",
1058  yytext );
1059  else if ( yy_act == 6 )
1060  fprintf( stderr, "--(end of buffer or a NUL)\n" );
1061  else
1062  fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
1063  }
1064 
1065  switch ( yy_act )
1066  { /* beginning of action switch */
1067 /* %% [13.0] actions go here */
1068  case 0: /* must back up */
1069  /* undo the effects of YY_DO_BEFORE_ACTION */
1070  *yy_cp = yyg->yy_hold_char;
1071  yy_cp = yyg->yy_last_accepting_cpos;
1072  yy_current_state = yyg->yy_last_accepting_state;
1073  goto yy_find_action;
1074 
1075 case 1:
1076 YY_RULE_SETUP
1077 #line 123 "drizzled/execute/scanner.l"
1078 { /* Byte Order Mark */ }
1079  YY_BREAK
1080 case 2:
1081 /* rule 2 can match eol */
1082 YY_RULE_SETUP
1083 #line 125 "drizzled/execute/scanner.l"
1084 ; /* skip whitespace */
1085  YY_BREAK
1086 case 3:
1087 /* rule 3 can match eol */
1088 YY_RULE_SETUP
1089 #line 128 "drizzled/execute/scanner.l"
1090 {
1091  yylval->string.assign(yytext, yyleng);
1092  return STRING;
1093  }
1094  YY_BREAK
1095 case 4:
1096 YY_RULE_SETUP
1097 #line 133 "drizzled/execute/scanner.l"
1098 {
1099  yyextra->begin= yytext;
1100  return UNKNOWN;
1101  }
1102  YY_BREAK
1103 case 5:
1104 YY_RULE_SETUP
1105 #line 138 "drizzled/execute/scanner.l"
1106 ECHO;
1107  YY_BREAK
1108 #line 1109 "drizzled/execute/scanner.cc"
1109 case YY_STATE_EOF(INITIAL):
1110  yyterminate();
1111 
1112  case YY_END_OF_BUFFER:
1113  {
1114  /* Amount of text matched not including the EOB char. */
1115  int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1116 
1117  /* Undo the effects of YY_DO_BEFORE_ACTION. */
1118  *yy_cp = yyg->yy_hold_char;
1119  YY_RESTORE_YY_MORE_OFFSET
1120 
1121  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1122  {
1123  /* We're scanning a new file or input source. It's
1124  * possible that this happened because the user
1125  * just pointed yyin at a new source and called
1126  * execute_lex(). If so, then we have to assure
1127  * consistency between YY_CURRENT_BUFFER and our
1128  * globals. Here is the right place to do so, because
1129  * this is the first action (other than possibly a
1130  * back-up) that will match for the new input source.
1131  */
1132  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1133  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1134  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1135  }
1136 
1137  /* Note that here we test for yy_c_buf_p "<=" to the position
1138  * of the first EOB in the buffer, since yy_c_buf_p will
1139  * already have been incremented past the NUL character
1140  * (since all states make transitions on EOB to the
1141  * end-of-buffer state). Contrast this with the test
1142  * in input().
1143  */
1144  if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1145  { /* This was really a NUL. */
1146  yy_state_type yy_next_state;
1147 
1148  yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1149 
1150  yy_current_state = yy_get_previous_state( yyscanner );
1151 
1152  /* Okay, we're now positioned to make the NUL
1153  * transition. We couldn't have
1154  * yy_get_previous_state() go ahead and do it
1155  * for us because it doesn't know how to deal
1156  * with the possibility of jamming (and we don't
1157  * want to build jamming into it because then it
1158  * will run more slowly).
1159  */
1160 
1161  yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1162 
1163  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1164 
1165  if ( yy_next_state )
1166  {
1167  /* Consume the NUL. */
1168  yy_cp = ++yyg->yy_c_buf_p;
1169  yy_current_state = yy_next_state;
1170  goto yy_match;
1171  }
1172 
1173  else
1174  {
1175 /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
1176  yy_cp = yyg->yy_last_accepting_cpos;
1177  yy_current_state = yyg->yy_last_accepting_state;
1178  goto yy_find_action;
1179  }
1180  }
1181 
1182  else switch ( yy_get_next_buffer( yyscanner ) )
1183  {
1184  case EOB_ACT_END_OF_FILE:
1185  {
1186  yyg->yy_did_buffer_switch_on_eof = 0;
1187 
1188  if ( execute_wrap(yyscanner ) )
1189  {
1190  /* Note: because we've taken care in
1191  * yy_get_next_buffer() to have set up
1192  * yytext, we can now set up
1193  * yy_c_buf_p so that if some total
1194  * hoser (like flex itself) wants to
1195  * call the scanner after we return the
1196  * YY_NULL, it'll still work - another
1197  * YY_NULL will get returned.
1198  */
1199  yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1200 
1201  yy_act = YY_STATE_EOF(YY_START);
1202  goto do_action;
1203  }
1204 
1205  else
1206  {
1207  if ( ! yyg->yy_did_buffer_switch_on_eof )
1208  YY_NEW_FILE;
1209  }
1210  break;
1211  }
1212 
1213  case EOB_ACT_CONTINUE_SCAN:
1214  yyg->yy_c_buf_p =
1215  yyg->yytext_ptr + yy_amount_of_matched_text;
1216 
1217  yy_current_state = yy_get_previous_state( yyscanner );
1218 
1219  yy_cp = yyg->yy_c_buf_p;
1220  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1221  goto yy_match;
1222 
1223  case EOB_ACT_LAST_MATCH:
1224  yyg->yy_c_buf_p =
1225  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1226 
1227  yy_current_state = yy_get_previous_state( yyscanner );
1228 
1229  yy_cp = yyg->yy_c_buf_p;
1230  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1231  goto yy_find_action;
1232  }
1233  break;
1234  }
1235 
1236  default:
1237  YY_FATAL_ERROR(
1238  "fatal flex scanner internal error--no action found" );
1239  } /* end of action switch */
1240  } /* end of scanning one token */
1241 } /* end of execute_lex */
1242 /* %ok-for-header */
1243 
1244 /* %if-c++-only */
1245 /* %not-for-header */
1246 
1247 /* %ok-for-header */
1248 
1249 /* %endif */
1250 
1251 /* yy_get_next_buffer - try to read in a new buffer
1252  *
1253  * Returns a code representing an action:
1254  * EOB_ACT_LAST_MATCH -
1255  * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1256  * EOB_ACT_END_OF_FILE - end of file
1257  */
1258 /* %if-c-only */
1259 static int yy_get_next_buffer (yyscan_t yyscanner)
1260 /* %endif */
1261 /* %if-c++-only */
1262 /* %endif */
1263 {
1264  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1265  register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1266  register char *source = yyg->yytext_ptr;
1267  register int number_to_move, i;
1268  int ret_val;
1269 
1270  if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1271  YY_FATAL_ERROR(
1272  "fatal flex scanner internal error--end of buffer missed" );
1273 
1274  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1275  { /* Don't try to fill the buffer, so this is an EOF. */
1276  if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1277  {
1278  /* We matched a single character, the EOB, so
1279  * treat this as a final EOF.
1280  */
1281  return EOB_ACT_END_OF_FILE;
1282  }
1283 
1284  else
1285  {
1286  /* We matched some text prior to the EOB, first
1287  * process it.
1288  */
1289  return EOB_ACT_LAST_MATCH;
1290  }
1291  }
1292 
1293  /* Try to read more data. */
1294 
1295  /* First move last chars to start of buffer. */
1296  number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1297 
1298  for ( i = 0; i < number_to_move; ++i )
1299  *(dest++) = *(source++);
1300 
1301  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1302  /* don't do the read, it's not guaranteed to return an EOF,
1303  * just force an EOF
1304  */
1305  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1306 
1307  else
1308  {
1309  int num_to_read =
1310  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1311 
1312  while ( num_to_read <= 0 )
1313  { /* Not enough room in the buffer - grow it. */
1314 
1315  /* just a shorter name for the current buffer */
1316  YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1317 
1318  int yy_c_buf_p_offset =
1319  (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1320 
1321  if ( b->yy_is_our_buffer )
1322  {
1323  int new_size = b->yy_buf_size * 2;
1324 
1325  if ( new_size <= 0 )
1326  b->yy_buf_size += b->yy_buf_size / 8;
1327  else
1328  b->yy_buf_size *= 2;
1329 
1330  b->yy_ch_buf = (char *)
1331  /* Include room in for 2 EOB chars. */
1332  execute_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1333  }
1334  else
1335  /* Can't grow it, we don't own it. */
1336  b->yy_ch_buf = 0;
1337 
1338  if ( ! b->yy_ch_buf )
1339  YY_FATAL_ERROR(
1340  "fatal error - scanner input buffer overflow" );
1341 
1342  yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1343 
1344  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1345  number_to_move - 1;
1346 
1347  }
1348 
1349  if ( num_to_read > YY_READ_BUF_SIZE )
1350  num_to_read = YY_READ_BUF_SIZE;
1351 
1352  /* Read in more data. */
1353  YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1354  yyg->yy_n_chars, (size_t) num_to_read );
1355 
1356  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1357  }
1358 
1359  if ( yyg->yy_n_chars == 0 )
1360  {
1361  if ( number_to_move == YY_MORE_ADJ )
1362  {
1363  ret_val = EOB_ACT_END_OF_FILE;
1364  execute_restart(yyin ,yyscanner);
1365  }
1366 
1367  else
1368  {
1369  ret_val = EOB_ACT_LAST_MATCH;
1370  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1371  YY_BUFFER_EOF_PENDING;
1372  }
1373  }
1374 
1375  else
1376  ret_val = EOB_ACT_CONTINUE_SCAN;
1377 
1378  if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1379  /* Extend the array by 50%, plus the number we really need. */
1380  yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1381  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) execute_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
1382  if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1383  YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1384  }
1385 
1386  yyg->yy_n_chars += number_to_move;
1387  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1388  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1389 
1390  yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1391 
1392  return ret_val;
1393 }
1394 
1395 /* yy_get_previous_state - get the state just before the EOB char was reached */
1396 
1397 /* %if-c-only */
1398 /* %not-for-header */
1399 
1400  static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1401 /* %endif */
1402 /* %if-c++-only */
1403 /* %endif */
1404 {
1405  register yy_state_type yy_current_state;
1406  register char *yy_cp;
1407  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1408 
1409 /* %% [15.0] code to get the start state into yy_current_state goes here */
1410  yy_current_state = yyg->yy_start;
1411 
1412  for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1413  {
1414 /* %% [16.0] code to find the next state goes here */
1415  register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1416  if ( yy_accept[yy_current_state] )
1417  {
1418  yyg->yy_last_accepting_state = yy_current_state;
1419  yyg->yy_last_accepting_cpos = yy_cp;
1420  }
1421  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1422  {
1423  yy_current_state = (int) yy_def[yy_current_state];
1424  if ( yy_current_state >= 46 )
1425  yy_c = yy_meta[(unsigned int) yy_c];
1426  }
1427  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1428  }
1429 
1430  return yy_current_state;
1431 }
1432 
1433 /* yy_try_NUL_trans - try to make a transition on the NUL character
1434  *
1435  * synopsis
1436  * next_state = yy_try_NUL_trans( current_state );
1437  */
1438 /* %if-c-only */
1439  static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1440 /* %endif */
1441 /* %if-c++-only */
1442 /* %endif */
1443 {
1444  register int yy_is_jam;
1445  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1446 /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
1447  register char *yy_cp = yyg->yy_c_buf_p;
1448 
1449  register YY_CHAR yy_c = 1;
1450  if ( yy_accept[yy_current_state] )
1451  {
1452  yyg->yy_last_accepting_state = yy_current_state;
1453  yyg->yy_last_accepting_cpos = yy_cp;
1454  }
1455  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1456  {
1457  yy_current_state = (int) yy_def[yy_current_state];
1458  if ( yy_current_state >= 46 )
1459  yy_c = yy_meta[(unsigned int) yy_c];
1460  }
1461  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1462  yy_is_jam = (yy_current_state == 45);
1463 
1464  return yy_is_jam ? 0 : yy_current_state;
1465 }
1466 
1467 /* %if-c-only */
1468 
1469 /* %endif */
1470 
1471 /* %if-c-only */
1472 #ifndef YY_NO_INPUT
1473 #ifdef __cplusplus
1474  static int yyinput (yyscan_t yyscanner)
1475 #else
1476  static int input (yyscan_t yyscanner)
1477 #endif
1478 
1479 /* %endif */
1480 /* %if-c++-only */
1481 /* %endif */
1482 {
1483  int c;
1484  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1485 
1486  *yyg->yy_c_buf_p = yyg->yy_hold_char;
1487 
1488  if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1489  {
1490  /* yy_c_buf_p now points to the character we want to return.
1491  * If this occurs *before* the EOB characters, then it's a
1492  * valid NUL; if not, then we've hit the end of the buffer.
1493  */
1494  if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1495  /* This was really a NUL. */
1496  *yyg->yy_c_buf_p = '\0';
1497 
1498  else
1499  { /* need more input */
1500  int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1501  ++yyg->yy_c_buf_p;
1502 
1503  switch ( yy_get_next_buffer( yyscanner ) )
1504  {
1505  case EOB_ACT_LAST_MATCH:
1506  /* This happens because yy_g_n_b()
1507  * sees that we've accumulated a
1508  * token and flags that we need to
1509  * try matching the token before
1510  * proceeding. But for input(),
1511  * there's no matching to consider.
1512  * So convert the EOB_ACT_LAST_MATCH
1513  * to EOB_ACT_END_OF_FILE.
1514  */
1515 
1516  /* Reset buffer status. */
1517  execute_restart(yyin ,yyscanner);
1518 
1519  /*FALLTHROUGH*/
1520 
1521  case EOB_ACT_END_OF_FILE:
1522  {
1523  if ( execute_wrap(yyscanner ) )
1524  return EOF;
1525 
1526  if ( ! yyg->yy_did_buffer_switch_on_eof )
1527  YY_NEW_FILE;
1528 #ifdef __cplusplus
1529  return yyinput(yyscanner);
1530 #else
1531  return input(yyscanner);
1532 #endif
1533  }
1534 
1535  case EOB_ACT_CONTINUE_SCAN:
1536  yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1537  break;
1538  }
1539  }
1540  }
1541 
1542  c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1543  *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1544  yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1545 
1546 /* %% [19.0] update BOL and yylineno */
1547 
1548  return c;
1549 }
1550 /* %if-c-only */
1551 #endif /* ifndef YY_NO_INPUT */
1552 /* %endif */
1553 
1559 /* %if-c-only */
1560  void execute_restart (FILE * input_file , yyscan_t yyscanner)
1561 /* %endif */
1562 /* %if-c++-only */
1563 /* %endif */
1564 {
1565  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1566 
1567  if ( ! YY_CURRENT_BUFFER ){
1568  execute_ensure_buffer_stack (yyscanner);
1569  YY_CURRENT_BUFFER_LVALUE =
1570  execute__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1571  }
1572 
1573  execute__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1574  execute__load_buffer_state(yyscanner );
1575 }
1576 
1581 /* %if-c-only */
1582  void execute__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1583 /* %endif */
1584 /* %if-c++-only */
1585 /* %endif */
1586 {
1587  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1588 
1589  /* TODO. We should be able to replace this entire function body
1590  * with
1591  * execute_pop_buffer_state();
1592  * execute_push_buffer_state(new_buffer);
1593  */
1594  execute_ensure_buffer_stack (yyscanner);
1595  if ( YY_CURRENT_BUFFER == new_buffer )
1596  return;
1597 
1598  if ( YY_CURRENT_BUFFER )
1599  {
1600  /* Flush out information for old buffer. */
1601  *yyg->yy_c_buf_p = yyg->yy_hold_char;
1602  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1603  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1604  }
1605 
1606  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1607  execute__load_buffer_state(yyscanner );
1608 
1609  /* We don't actually know whether we did this switch during
1610  * EOF (execute_wrap()) processing, but the only time this flag
1611  * is looked at is after execute_wrap() is called, so it's safe
1612  * to go ahead and always set it.
1613  */
1614  yyg->yy_did_buffer_switch_on_eof = 1;
1615 }
1616 
1617 /* %if-c-only */
1618 static void execute__load_buffer_state (yyscan_t yyscanner)
1619 /* %endif */
1620 /* %if-c++-only */
1621 /* %endif */
1622 {
1623  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1624  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1625  yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1626  yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1627  yyg->yy_hold_char = *yyg->yy_c_buf_p;
1628 }
1629 
1636 /* %if-c-only */
1637  YY_BUFFER_STATE execute__create_buffer (FILE * file, int size , yyscan_t yyscanner)
1638 /* %endif */
1639 /* %if-c++-only */
1640 /* %endif */
1641 {
1642  YY_BUFFER_STATE b;
1643 
1644  b = (YY_BUFFER_STATE) execute_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1645  if ( ! b )
1646  YY_FATAL_ERROR( "out of dynamic memory in execute__create_buffer()" );
1647 
1648  b->yy_buf_size = size;
1649 
1650  /* yy_ch_buf has to be 2 characters longer than the size given because
1651  * we need to put in 2 end-of-buffer characters.
1652  */
1653  b->yy_ch_buf = (char *) execute_alloc(b->yy_buf_size + 2 ,yyscanner );
1654  if ( ! b->yy_ch_buf )
1655  YY_FATAL_ERROR( "out of dynamic memory in execute__create_buffer()" );
1656 
1657  b->yy_is_our_buffer = 1;
1658 
1659  execute__init_buffer(b,file ,yyscanner);
1660 
1661  return b;
1662 }
1663 
1668 /* %if-c-only */
1669  void execute__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1670 /* %endif */
1671 /* %if-c++-only */
1672 /* %endif */
1673 {
1674  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1675 
1676  if ( ! b )
1677  return;
1678 
1679  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1680  YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1681 
1682  if ( b->yy_is_our_buffer )
1683  execute_free((void *) b->yy_ch_buf ,yyscanner );
1684 
1685  execute_free((void *) b ,yyscanner );
1686 }
1687 
1688 /* %if-c-only */
1689 
1690 /* %endif */
1691 
1692 /* %if-c++-only */
1693 /* %endif */
1694 
1695 /* Initializes or reinitializes a buffer.
1696  * This function is sometimes called more than once on the same buffer,
1697  * such as during a execute_restart() or at EOF.
1698  */
1699 /* %if-c-only */
1700  static void execute__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
1701 /* %endif */
1702 /* %if-c++-only */
1703 /* %endif */
1704 
1705 {
1706  int oerrno = errno;
1707  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1708 
1709  execute__flush_buffer(b ,yyscanner);
1710 
1711  b->yy_input_file = file;
1712  b->yy_fill_buffer = 1;
1713 
1714  /* If b is the current buffer, then execute__init_buffer was _probably_
1715  * called from execute_restart() or through yy_get_next_buffer.
1716  * In that case, we don't want to reset the lineno or column.
1717  */
1718  if (b != YY_CURRENT_BUFFER){
1719  b->yy_bs_lineno = 1;
1720  b->yy_bs_column = 0;
1721  }
1722 
1723 /* %if-c-only */
1724 
1725  b->yy_is_interactive = 0;
1726 
1727 /* %endif */
1728 /* %if-c++-only */
1729 /* %endif */
1730  errno = oerrno;
1731 }
1732 
1737 /* %if-c-only */
1738  void execute__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1739 /* %endif */
1740 /* %if-c++-only */
1741 /* %endif */
1742 {
1743  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1744  if ( ! b )
1745  return;
1746 
1747  b->yy_n_chars = 0;
1748 
1749  /* We always need two end-of-buffer characters. The first causes
1750  * a transition to the end-of-buffer state. The second causes
1751  * a jam in that state.
1752  */
1753  b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1754  b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1755 
1756  b->yy_buf_pos = &b->yy_ch_buf[0];
1757 
1758  b->yy_at_bol = 1;
1759  b->yy_buffer_status = YY_BUFFER_NEW;
1760 
1761  if ( b == YY_CURRENT_BUFFER )
1762  execute__load_buffer_state(yyscanner );
1763 }
1764 
1765 /* %if-c-or-c++ */
1772 /* %if-c-only */
1773 void execute_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1774 /* %endif */
1775 /* %if-c++-only */
1776 /* %endif */
1777 {
1778  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1779  if (new_buffer == NULL)
1780  return;
1781 
1782  execute_ensure_buffer_stack(yyscanner);
1783 
1784  /* This block is copied from execute__switch_to_buffer. */
1785  if ( YY_CURRENT_BUFFER )
1786  {
1787  /* Flush out information for old buffer. */
1788  *yyg->yy_c_buf_p = yyg->yy_hold_char;
1789  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1790  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1791  }
1792 
1793  /* Only push if top exists. Otherwise, replace top. */
1794  if (YY_CURRENT_BUFFER)
1795  yyg->yy_buffer_stack_top++;
1796  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1797 
1798  /* copied from execute__switch_to_buffer. */
1799  execute__load_buffer_state(yyscanner );
1800  yyg->yy_did_buffer_switch_on_eof = 1;
1801 }
1802 /* %endif */
1803 
1804 /* %if-c-or-c++ */
1809 /* %if-c-only */
1810 void execute_pop_buffer_state (yyscan_t yyscanner)
1811 /* %endif */
1812 /* %if-c++-only */
1813 /* %endif */
1814 {
1815  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1816  if (!YY_CURRENT_BUFFER)
1817  return;
1818 
1819  execute__delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
1820  YY_CURRENT_BUFFER_LVALUE = NULL;
1821  if (yyg->yy_buffer_stack_top > 0)
1822  --yyg->yy_buffer_stack_top;
1823 
1824  if (YY_CURRENT_BUFFER) {
1825  execute__load_buffer_state(yyscanner );
1826  yyg->yy_did_buffer_switch_on_eof = 1;
1827  }
1828 }
1829 /* %endif */
1830 
1831 /* %if-c-or-c++ */
1832 /* Allocates the stack if it does not exist.
1833  * Guarantees space for at least one push.
1834  */
1835 /* %if-c-only */
1836 static void execute_ensure_buffer_stack (yyscan_t yyscanner)
1837 /* %endif */
1838 /* %if-c++-only */
1839 /* %endif */
1840 {
1841  int num_to_alloc;
1842  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1843 
1844  if (!yyg->yy_buffer_stack) {
1845 
1846  /* First allocation is just for 2 elements, since we don't know if this
1847  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1848  * immediate realloc on the next call.
1849  */
1850  num_to_alloc = 1;
1851  yyg->yy_buffer_stack = (struct yy_buffer_state**)execute_alloc
1852  (num_to_alloc * sizeof(struct yy_buffer_state*)
1853  , yyscanner);
1854  if ( ! yyg->yy_buffer_stack )
1855  YY_FATAL_ERROR( "out of dynamic memory in execute_ensure_buffer_stack()" );
1856 
1857  memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1858 
1859  yyg->yy_buffer_stack_max = num_to_alloc;
1860  yyg->yy_buffer_stack_top = 0;
1861  return;
1862  }
1863 
1864  if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
1865 
1866  /* Increase the buffer to prepare for a possible push. */
1867  int grow_size = 8 /* arbitrary grow size */;
1868 
1869  num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
1870  yyg->yy_buffer_stack = (struct yy_buffer_state**)execute_realloc
1871  (yyg->yy_buffer_stack,
1872  num_to_alloc * sizeof(struct yy_buffer_state*)
1873  , yyscanner);
1874  if ( ! yyg->yy_buffer_stack )
1875  YY_FATAL_ERROR( "out of dynamic memory in execute_ensure_buffer_stack()" );
1876 
1877  /* zero only the new slots.*/
1878  memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
1879  yyg->yy_buffer_stack_max = num_to_alloc;
1880  }
1881 }
1882 /* %endif */
1883 
1884 /* %if-c-only */
1891 YY_BUFFER_STATE execute__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
1892 {
1893  YY_BUFFER_STATE b;
1894 
1895  if ( size < 2 ||
1896  base[size-2] != YY_END_OF_BUFFER_CHAR ||
1897  base[size-1] != YY_END_OF_BUFFER_CHAR )
1898  /* They forgot to leave room for the EOB's. */
1899  return 0;
1900 
1901  b = (YY_BUFFER_STATE) execute_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1902  if ( ! b )
1903  YY_FATAL_ERROR( "out of dynamic memory in execute__scan_buffer()" );
1904 
1905  b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1906  b->yy_buf_pos = b->yy_ch_buf = base;
1907  b->yy_is_our_buffer = 0;
1908  b->yy_input_file = 0;
1909  b->yy_n_chars = b->yy_buf_size;
1910  b->yy_is_interactive = 0;
1911  b->yy_at_bol = 1;
1912  b->yy_fill_buffer = 0;
1913  b->yy_buffer_status = YY_BUFFER_NEW;
1914 
1915  execute__switch_to_buffer(b ,yyscanner );
1916 
1917  return b;
1918 }
1919 /* %endif */
1920 
1921 /* %if-c-only */
1930 YY_BUFFER_STATE execute__scan_string (yyconst char * yystr , yyscan_t yyscanner)
1931 {
1932 
1933  return execute__scan_bytes(yystr,strlen(yystr) ,yyscanner);
1934 }
1935 /* %endif */
1936 
1937 /* %if-c-only */
1945 YY_BUFFER_STATE execute__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
1946 {
1947  YY_BUFFER_STATE b;
1948  char *buf;
1949  yy_size_t n;
1950  int i;
1951 
1952  /* Get memory for full buffer, including space for trailing EOB's. */
1953  n = _yybytes_len + 2;
1954  buf = (char *) execute_alloc(n ,yyscanner );
1955  if ( ! buf )
1956  YY_FATAL_ERROR( "out of dynamic memory in execute__scan_bytes()" );
1957 
1958  for ( i = 0; i < _yybytes_len; ++i )
1959  buf[i] = yybytes[i];
1960 
1961  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1962 
1963  b = execute__scan_buffer(buf,n ,yyscanner);
1964  if ( ! b )
1965  YY_FATAL_ERROR( "bad buffer in execute__scan_bytes()" );
1966 
1967  /* It's okay to grow etc. this buffer, and we should throw it
1968  * away when we're done.
1969  */
1970  b->yy_is_our_buffer = 1;
1971 
1972  return b;
1973 }
1974 /* %endif */
1975 
1976 #ifndef YY_EXIT_FAILURE
1977 #define YY_EXIT_FAILURE 2
1978 #endif
1979 
1980 /* %if-c-only */
1981 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
1982 {
1983  (void) fprintf( stderr, "%s\n", msg );
1984  exit( YY_EXIT_FAILURE );
1985 }
1986 /* %endif */
1987 /* %if-c++-only */
1988 /* %endif */
1989 
1990 /* Redefine yyless() so it works in section 3 code. */
1991 
1992 #undef yyless
1993 #define yyless(n) \
1994  do \
1995  { \
1996  /* Undo effects of setting up yytext. */ \
1997  int yyless_macro_arg = (n); \
1998  YY_LESS_LINENO(yyless_macro_arg);\
1999  yytext[yyleng] = yyg->yy_hold_char; \
2000  yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2001  yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2002  *yyg->yy_c_buf_p = '\0'; \
2003  yyleng = yyless_macro_arg; \
2004  } \
2005  while ( 0 )
2006 
2007 /* Accessor methods (get/set functions) to struct members. */
2008 
2009 /* %if-c-only */
2010 /* %if-reentrant */
2011 
2015 YY_EXTRA_TYPE execute_get_extra (yyscan_t yyscanner)
2016 {
2017  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2018  return yyextra;
2019 }
2020 
2021 /* %endif */
2022 
2026 int execute_get_lineno (yyscan_t yyscanner)
2027 {
2028  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2029 
2030  if (! YY_CURRENT_BUFFER)
2031  return 0;
2032 
2033  return yylineno;
2034 }
2035 
2039 int execute_get_column (yyscan_t yyscanner)
2040 {
2041  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2042 
2043  if (! YY_CURRENT_BUFFER)
2044  return 0;
2045 
2046  return yycolumn;
2047 }
2048 
2052 FILE *execute_get_in (yyscan_t yyscanner)
2053 {
2054  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2055  return yyin;
2056 }
2057 
2061 FILE *execute_get_out (yyscan_t yyscanner)
2062 {
2063  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2064  return yyout;
2065 }
2066 
2070 int execute_get_leng (yyscan_t yyscanner)
2071 {
2072  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2073  return yyleng;
2074 }
2075 
2080 char *execute_get_text (yyscan_t yyscanner)
2081 {
2082  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2083  return yytext;
2084 }
2085 
2086 /* %if-reentrant */
2087 
2092 void execute_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
2093 {
2094  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2095  yyextra = user_defined ;
2096 }
2097 
2098 /* %endif */
2099 
2104 void execute_set_lineno (int line_number , yyscan_t yyscanner)
2105 {
2106  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2107 
2108  /* lineno is only valid if an input buffer exists. */
2109  if (! YY_CURRENT_BUFFER )
2110  yy_fatal_error( "execute_set_lineno called with no buffer" , yyscanner);
2111 
2112  yylineno = line_number;
2113 }
2114 
2119 void execute_set_column (int column_no , yyscan_t yyscanner)
2120 {
2121  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2122 
2123  /* column is only valid if an input buffer exists. */
2124  if (! YY_CURRENT_BUFFER )
2125  yy_fatal_error( "execute_set_column called with no buffer" , yyscanner);
2126 
2127  yycolumn = column_no;
2128 }
2129 
2136 void execute_set_in (FILE * in_str , yyscan_t yyscanner)
2137 {
2138  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2139  yyin = in_str ;
2140 }
2141 
2142 void execute_set_out (FILE * out_str , yyscan_t yyscanner)
2143 {
2144  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2145  yyout = out_str ;
2146 }
2147 
2148 int execute_get_debug (yyscan_t yyscanner)
2149 {
2150  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2151  return yy_flex_debug;
2152 }
2153 
2154 void execute_set_debug (int bdebug , yyscan_t yyscanner)
2155 {
2156  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2157  yy_flex_debug = bdebug ;
2158 }
2159 
2160 /* %endif */
2161 
2162 /* %if-reentrant */
2163 /* Accessor methods for yylval and yylloc */
2164 
2165 /* %if-bison-bridge */
2166 
2167 YYSTYPE * execute_get_lval (yyscan_t yyscanner)
2168 {
2169  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2170  return yylval;
2171 }
2172 
2173 void execute_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
2174 {
2175  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2176  yylval = yylval_param;
2177 }
2178 
2179 /* %endif */
2180 
2181 /* User-visible API */
2182 
2183 /* execute_lex_init is special because it creates the scanner itself, so it is
2184  * the ONLY reentrant function that doesn't take the scanner as the last argument.
2185  * That's why we explicitly handle the declaration, instead of using our macros.
2186  */
2187 
2188 int execute_lex_init(yyscan_t* ptr_yy_globals)
2189 
2190 {
2191  if (ptr_yy_globals == NULL){
2192  errno = EINVAL;
2193  return 1;
2194  }
2195 
2196  *ptr_yy_globals = (yyscan_t) execute_alloc ( sizeof( struct yyguts_t ), NULL );
2197 
2198  if (*ptr_yy_globals == NULL){
2199  errno = ENOMEM;
2200  return 1;
2201  }
2202 
2203  /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2204  memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2205 
2206  return yy_init_globals ( *ptr_yy_globals );
2207 }
2208 
2209 /* execute_lex_init_extra has the same functionality as execute_lex_init, but follows the
2210  * convention of taking the scanner as the last argument. Note however, that
2211  * this is a *pointer* to a scanner, as it will be allocated by this call (and
2212  * is the reason, too, why this function also must handle its own declaration).
2213  * The user defined value in the first argument will be available to execute_alloc in
2214  * the yyextra field.
2215  */
2216 
2217 int execute_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
2218 
2219 {
2220  struct yyguts_t dummy_yyguts;
2221 
2222  execute_set_extra (yy_user_defined, &dummy_yyguts);
2223 
2224  if (ptr_yy_globals == NULL){
2225  errno = EINVAL;
2226  return 1;
2227  }
2228 
2229  *ptr_yy_globals = (yyscan_t) execute_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2230 
2231  if (*ptr_yy_globals == NULL){
2232  errno = ENOMEM;
2233  return 1;
2234  }
2235 
2236  /* By setting to 0xAA, we expose bugs in
2237  yy_init_globals. Leave at 0x00 for releases. */
2238  memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2239 
2240  execute_set_extra (yy_user_defined, *ptr_yy_globals);
2241 
2242  return yy_init_globals ( *ptr_yy_globals );
2243 }
2244 
2245 /* %endif if-c-only */
2246 
2247 /* %if-c-only */
2248 static int yy_init_globals (yyscan_t yyscanner)
2249 {
2250  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2251  /* Initialization is the same as for the non-reentrant scanner.
2252  * This function is called from execute_lex_destroy(), so don't allocate here.
2253  */
2254 
2255  yyg->yy_buffer_stack = 0;
2256  yyg->yy_buffer_stack_top = 0;
2257  yyg->yy_buffer_stack_max = 0;
2258  yyg->yy_c_buf_p = (char *) 0;
2259  yyg->yy_init = 0;
2260  yyg->yy_start = 0;
2261 
2262  yyg->yy_start_stack_ptr = 0;
2263  yyg->yy_start_stack_depth = 0;
2264  yyg->yy_start_stack = NULL;
2265 
2266 /* Defined in main.c */
2267 #ifdef YY_STDINIT
2268  yyin = stdin;
2269  yyout = stdout;
2270 #else
2271  yyin = (FILE *) 0;
2272  yyout = (FILE *) 0;
2273 #endif
2274 
2275  /* For future reference: Set errno on error, since we are called by
2276  * execute_lex_init()
2277  */
2278  return 0;
2279 }
2280 /* %endif */
2281 
2282 /* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
2283 /* execute_lex_destroy is for both reentrant and non-reentrant scanners. */
2284 int execute_lex_destroy (yyscan_t yyscanner)
2285 {
2286  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2287 
2288  /* Pop the buffer stack, destroying each element. */
2289  while(YY_CURRENT_BUFFER){
2290  execute__delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
2291  YY_CURRENT_BUFFER_LVALUE = NULL;
2292  execute_pop_buffer_state(yyscanner);
2293  }
2294 
2295  /* Destroy the stack itself. */
2296  execute_free(yyg->yy_buffer_stack ,yyscanner);
2297  yyg->yy_buffer_stack = NULL;
2298 
2299  /* Destroy the start condition stack. */
2300  execute_free(yyg->yy_start_stack ,yyscanner );
2301  yyg->yy_start_stack = NULL;
2302 
2303  /* Reset the globals. This is important in a non-reentrant scanner so the next time
2304  * execute_lex() is called, initialization will occur. */
2305  yy_init_globals( yyscanner);
2306 
2307 /* %if-reentrant */
2308  /* Destroy the main struct (reentrant only). */
2309  execute_free ( yyscanner , yyscanner );
2310  yyscanner = NULL;
2311 /* %endif */
2312  return 0;
2313 }
2314 /* %endif */
2315 
2316 /*
2317  * Internal utility routines.
2318  */
2319 
2320 #ifndef yytext_ptr
2321 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
2322 {
2323  register int i;
2324  for ( i = 0; i < n; ++i )
2325  s1[i] = s2[i];
2326 }
2327 #endif
2328 
2329 #ifdef YY_NEED_STRLEN
2330 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
2331 {
2332  register int n;
2333  for ( n = 0; s[n]; ++n )
2334  ;
2335 
2336  return n;
2337 }
2338 #endif
2339 
2340 void *execute_alloc (yy_size_t size , yyscan_t yyscanner)
2341 {
2342  return (void *) malloc( size );
2343 }
2344 
2345 void *execute_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
2346 {
2347  /* The cast to (char *) in the following accommodates both
2348  * implementations that use char* generic pointers, and those
2349  * that use void* generic pointers. It works with the latter
2350  * because both ANSI C and C++ allow castless assignment from
2351  * any pointer type to void*, and deal with argument conversions
2352  * as though doing an assignment.
2353  */
2354  return (void *) realloc( (char *) ptr, size );
2355 }
2356 
2357 void execute_free (void * ptr , yyscan_t yyscanner)
2358 {
2359  free( (char *) ptr ); /* see execute_realloc() for (char *) cast */
2360 }
2361 
2362 /* %if-tables-serialization definitions */
2363 /* %define-yytables The name for this specific scanner's tables. */
2364 #define YYTABLES_NAME "yytables"
2365 /* %endif */
2366 
2367 /* %ok-for-header */
2368 
2369 #line 138 "drizzled/execute/scanner.l"
2370 
2371 
2372 namespace drizzled {
2373 namespace execute {
2374 
2375 void Context::init_scanner()
2376 {
2377  execute_lex_init(&scanner);
2378  execute_set_extra(this,scanner);
2379 }
2380 
2381 void Context::destroy_scanner()
2382 {
2383  execute_lex_destroy(scanner);
2384 }
2385 
2386 } // namespace execute
2387 } // namespace drizzled
2388 
2389