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 /* %if-bison-bridge */
773 
774 YYSTYPE * execute_get_lval (yyscan_t yyscanner );
775 
776 void execute_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
777 
778 /* %endif */
779 
780 /* Macros after this point can all be overridden by user definitions in
781  * section 1.
782  */
783 
784 #ifndef YY_SKIP_YYWRAP
785 #ifdef __cplusplus
786 extern "C" int execute_wrap (yyscan_t yyscanner );
787 #else
788 extern int execute_wrap (yyscan_t yyscanner );
789 #endif
790 #endif
791 
792 /* %not-for-header */
793 
794 /* %ok-for-header */
795 
796 /* %endif */
797 
798 #ifndef yytext_ptr
799 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
800 #endif
801 
802 #ifdef YY_NEED_STRLEN
803 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
804 #endif
805 
806 #ifndef YY_NO_INPUT
807 /* %if-c-only Standard (non-C++) definition */
808 /* %not-for-header */
809 
810 #ifdef __cplusplus
811 static int yyinput (yyscan_t yyscanner );
812 #else
813 static int input (yyscan_t yyscanner );
814 #endif
815 /* %ok-for-header */
816 
817 /* %endif */
818 #endif
819 
820 /* %if-c-only */
821 
822 /* %endif */
823 
824 /* Amount of stuff to slurp up with each read. */
825 #ifndef YY_READ_BUF_SIZE
826 #ifdef __ia64__
827 /* On IA-64, the buffer size is 16k, not 8k */
828 #define YY_READ_BUF_SIZE 16384
829 #else
830 #define YY_READ_BUF_SIZE 8192
831 #endif /* __ia64__ */
832 #endif
833 
834 /* Copy whatever the last rule matched to the standard output. */
835 #ifndef ECHO
836 /* %if-c-only Standard (non-C++) definition */
837 /* This used to be an fputs(), but since the string might contain NUL's,
838  * we now use fwrite().
839  */
840 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
841 /* %endif */
842 /* %if-c++-only C++ definition */
843 /* %endif */
844 #endif
845 
846 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
847  * is returned in "result".
848  */
849 #ifndef YY_INPUT
850 #define YY_INPUT(buf,result,max_size) \
851 /* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
852  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
853  { \
854  int c = '*'; \
855  size_t n; \
856  for ( n = 0; n < max_size && \
857  (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
858  buf[n] = (char) c; \
859  if ( c == '\n' ) \
860  buf[n++] = (char) c; \
861  if ( c == EOF && ferror( yyin ) ) \
862  YY_FATAL_ERROR( "input in flex scanner failed" ); \
863  result = n; \
864  } \
865  else \
866  { \
867  errno=0; \
868  while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
869  { \
870  if( errno != EINTR) \
871  { \
872  YY_FATAL_ERROR( "input in flex scanner failed" ); \
873  break; \
874  } \
875  errno=0; \
876  clearerr(yyin); \
877  } \
878  }\
879 \
880 /* %if-c++-only C++ definition \ */\
881 /* %endif */
882 
883 #endif
884 
885 /* No semi-colon after return; correct usage is to write "yyterminate();" -
886  * we don't want an extra ';' after the "return" because that will cause
887  * some compilers to complain about unreachable statements.
888  */
889 #ifndef yyterminate
890 #define yyterminate() return YY_NULL
891 #endif
892 
893 /* Number of entries by which start-condition stack grows. */
894 #ifndef YY_START_STACK_INCR
895 #define YY_START_STACK_INCR 25
896 #endif
897 
898 /* Report a fatal error. */
899 #ifndef YY_FATAL_ERROR
900 /* %if-c-only */
901 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
902 /* %endif */
903 /* %if-c++-only */
904 /* %endif */
905 #endif
906 
907 /* %if-tables-serialization structures and prototypes */
908 /* %not-for-header */
909 
910 /* %ok-for-header */
911 
912 /* %not-for-header */
913 
914 /* %tables-yydmap generated elements */
915 /* %endif */
916 /* end tables serialization structures and prototypes */
917 
918 /* %ok-for-header */
919 
920 /* Default declaration of generated scanner - a define so the user can
921  * easily add parameters.
922  */
923 #ifndef YY_DECL
924 #define YY_DECL_IS_OURS 1
925 /* %if-c-only Standard (non-C++) definition */
926 
927 extern int execute_lex \
928  (YYSTYPE * yylval_param ,yyscan_t yyscanner);
929 
930 #define YY_DECL int execute_lex \
931  (YYSTYPE * yylval_param , yyscan_t yyscanner)
932 /* %endif */
933 /* %if-c++-only C++ definition */
934 /* %endif */
935 #endif /* !YY_DECL */
936 
937 /* Code executed at the beginning of each rule, after yytext and yyleng
938  * have been set up.
939  */
940 #ifndef YY_USER_ACTION
941 #define YY_USER_ACTION
942 #endif
943 
944 /* Code executed at the end of each rule. */
945 #ifndef YY_BREAK
946 #define YY_BREAK break;
947 #endif
948 
949 /* %% [6.0] YY_RULE_SETUP definition goes here */
950 #define YY_RULE_SETUP \
951  YY_USER_ACTION
952 
953 /* %not-for-header */
954 
957 YY_DECL
958 {
959  register yy_state_type yy_current_state;
960  register char *yy_cp, *yy_bp;
961  register int yy_act;
962  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
963 
964 /* %% [7.0] user's declarations go here */
965 #line 126 "drizzled/execute/scanner.l"
966 
967 
968 #line 969 "drizzled/execute/scanner.cc"
969 
970  yylval = yylval_param;
971 
972  if ( !yyg->yy_init )
973  {
974  yyg->yy_init = 1;
975 
976 #ifdef YY_USER_INIT
977  YY_USER_INIT;
978 #endif
979 
980  if ( ! yyg->yy_start )
981  yyg->yy_start = 1; /* first start state */
982 
983  if ( ! yyin )
984 /* %if-c-only */
985  yyin = stdin;
986 /* %endif */
987 /* %if-c++-only */
988 /* %endif */
989 
990  if ( ! yyout )
991 /* %if-c-only */
992  yyout = stdout;
993 /* %endif */
994 /* %if-c++-only */
995 /* %endif */
996 
997  if ( ! YY_CURRENT_BUFFER ) {
998  execute_ensure_buffer_stack (yyscanner);
999  YY_CURRENT_BUFFER_LVALUE =
1000  execute__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1001  }
1002 
1003  execute__load_buffer_state(yyscanner );
1004  }
1005 
1006  while ( 1 ) /* loops until end-of-file is reached */
1007  {
1008 /* %% [8.0] yymore()-related code goes here */
1009  yy_cp = yyg->yy_c_buf_p;
1010 
1011  /* Support of yytext. */
1012  *yy_cp = yyg->yy_hold_char;
1013 
1014  /* yy_bp points to the position in yy_ch_buf of the start of
1015  * the current run.
1016  */
1017  yy_bp = yy_cp;
1018 
1019 /* %% [9.0] code to set up and find next match goes here */
1020  yy_current_state = yyg->yy_start;
1021 yy_match:
1022  do
1023  {
1024  register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1025  if ( yy_accept[yy_current_state] )
1026  {
1027  yyg->yy_last_accepting_state = yy_current_state;
1028  yyg->yy_last_accepting_cpos = yy_cp;
1029  }
1030  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1031  {
1032  yy_current_state = (int) yy_def[yy_current_state];
1033  if ( yy_current_state >= 46 )
1034  yy_c = yy_meta[(unsigned int) yy_c];
1035  }
1036  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1037  ++yy_cp;
1038  }
1039  while ( yy_current_state != 45 );
1040  yy_cp = yyg->yy_last_accepting_cpos;
1041  yy_current_state = yyg->yy_last_accepting_state;
1042 
1043 yy_find_action:
1044 /* %% [10.0] code to find the action number goes here */
1045  yy_act = yy_accept[yy_current_state];
1046 
1047  YY_DO_BEFORE_ACTION;
1048 
1049 /* %% [11.0] code for yylineno update goes here */
1050 
1051 do_action: /* This label is used only to access EOF actions. */
1052 
1053 /* %% [12.0] debug code goes here */
1054  if ( yy_flex_debug )
1055  {
1056  if ( yy_act == 0 )
1057  fprintf( stderr, "--scanner backing up\n" );
1058  else if ( yy_act < 5 )
1059  fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
1060  (long)yy_rule_linenum[yy_act], yytext );
1061  else if ( yy_act == 5 )
1062  fprintf( stderr, "--accepting default rule (\"%s\")\n",
1063  yytext );
1064  else if ( yy_act == 6 )
1065  fprintf( stderr, "--(end of buffer or a NUL)\n" );
1066  else
1067  fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
1068  }
1069 
1070  switch ( yy_act )
1071  { /* beginning of action switch */
1072 /* %% [13.0] actions go here */
1073  case 0: /* must back up */
1074  /* undo the effects of YY_DO_BEFORE_ACTION */
1075  *yy_cp = yyg->yy_hold_char;
1076  yy_cp = yyg->yy_last_accepting_cpos;
1077  yy_current_state = yyg->yy_last_accepting_state;
1078  goto yy_find_action;
1079 
1080 case 1:
1081 YY_RULE_SETUP
1082 #line 128 "drizzled/execute/scanner.l"
1083 { /* Byte Order Mark */ }
1084  YY_BREAK
1085 case 2:
1086 /* rule 2 can match eol */
1087 YY_RULE_SETUP
1088 #line 130 "drizzled/execute/scanner.l"
1089 ; /* skip whitespace */
1090  YY_BREAK
1091 case 3:
1092 /* rule 3 can match eol */
1093 YY_RULE_SETUP
1094 #line 133 "drizzled/execute/scanner.l"
1095 {
1096  yylval->string.assign(yytext, yyleng);
1097  return STRING;
1098  }
1099  YY_BREAK
1100 case 4:
1101 YY_RULE_SETUP
1102 #line 138 "drizzled/execute/scanner.l"
1103 {
1104  yyextra->begin= yytext;
1105  return UNKNOWN;
1106  }
1107  YY_BREAK
1108 case 5:
1109 YY_RULE_SETUP
1110 #line 143 "drizzled/execute/scanner.l"
1111 ECHO;
1112  YY_BREAK
1113 #line 1114 "drizzled/execute/scanner.cc"
1114 case YY_STATE_EOF(INITIAL):
1115  yyterminate();
1116 
1117  case YY_END_OF_BUFFER:
1118  {
1119  /* Amount of text matched not including the EOB char. */
1120  int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1121 
1122  /* Undo the effects of YY_DO_BEFORE_ACTION. */
1123  *yy_cp = yyg->yy_hold_char;
1124  YY_RESTORE_YY_MORE_OFFSET
1125 
1126  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1127  {
1128  /* We're scanning a new file or input source. It's
1129  * possible that this happened because the user
1130  * just pointed yyin at a new source and called
1131  * execute_lex(). If so, then we have to assure
1132  * consistency between YY_CURRENT_BUFFER and our
1133  * globals. Here is the right place to do so, because
1134  * this is the first action (other than possibly a
1135  * back-up) that will match for the new input source.
1136  */
1137  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1138  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1139  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1140  }
1141 
1142  /* Note that here we test for yy_c_buf_p "<=" to the position
1143  * of the first EOB in the buffer, since yy_c_buf_p will
1144  * already have been incremented past the NUL character
1145  * (since all states make transitions on EOB to the
1146  * end-of-buffer state). Contrast this with the test
1147  * in input().
1148  */
1149  if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1150  { /* This was really a NUL. */
1151  yy_state_type yy_next_state;
1152 
1153  yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1154 
1155  yy_current_state = yy_get_previous_state( yyscanner );
1156 
1157  /* Okay, we're now positioned to make the NUL
1158  * transition. We couldn't have
1159  * yy_get_previous_state() go ahead and do it
1160  * for us because it doesn't know how to deal
1161  * with the possibility of jamming (and we don't
1162  * want to build jamming into it because then it
1163  * will run more slowly).
1164  */
1165 
1166  yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1167 
1168  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1169 
1170  if ( yy_next_state )
1171  {
1172  /* Consume the NUL. */
1173  yy_cp = ++yyg->yy_c_buf_p;
1174  yy_current_state = yy_next_state;
1175  goto yy_match;
1176  }
1177 
1178  else
1179  {
1180 /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
1181  yy_cp = yyg->yy_last_accepting_cpos;
1182  yy_current_state = yyg->yy_last_accepting_state;
1183  goto yy_find_action;
1184  }
1185  }
1186 
1187  else switch ( yy_get_next_buffer( yyscanner ) )
1188  {
1189  case EOB_ACT_END_OF_FILE:
1190  {
1191  yyg->yy_did_buffer_switch_on_eof = 0;
1192 
1193  if ( execute_wrap(yyscanner ) )
1194  {
1195  /* Note: because we've taken care in
1196  * yy_get_next_buffer() to have set up
1197  * yytext, we can now set up
1198  * yy_c_buf_p so that if some total
1199  * hoser (like flex itself) wants to
1200  * call the scanner after we return the
1201  * YY_NULL, it'll still work - another
1202  * YY_NULL will get returned.
1203  */
1204  yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1205 
1206  yy_act = YY_STATE_EOF(YY_START);
1207  goto do_action;
1208  }
1209 
1210  else
1211  {
1212  if ( ! yyg->yy_did_buffer_switch_on_eof )
1213  YY_NEW_FILE;
1214  }
1215  break;
1216  }
1217 
1218  case EOB_ACT_CONTINUE_SCAN:
1219  yyg->yy_c_buf_p =
1220  yyg->yytext_ptr + yy_amount_of_matched_text;
1221 
1222  yy_current_state = yy_get_previous_state( yyscanner );
1223 
1224  yy_cp = yyg->yy_c_buf_p;
1225  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1226  goto yy_match;
1227 
1228  case EOB_ACT_LAST_MATCH:
1229  yyg->yy_c_buf_p =
1230  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1231 
1232  yy_current_state = yy_get_previous_state( yyscanner );
1233 
1234  yy_cp = yyg->yy_c_buf_p;
1235  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1236  goto yy_find_action;
1237  }
1238  break;
1239  }
1240 
1241  default:
1242  YY_FATAL_ERROR(
1243  "fatal flex scanner internal error--no action found" );
1244  } /* end of action switch */
1245  } /* end of scanning one token */
1246 } /* end of execute_lex */
1247 /* %ok-for-header */
1248 
1249 /* %if-c++-only */
1250 /* %not-for-header */
1251 
1252 /* %ok-for-header */
1253 
1254 /* %endif */
1255 
1256 /* yy_get_next_buffer - try to read in a new buffer
1257  *
1258  * Returns a code representing an action:
1259  * EOB_ACT_LAST_MATCH -
1260  * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1261  * EOB_ACT_END_OF_FILE - end of file
1262  */
1263 /* %if-c-only */
1264 static int yy_get_next_buffer (yyscan_t yyscanner)
1265 /* %endif */
1266 /* %if-c++-only */
1267 /* %endif */
1268 {
1269  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1270  register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1271  register char *source = yyg->yytext_ptr;
1272  register int number_to_move, i;
1273  int ret_val;
1274 
1275  if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1276  YY_FATAL_ERROR(
1277  "fatal flex scanner internal error--end of buffer missed" );
1278 
1279  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1280  { /* Don't try to fill the buffer, so this is an EOF. */
1281  if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1282  {
1283  /* We matched a single character, the EOB, so
1284  * treat this as a final EOF.
1285  */
1286  return EOB_ACT_END_OF_FILE;
1287  }
1288 
1289  else
1290  {
1291  /* We matched some text prior to the EOB, first
1292  * process it.
1293  */
1294  return EOB_ACT_LAST_MATCH;
1295  }
1296  }
1297 
1298  /* Try to read more data. */
1299 
1300  /* First move last chars to start of buffer. */
1301  number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1302 
1303  for ( i = 0; i < number_to_move; ++i )
1304  *(dest++) = *(source++);
1305 
1306  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1307  /* don't do the read, it's not guaranteed to return an EOF,
1308  * just force an EOF
1309  */
1310  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1311 
1312  else
1313  {
1314  int num_to_read =
1315  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1316 
1317  while ( num_to_read <= 0 )
1318  { /* Not enough room in the buffer - grow it. */
1319 
1320  /* just a shorter name for the current buffer */
1321  YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1322 
1323  int yy_c_buf_p_offset =
1324  (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1325 
1326  if ( b->yy_is_our_buffer )
1327  {
1328  int new_size = b->yy_buf_size * 2;
1329 
1330  if ( new_size <= 0 )
1331  b->yy_buf_size += b->yy_buf_size / 8;
1332  else
1333  b->yy_buf_size *= 2;
1334 
1335  b->yy_ch_buf = (char *)
1336  /* Include room in for 2 EOB chars. */
1337  execute_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1338  }
1339  else
1340  /* Can't grow it, we don't own it. */
1341  b->yy_ch_buf = 0;
1342 
1343  if ( ! b->yy_ch_buf )
1344  YY_FATAL_ERROR(
1345  "fatal error - scanner input buffer overflow" );
1346 
1347  yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1348 
1349  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1350  number_to_move - 1;
1351 
1352  }
1353 
1354  if ( num_to_read > YY_READ_BUF_SIZE )
1355  num_to_read = YY_READ_BUF_SIZE;
1356 
1357  /* Read in more data. */
1358  YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1359  yyg->yy_n_chars, (size_t) num_to_read );
1360 
1361  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1362  }
1363 
1364  if ( yyg->yy_n_chars == 0 )
1365  {
1366  if ( number_to_move == YY_MORE_ADJ )
1367  {
1368  ret_val = EOB_ACT_END_OF_FILE;
1369  execute_restart(yyin ,yyscanner);
1370  }
1371 
1372  else
1373  {
1374  ret_val = EOB_ACT_LAST_MATCH;
1375  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1376  YY_BUFFER_EOF_PENDING;
1377  }
1378  }
1379 
1380  else
1381  ret_val = EOB_ACT_CONTINUE_SCAN;
1382 
1383  if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1384  /* Extend the array by 50%, plus the number we really need. */
1385  yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1386  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) execute_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
1387  if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1388  YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1389  }
1390 
1391  yyg->yy_n_chars += number_to_move;
1392  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1393  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1394 
1395  yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1396 
1397  return ret_val;
1398 }
1399 
1400 /* yy_get_previous_state - get the state just before the EOB char was reached */
1401 
1402 /* %if-c-only */
1403 /* %not-for-header */
1404 
1405  static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1406 /* %endif */
1407 /* %if-c++-only */
1408 /* %endif */
1409 {
1410  register yy_state_type yy_current_state;
1411  register char *yy_cp;
1412  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1413 
1414 /* %% [15.0] code to get the start state into yy_current_state goes here */
1415  yy_current_state = yyg->yy_start;
1416 
1417  for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1418  {
1419 /* %% [16.0] code to find the next state goes here */
1420  register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1421  if ( yy_accept[yy_current_state] )
1422  {
1423  yyg->yy_last_accepting_state = yy_current_state;
1424  yyg->yy_last_accepting_cpos = yy_cp;
1425  }
1426  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1427  {
1428  yy_current_state = (int) yy_def[yy_current_state];
1429  if ( yy_current_state >= 46 )
1430  yy_c = yy_meta[(unsigned int) yy_c];
1431  }
1432  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1433  }
1434 
1435  return yy_current_state;
1436 }
1437 
1438 /* yy_try_NUL_trans - try to make a transition on the NUL character
1439  *
1440  * synopsis
1441  * next_state = yy_try_NUL_trans( current_state );
1442  */
1443 /* %if-c-only */
1444  static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1445 /* %endif */
1446 /* %if-c++-only */
1447 /* %endif */
1448 {
1449  register int yy_is_jam;
1450  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1451 /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
1452  register char *yy_cp = yyg->yy_c_buf_p;
1453 
1454  register YY_CHAR yy_c = 1;
1455  if ( yy_accept[yy_current_state] )
1456  {
1457  yyg->yy_last_accepting_state = yy_current_state;
1458  yyg->yy_last_accepting_cpos = yy_cp;
1459  }
1460  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1461  {
1462  yy_current_state = (int) yy_def[yy_current_state];
1463  if ( yy_current_state >= 46 )
1464  yy_c = yy_meta[(unsigned int) yy_c];
1465  }
1466  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1467  yy_is_jam = (yy_current_state == 45);
1468 
1469  return yy_is_jam ? 0 : yy_current_state;
1470 }
1471 
1472 /* %if-c-only */
1473 
1474 /* %endif */
1475 
1476 /* %if-c-only */
1477 #ifndef YY_NO_INPUT
1478 #ifdef __cplusplus
1479  static int yyinput (yyscan_t yyscanner)
1480 #else
1481  static int input (yyscan_t yyscanner)
1482 #endif
1483 
1484 /* %endif */
1485 /* %if-c++-only */
1486 /* %endif */
1487 {
1488  int c;
1489  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1490 
1491  *yyg->yy_c_buf_p = yyg->yy_hold_char;
1492 
1493  if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1494  {
1495  /* yy_c_buf_p now points to the character we want to return.
1496  * If this occurs *before* the EOB characters, then it's a
1497  * valid NUL; if not, then we've hit the end of the buffer.
1498  */
1499  if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1500  /* This was really a NUL. */
1501  *yyg->yy_c_buf_p = '\0';
1502 
1503  else
1504  { /* need more input */
1505  int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1506  ++yyg->yy_c_buf_p;
1507 
1508  switch ( yy_get_next_buffer( yyscanner ) )
1509  {
1510  case EOB_ACT_LAST_MATCH:
1511  /* This happens because yy_g_n_b()
1512  * sees that we've accumulated a
1513  * token and flags that we need to
1514  * try matching the token before
1515  * proceeding. But for input(),
1516  * there's no matching to consider.
1517  * So convert the EOB_ACT_LAST_MATCH
1518  * to EOB_ACT_END_OF_FILE.
1519  */
1520 
1521  /* Reset buffer status. */
1522  execute_restart(yyin ,yyscanner);
1523 
1524  /*FALLTHROUGH*/
1525 
1526  case EOB_ACT_END_OF_FILE:
1527  {
1528  if ( execute_wrap(yyscanner ) )
1529  return EOF;
1530 
1531  if ( ! yyg->yy_did_buffer_switch_on_eof )
1532  YY_NEW_FILE;
1533 #ifdef __cplusplus
1534  return yyinput(yyscanner);
1535 #else
1536  return input(yyscanner);
1537 #endif
1538  }
1539 
1540  case EOB_ACT_CONTINUE_SCAN:
1541  yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1542  break;
1543  }
1544  }
1545  }
1546 
1547  c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1548  *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1549  yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1550 
1551 /* %% [19.0] update BOL and yylineno */
1552 
1553  return c;
1554 }
1555 /* %if-c-only */
1556 #endif /* ifndef YY_NO_INPUT */
1557 /* %endif */
1558 
1564 /* %if-c-only */
1565  void execute_restart (FILE * input_file , yyscan_t yyscanner)
1566 /* %endif */
1567 /* %if-c++-only */
1568 /* %endif */
1569 {
1570  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1571 
1572  if ( ! YY_CURRENT_BUFFER ){
1573  execute_ensure_buffer_stack (yyscanner);
1574  YY_CURRENT_BUFFER_LVALUE =
1575  execute__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1576  }
1577 
1578  execute__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1579  execute__load_buffer_state(yyscanner );
1580 }
1581 
1586 /* %if-c-only */
1587  void execute__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1588 /* %endif */
1589 /* %if-c++-only */
1590 /* %endif */
1591 {
1592  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1593 
1594  /* TODO. We should be able to replace this entire function body
1595  * with
1596  * execute_pop_buffer_state();
1597  * execute_push_buffer_state(new_buffer);
1598  */
1599  execute_ensure_buffer_stack (yyscanner);
1600  if ( YY_CURRENT_BUFFER == new_buffer )
1601  return;
1602 
1603  if ( YY_CURRENT_BUFFER )
1604  {
1605  /* Flush out information for old buffer. */
1606  *yyg->yy_c_buf_p = yyg->yy_hold_char;
1607  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1608  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1609  }
1610 
1611  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1612  execute__load_buffer_state(yyscanner );
1613 
1614  /* We don't actually know whether we did this switch during
1615  * EOF (execute_wrap()) processing, but the only time this flag
1616  * is looked at is after execute_wrap() is called, so it's safe
1617  * to go ahead and always set it.
1618  */
1619  yyg->yy_did_buffer_switch_on_eof = 1;
1620 }
1621 
1622 /* %if-c-only */
1623 static void execute__load_buffer_state (yyscan_t yyscanner)
1624 /* %endif */
1625 /* %if-c++-only */
1626 /* %endif */
1627 {
1628  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1629  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1630  yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1631  yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1632  yyg->yy_hold_char = *yyg->yy_c_buf_p;
1633 }
1634 
1641 /* %if-c-only */
1642  YY_BUFFER_STATE execute__create_buffer (FILE * file, int size , yyscan_t yyscanner)
1643 /* %endif */
1644 /* %if-c++-only */
1645 /* %endif */
1646 {
1647  YY_BUFFER_STATE b;
1648 
1649  b = (YY_BUFFER_STATE) execute_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1650  if ( ! b )
1651  YY_FATAL_ERROR( "out of dynamic memory in execute__create_buffer()" );
1652 
1653  b->yy_buf_size = size;
1654 
1655  /* yy_ch_buf has to be 2 characters longer than the size given because
1656  * we need to put in 2 end-of-buffer characters.
1657  */
1658  b->yy_ch_buf = (char *) execute_alloc(b->yy_buf_size + 2 ,yyscanner );
1659  if ( ! b->yy_ch_buf )
1660  YY_FATAL_ERROR( "out of dynamic memory in execute__create_buffer()" );
1661 
1662  b->yy_is_our_buffer = 1;
1663 
1664  execute__init_buffer(b,file ,yyscanner);
1665 
1666  return b;
1667 }
1668 
1673 /* %if-c-only */
1674  void execute__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1675 /* %endif */
1676 /* %if-c++-only */
1677 /* %endif */
1678 {
1679  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1680 
1681  if ( ! b )
1682  return;
1683 
1684  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1685  YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1686 
1687  if ( b->yy_is_our_buffer )
1688  execute_free((void *) b->yy_ch_buf ,yyscanner );
1689 
1690  execute_free((void *) b ,yyscanner );
1691 }
1692 
1693 /* %if-c-only */
1694 
1695 /* %endif */
1696 
1697 /* %if-c++-only */
1698 /* %endif */
1699 
1700 /* Initializes or reinitializes a buffer.
1701  * This function is sometimes called more than once on the same buffer,
1702  * such as during a execute_restart() or at EOF.
1703  */
1704 /* %if-c-only */
1705  static void execute__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
1706 /* %endif */
1707 /* %if-c++-only */
1708 /* %endif */
1709 
1710 {
1711  int oerrno = errno;
1712  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1713 
1714  execute__flush_buffer(b ,yyscanner);
1715 
1716  b->yy_input_file = file;
1717  b->yy_fill_buffer = 1;
1718 
1719  /* If b is the current buffer, then execute__init_buffer was _probably_
1720  * called from execute_restart() or through yy_get_next_buffer.
1721  * In that case, we don't want to reset the lineno or column.
1722  */
1723  if (b != YY_CURRENT_BUFFER){
1724  b->yy_bs_lineno = 1;
1725  b->yy_bs_column = 0;
1726  }
1727 
1728 /* %if-c-only */
1729 
1730  b->yy_is_interactive = 0;
1731 
1732 /* %endif */
1733 /* %if-c++-only */
1734 /* %endif */
1735  errno = oerrno;
1736 }
1737 
1742 /* %if-c-only */
1743  void execute__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1744 /* %endif */
1745 /* %if-c++-only */
1746 /* %endif */
1747 {
1748  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1749  if ( ! b )
1750  return;
1751 
1752  b->yy_n_chars = 0;
1753 
1754  /* We always need two end-of-buffer characters. The first causes
1755  * a transition to the end-of-buffer state. The second causes
1756  * a jam in that state.
1757  */
1758  b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1759  b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1760 
1761  b->yy_buf_pos = &b->yy_ch_buf[0];
1762 
1763  b->yy_at_bol = 1;
1764  b->yy_buffer_status = YY_BUFFER_NEW;
1765 
1766  if ( b == YY_CURRENT_BUFFER )
1767  execute__load_buffer_state(yyscanner );
1768 }
1769 
1770 /* %if-c-or-c++ */
1777 /* %if-c-only */
1778 void execute_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1779 /* %endif */
1780 /* %if-c++-only */
1781 /* %endif */
1782 {
1783  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1784  if (new_buffer == NULL)
1785  return;
1786 
1787  execute_ensure_buffer_stack(yyscanner);
1788 
1789  /* This block is copied from execute__switch_to_buffer. */
1790  if ( YY_CURRENT_BUFFER )
1791  {
1792  /* Flush out information for old buffer. */
1793  *yyg->yy_c_buf_p = yyg->yy_hold_char;
1794  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1795  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1796  }
1797 
1798  /* Only push if top exists. Otherwise, replace top. */
1799  if (YY_CURRENT_BUFFER)
1800  yyg->yy_buffer_stack_top++;
1801  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1802 
1803  /* copied from execute__switch_to_buffer. */
1804  execute__load_buffer_state(yyscanner );
1805  yyg->yy_did_buffer_switch_on_eof = 1;
1806 }
1807 /* %endif */
1808 
1809 /* %if-c-or-c++ */
1814 /* %if-c-only */
1815 void execute_pop_buffer_state (yyscan_t yyscanner)
1816 /* %endif */
1817 /* %if-c++-only */
1818 /* %endif */
1819 {
1820  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1821  if (!YY_CURRENT_BUFFER)
1822  return;
1823 
1824  execute__delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
1825  YY_CURRENT_BUFFER_LVALUE = NULL;
1826  if (yyg->yy_buffer_stack_top > 0)
1827  --yyg->yy_buffer_stack_top;
1828 
1829  if (YY_CURRENT_BUFFER) {
1830  execute__load_buffer_state(yyscanner );
1831  yyg->yy_did_buffer_switch_on_eof = 1;
1832  }
1833 }
1834 /* %endif */
1835 
1836 /* %if-c-or-c++ */
1837 /* Allocates the stack if it does not exist.
1838  * Guarantees space for at least one push.
1839  */
1840 /* %if-c-only */
1841 static void execute_ensure_buffer_stack (yyscan_t yyscanner)
1842 /* %endif */
1843 /* %if-c++-only */
1844 /* %endif */
1845 {
1846  int num_to_alloc;
1847  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1848 
1849  if (!yyg->yy_buffer_stack) {
1850 
1851  /* First allocation is just for 2 elements, since we don't know if this
1852  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1853  * immediate realloc on the next call.
1854  */
1855  num_to_alloc = 1;
1856  yyg->yy_buffer_stack = (struct yy_buffer_state**)execute_alloc
1857  (num_to_alloc * sizeof(struct yy_buffer_state*)
1858  , yyscanner);
1859  if ( ! yyg->yy_buffer_stack )
1860  YY_FATAL_ERROR( "out of dynamic memory in execute_ensure_buffer_stack()" );
1861 
1862  memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1863 
1864  yyg->yy_buffer_stack_max = num_to_alloc;
1865  yyg->yy_buffer_stack_top = 0;
1866  return;
1867  }
1868 
1869  if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
1870 
1871  /* Increase the buffer to prepare for a possible push. */
1872  int grow_size = 8 /* arbitrary grow size */;
1873 
1874  num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
1875  yyg->yy_buffer_stack = (struct yy_buffer_state**)execute_realloc
1876  (yyg->yy_buffer_stack,
1877  num_to_alloc * sizeof(struct yy_buffer_state*)
1878  , yyscanner);
1879  if ( ! yyg->yy_buffer_stack )
1880  YY_FATAL_ERROR( "out of dynamic memory in execute_ensure_buffer_stack()" );
1881 
1882  /* zero only the new slots.*/
1883  memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
1884  yyg->yy_buffer_stack_max = num_to_alloc;
1885  }
1886 }
1887 /* %endif */
1888 
1889 /* %if-c-only */
1896 YY_BUFFER_STATE execute__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
1897 {
1898  YY_BUFFER_STATE b;
1899 
1900  if ( size < 2 ||
1901  base[size-2] != YY_END_OF_BUFFER_CHAR ||
1902  base[size-1] != YY_END_OF_BUFFER_CHAR )
1903  /* They forgot to leave room for the EOB's. */
1904  return 0;
1905 
1906  b = (YY_BUFFER_STATE) execute_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1907  if ( ! b )
1908  YY_FATAL_ERROR( "out of dynamic memory in execute__scan_buffer()" );
1909 
1910  b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1911  b->yy_buf_pos = b->yy_ch_buf = base;
1912  b->yy_is_our_buffer = 0;
1913  b->yy_input_file = 0;
1914  b->yy_n_chars = b->yy_buf_size;
1915  b->yy_is_interactive = 0;
1916  b->yy_at_bol = 1;
1917  b->yy_fill_buffer = 0;
1918  b->yy_buffer_status = YY_BUFFER_NEW;
1919 
1920  execute__switch_to_buffer(b ,yyscanner );
1921 
1922  return b;
1923 }
1924 /* %endif */
1925 
1926 /* %if-c-only */
1935 YY_BUFFER_STATE execute__scan_string (yyconst char * yystr , yyscan_t yyscanner)
1936 {
1937 
1938  return execute__scan_bytes(yystr,strlen(yystr) ,yyscanner);
1939 }
1940 /* %endif */
1941 
1942 /* %if-c-only */
1950 YY_BUFFER_STATE execute__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
1951 {
1952  YY_BUFFER_STATE b;
1953  char *buf;
1954  yy_size_t n;
1955  int i;
1956 
1957  /* Get memory for full buffer, including space for trailing EOB's. */
1958  n = _yybytes_len + 2;
1959  buf = (char *) execute_alloc(n ,yyscanner );
1960  if ( ! buf )
1961  YY_FATAL_ERROR( "out of dynamic memory in execute__scan_bytes()" );
1962 
1963  for ( i = 0; i < _yybytes_len; ++i )
1964  buf[i] = yybytes[i];
1965 
1966  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1967 
1968  b = execute__scan_buffer(buf,n ,yyscanner);
1969  if ( ! b )
1970  YY_FATAL_ERROR( "bad buffer in execute__scan_bytes()" );
1971 
1972  /* It's okay to grow etc. this buffer, and we should throw it
1973  * away when we're done.
1974  */
1975  b->yy_is_our_buffer = 1;
1976 
1977  return b;
1978 }
1979 /* %endif */
1980 
1981 #ifndef YY_EXIT_FAILURE
1982 #define YY_EXIT_FAILURE 2
1983 #endif
1984 
1985 /* %if-c-only */
1986 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
1987 {
1988  (void) fprintf( stderr, "%s\n", msg );
1989  exit( YY_EXIT_FAILURE );
1990 }
1991 /* %endif */
1992 /* %if-c++-only */
1993 /* %endif */
1994 
1995 /* Redefine yyless() so it works in section 3 code. */
1996 
1997 #undef yyless
1998 #define yyless(n) \
1999  do \
2000  { \
2001  /* Undo effects of setting up yytext. */ \
2002  int yyless_macro_arg = (n); \
2003  YY_LESS_LINENO(yyless_macro_arg);\
2004  yytext[yyleng] = yyg->yy_hold_char; \
2005  yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2006  yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2007  *yyg->yy_c_buf_p = '\0'; \
2008  yyleng = yyless_macro_arg; \
2009  } \
2010  while ( 0 )
2011 
2012 /* Accessor methods (get/set functions) to struct members. */
2013 
2014 /* %if-c-only */
2015 /* %if-reentrant */
2016 
2020 YY_EXTRA_TYPE execute_get_extra (yyscan_t yyscanner)
2021 {
2022  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2023  return yyextra;
2024 }
2025 
2026 /* %endif */
2027 
2031 int execute_get_lineno (yyscan_t yyscanner)
2032 {
2033  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2034 
2035  if (! YY_CURRENT_BUFFER)
2036  return 0;
2037 
2038  return yylineno;
2039 }
2040 
2044 int execute_get_column (yyscan_t yyscanner)
2045 {
2046  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2047 
2048  if (! YY_CURRENT_BUFFER)
2049  return 0;
2050 
2051  return yycolumn;
2052 }
2053 
2057 FILE *execute_get_in (yyscan_t yyscanner)
2058 {
2059  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2060  return yyin;
2061 }
2062 
2066 FILE *execute_get_out (yyscan_t yyscanner)
2067 {
2068  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2069  return yyout;
2070 }
2071 
2075 int execute_get_leng (yyscan_t yyscanner)
2076 {
2077  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2078  return yyleng;
2079 }
2080 
2085 char *execute_get_text (yyscan_t yyscanner)
2086 {
2087  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2088  return yytext;
2089 }
2090 
2091 /* %if-reentrant */
2092 
2097 void execute_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
2098 {
2099  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2100  yyextra = user_defined ;
2101 }
2102 
2103 /* %endif */
2104 
2109 void execute_set_lineno (int line_number , yyscan_t yyscanner)
2110 {
2111  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2112 
2113  /* lineno is only valid if an input buffer exists. */
2114  if (! YY_CURRENT_BUFFER )
2115  yy_fatal_error( "execute_set_lineno called with no buffer" , yyscanner);
2116 
2117  yylineno = line_number;
2118 }
2119 
2124 void execute_set_column (int column_no , yyscan_t yyscanner)
2125 {
2126  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2127 
2128  /* column is only valid if an input buffer exists. */
2129  if (! YY_CURRENT_BUFFER )
2130  yy_fatal_error( "execute_set_column called with no buffer" , yyscanner);
2131 
2132  yycolumn = column_no;
2133 }
2134 
2141 void execute_set_in (FILE * in_str , yyscan_t yyscanner)
2142 {
2143  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2144  yyin = in_str ;
2145 }
2146 
2147 void execute_set_out (FILE * out_str , yyscan_t yyscanner)
2148 {
2149  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2150  yyout = out_str ;
2151 }
2152 
2153 int execute_get_debug (yyscan_t yyscanner)
2154 {
2155  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2156  return yy_flex_debug;
2157 }
2158 
2159 void execute_set_debug (int bdebug , yyscan_t yyscanner)
2160 {
2161  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2162  yy_flex_debug = bdebug ;
2163 }
2164 
2165 /* %endif */
2166 
2167 /* %if-reentrant */
2168 /* Accessor methods for yylval and yylloc */
2169 
2170 /* %if-bison-bridge */
2171 
2172 YYSTYPE * execute_get_lval (yyscan_t yyscanner)
2173 {
2174  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2175  return yylval;
2176 }
2177 
2178 void execute_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
2179 {
2180  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2181  yylval = yylval_param;
2182 }
2183 
2184 /* %endif */
2185 
2186 /* User-visible API */
2187 
2188 /* execute_lex_init is special because it creates the scanner itself, so it is
2189  * the ONLY reentrant function that doesn't take the scanner as the last argument.
2190  * That's why we explicitly handle the declaration, instead of using our macros.
2191  */
2192 
2193 int execute_lex_init(yyscan_t* ptr_yy_globals)
2194 
2195 {
2196  if (ptr_yy_globals == NULL){
2197  errno = EINVAL;
2198  return 1;
2199  }
2200 
2201  *ptr_yy_globals = (yyscan_t) execute_alloc ( sizeof( struct yyguts_t ), NULL );
2202 
2203  if (*ptr_yy_globals == NULL){
2204  errno = ENOMEM;
2205  return 1;
2206  }
2207 
2208  /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2209  memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2210 
2211  return yy_init_globals ( *ptr_yy_globals );
2212 }
2213 
2214 /* execute_lex_init_extra has the same functionality as execute_lex_init, but follows the
2215  * convention of taking the scanner as the last argument. Note however, that
2216  * this is a *pointer* to a scanner, as it will be allocated by this call (and
2217  * is the reason, too, why this function also must handle its own declaration).
2218  * The user defined value in the first argument will be available to execute_alloc in
2219  * the yyextra field.
2220  */
2221 
2222 int execute_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
2223 
2224 {
2225  struct yyguts_t dummy_yyguts;
2226 
2227  execute_set_extra (yy_user_defined, &dummy_yyguts);
2228 
2229  if (ptr_yy_globals == NULL){
2230  errno = EINVAL;
2231  return 1;
2232  }
2233 
2234  *ptr_yy_globals = (yyscan_t) execute_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2235 
2236  if (*ptr_yy_globals == NULL){
2237  errno = ENOMEM;
2238  return 1;
2239  }
2240 
2241  /* By setting to 0xAA, we expose bugs in
2242  yy_init_globals. Leave at 0x00 for releases. */
2243  memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2244 
2245  execute_set_extra (yy_user_defined, *ptr_yy_globals);
2246 
2247  return yy_init_globals ( *ptr_yy_globals );
2248 }
2249 
2250 /* %endif if-c-only */
2251 
2252 /* %if-c-only */
2253 static int yy_init_globals (yyscan_t yyscanner)
2254 {
2255  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2256  /* Initialization is the same as for the non-reentrant scanner.
2257  * This function is called from execute_lex_destroy(), so don't allocate here.
2258  */
2259 
2260  yyg->yy_buffer_stack = 0;
2261  yyg->yy_buffer_stack_top = 0;
2262  yyg->yy_buffer_stack_max = 0;
2263  yyg->yy_c_buf_p = (char *) 0;
2264  yyg->yy_init = 0;
2265  yyg->yy_start = 0;
2266 
2267  yyg->yy_start_stack_ptr = 0;
2268  yyg->yy_start_stack_depth = 0;
2269  yyg->yy_start_stack = NULL;
2270 
2271 /* Defined in main.c */
2272 #ifdef YY_STDINIT
2273  yyin = stdin;
2274  yyout = stdout;
2275 #else
2276  yyin = (FILE *) 0;
2277  yyout = (FILE *) 0;
2278 #endif
2279 
2280  /* For future reference: Set errno on error, since we are called by
2281  * execute_lex_init()
2282  */
2283  return 0;
2284 }
2285 /* %endif */
2286 
2287 /* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
2288 /* execute_lex_destroy is for both reentrant and non-reentrant scanners. */
2289 int execute_lex_destroy (yyscan_t yyscanner)
2290 {
2291  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2292 
2293  /* Pop the buffer stack, destroying each element. */
2294  while(YY_CURRENT_BUFFER){
2295  execute__delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
2296  YY_CURRENT_BUFFER_LVALUE = NULL;
2297  execute_pop_buffer_state(yyscanner);
2298  }
2299 
2300  /* Destroy the stack itself. */
2301  execute_free(yyg->yy_buffer_stack ,yyscanner);
2302  yyg->yy_buffer_stack = NULL;
2303 
2304  /* Destroy the start condition stack. */
2305  execute_free(yyg->yy_start_stack ,yyscanner );
2306  yyg->yy_start_stack = NULL;
2307 
2308  /* Reset the globals. This is important in a non-reentrant scanner so the next time
2309  * execute_lex() is called, initialization will occur. */
2310  yy_init_globals( yyscanner);
2311 
2312 /* %if-reentrant */
2313  /* Destroy the main struct (reentrant only). */
2314  execute_free ( yyscanner , yyscanner );
2315  yyscanner = NULL;
2316 /* %endif */
2317  return 0;
2318 }
2319 /* %endif */
2320 
2321 /*
2322  * Internal utility routines.
2323  */
2324 
2325 #ifndef yytext_ptr
2326 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
2327 {
2328  register int i;
2329  for ( i = 0; i < n; ++i )
2330  s1[i] = s2[i];
2331 }
2332 #endif
2333 
2334 #ifdef YY_NEED_STRLEN
2335 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
2336 {
2337  register int n;
2338  for ( n = 0; s[n]; ++n )
2339  ;
2340 
2341  return n;
2342 }
2343 #endif
2344 
2345 void *execute_alloc (yy_size_t size , yyscan_t yyscanner)
2346 {
2347  return (void *) malloc( size );
2348 }
2349 
2350 void *execute_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
2351 {
2352  /* The cast to (char *) in the following accommodates both
2353  * implementations that use char* generic pointers, and those
2354  * that use void* generic pointers. It works with the latter
2355  * because both ANSI C and C++ allow castless assignment from
2356  * any pointer type to void*, and deal with argument conversions
2357  * as though doing an assignment.
2358  */
2359  return (void *) realloc( (char *) ptr, size );
2360 }
2361 
2362 void execute_free (void * ptr , yyscan_t yyscanner)
2363 {
2364  free( (char *) ptr ); /* see execute_realloc() for (char *) cast */
2365 }
2366 
2367 /* %if-tables-serialization definitions */
2368 /* %define-yytables The name for this specific scanner's tables. */
2369 #define YYTABLES_NAME "yytables"
2370 /* %endif */
2371 
2372 /* %ok-for-header */
2373 
2374 #line 143 "drizzled/execute/scanner.l"
2375 
2376 
2377 namespace drizzled {
2378 namespace execute {
2379 
2380 void Context::init_scanner()
2381 {
2382  execute_lex_init(&scanner);
2383  execute_set_extra(this,scanner);
2384 }
2385 
2386 void Context::destroy_scanner()
2387 {
2388  execute_lex_destroy(scanner);
2389 }
2390 
2391 } // namespace execute
2392 } // namespace drizzled
2393 
2394