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