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