1
#line 2 "drizzled/execute/scanner.cc"
2
#line 41 "drizzled/execute/scanner.l"
5
#include <drizzled/execute/parser.h>
6
#include <drizzled/execute/context.h>
7
#include <drizzled/execute/symbol.h>
8
#include <drizzled/lex_string.h>
10
using namespace drizzled;
12
#ifndef __INTEL_COMPILER
13
#pragma GCC diagnostic ignored "-Wold-style-cast"
14
#pragma GCC diagnostic ignored "-Wsign-compare"
15
#pragma GCC diagnostic ignored "-Wunused-parameter"
16
#pragma GCC diagnostic ignored "-Wmissing-declarations"
19
#define YY_EXTRA_TYPE ::drizzled::execute::Context*
24
#line 25 "drizzled/execute/scanner.cc"
26
#define YY_INT_ALIGNED short int
28
/* A lexical scanner generated by flex */
33
/* %if-not-reentrant */
39
#define YY_FLEX_MAJOR_VERSION 2
40
#define YY_FLEX_MINOR_VERSION 5
41
#define YY_FLEX_SUBMINOR_VERSION 35
42
#if YY_FLEX_SUBMINOR_VERSION > 0
57
/* First, we deal with platform-specific or compiler-specific issues. */
59
/* begin standard C headers. */
67
/* %if-tables-serialization */
69
/* end standard C headers. */
72
/* flex integer type definitions */
77
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
79
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
81
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
82
* if you want the limit (max/min) macros for int types.
84
#ifndef __STDC_LIMIT_MACROS
85
#define __STDC_LIMIT_MACROS 1
89
typedef int8_t flex_int8_t;
90
typedef uint8_t flex_uint8_t;
91
typedef int16_t flex_int16_t;
92
typedef uint16_t flex_uint16_t;
93
typedef int32_t flex_int32_t;
94
typedef uint32_t flex_uint32_t;
96
typedef signed char flex_int8_t;
97
typedef short int flex_int16_t;
98
typedef int flex_int32_t;
99
typedef unsigned char flex_uint8_t;
100
typedef unsigned short int flex_uint16_t;
101
typedef unsigned int flex_uint32_t;
104
/* Limits of integral types. */
106
#define INT8_MIN (-128)
109
#define INT16_MIN (-32767-1)
112
#define INT32_MIN (-2147483647-1)
115
#define INT8_MAX (127)
118
#define INT16_MAX (32767)
121
#define INT32_MAX (2147483647)
124
#define UINT8_MAX (255U)
127
#define UINT16_MAX (65535U)
130
#define UINT32_MAX (4294967295U)
133
#endif /* ! FLEXINT_H */
142
/* The "const" storage-class-modifier is valid. */
145
#else /* ! __cplusplus */
147
/* C99 requires __STDC__ to be defined as 1. */
148
#if defined (__STDC__)
152
#endif /* defined (__STDC__) */
153
#endif /* ! __cplusplus */
156
#define yyconst const
161
/* %not-for-header */
163
/* Returned upon end-of-file. */
167
/* %not-for-header */
169
/* Promotes a possibly negative, possibly signed char to an unsigned
170
* integer for use as an array index. If the signed char is negative,
171
* we want to instead treat it as an 8-bit unsigned char, hence the
174
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
179
/* An opaque pointer. */
180
#ifndef YY_TYPEDEF_YY_SCANNER_T
181
#define YY_TYPEDEF_YY_SCANNER_T
182
typedef void* yyscan_t;
185
/* For convenience, these vars (plus the bison vars far below)
186
are macros in the reentrant scanner. */
187
#define yyin yyg->yyin_r
188
#define yyout yyg->yyout_r
189
#define yyextra yyg->yyextra_r
190
#define yyleng yyg->yyleng_r
191
#define yytext yyg->yytext_r
192
#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
193
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
194
#define yy_flex_debug yyg->yy_flex_debug_r
198
/* %if-not-reentrant */
201
/* Enter a start condition. This macro really ought to take a parameter,
202
* but we do it the disgusting crufty way forced on us by the ()-less
203
* definition of BEGIN.
205
#define BEGIN yyg->yy_start = 1 + 2 *
207
/* Translate the current start state into a value that can be later handed
208
* to BEGIN to return to the state. The YYSTATE alias is for lex
211
#define YY_START ((yyg->yy_start - 1) / 2)
212
#define YYSTATE YY_START
214
/* Action number for EOF rule of a given start state. */
215
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
217
/* Special action meaning "start processing a new file". */
218
#define YY_NEW_FILE execute_restart(yyin ,yyscanner )
220
#define YY_END_OF_BUFFER_CHAR 0
222
/* Size of default input buffer. */
224
#define YY_BUF_SIZE 16384
227
/* The state buf must be large enough to hold one state per character in the main buffer.
229
#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
231
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
232
#define YY_TYPEDEF_YY_BUFFER_STATE
233
typedef struct yy_buffer_state *YY_BUFFER_STATE;
236
/* %if-not-reentrant */
240
/* %if-not-reentrant */
244
#define EOB_ACT_CONTINUE_SCAN 0
245
#define EOB_ACT_END_OF_FILE 1
246
#define EOB_ACT_LAST_MATCH 2
248
#define YY_LESS_LINENO(n)
250
/* Return all but the first "n" matched characters back to the input stream. */
254
/* Undo effects of setting up yytext. */ \
255
int yyless_macro_arg = (n); \
256
YY_LESS_LINENO(yyless_macro_arg);\
257
*yy_cp = yyg->yy_hold_char; \
258
YY_RESTORE_YY_MORE_OFFSET \
259
yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
260
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
264
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
266
#ifndef YY_TYPEDEF_YY_SIZE_T
267
#define YY_TYPEDEF_YY_SIZE_T
268
typedef size_t yy_size_t;
271
#ifndef YY_STRUCT_YY_BUFFER_STATE
272
#define YY_STRUCT_YY_BUFFER_STATE
273
struct yy_buffer_state
282
char *yy_ch_buf; /* input buffer */
283
char *yy_buf_pos; /* current position in input buffer */
285
/* Size of input buffer in bytes, not including room for EOB
288
yy_size_t yy_buf_size;
290
/* Number of characters read into yy_ch_buf, not including EOB
295
/* Whether we "own" the buffer - i.e., we know we created it,
296
* and can realloc() it to grow it, and should free() it to
299
int yy_is_our_buffer;
301
/* Whether this is an "interactive" input source; if so, and
302
* if we're using stdio for input, then we want to use getc()
303
* instead of fread(), to make sure we stop fetching input after
306
int yy_is_interactive;
308
/* Whether we're considered to be at the beginning of a line.
309
* If so, '^' rules will be active on the next match, otherwise
314
int yy_bs_lineno; /**< The line count. */
315
int yy_bs_column; /**< The column count. */
317
/* Whether to try to fill the input buffer when we reach the
322
int yy_buffer_status;
324
#define YY_BUFFER_NEW 0
325
#define YY_BUFFER_NORMAL 1
326
/* When an EOF's been seen but there's still some text to process
327
* then we mark the buffer as YY_EOF_PENDING, to indicate that we
328
* shouldn't try reading from the input source any more. We might
329
* still have a bunch of tokens to match, though, because of
330
* possible backing-up.
332
* When we actually see the EOF, we change the status to "new"
333
* (via execute_restart()), so that the user can continue scanning by
334
* just pointing yyin at a new input file.
336
#define YY_BUFFER_EOF_PENDING 2
339
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
341
/* %if-c-only Standard (non-C++) definition */
342
/* %not-for-header */
344
/* %if-not-reentrant */
350
/* We provide macros for accessing buffer states in case in the
351
* future we want to put the buffer states in a more general
354
* Returns the top of the stack, or NULL.
356
#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
357
? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
360
/* Same as previous macro, but useful when we know that the buffer stack is not
361
* NULL or when we need an lvalue. For internal use only.
363
#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
365
/* %if-c-only Standard (non-C++) definition */
367
/* %if-not-reentrant */
368
/* %not-for-header */
374
void execute_restart (FILE *input_file ,yyscan_t yyscanner );
375
void execute__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
376
YY_BUFFER_STATE execute__create_buffer (FILE *file,int size ,yyscan_t yyscanner );
377
void execute__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
378
void execute__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
379
void execute_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
380
void execute_pop_buffer_state (yyscan_t yyscanner );
382
static void execute_ensure_buffer_stack (yyscan_t yyscanner );
383
static void execute__load_buffer_state (yyscan_t yyscanner );
384
static void execute__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
386
#define YY_FLUSH_BUFFER execute__flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
388
YY_BUFFER_STATE execute__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
389
YY_BUFFER_STATE execute__scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
390
YY_BUFFER_STATE execute__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
394
void *execute_alloc (yy_size_t ,yyscan_t yyscanner );
395
void *execute_realloc (void *,yy_size_t ,yyscan_t yyscanner );
396
void execute_free (void * ,yyscan_t yyscanner );
398
#define yy_new_buffer execute__create_buffer
400
#define yy_set_interactive(is_interactive) \
402
if ( ! YY_CURRENT_BUFFER ){ \
403
execute_ensure_buffer_stack (yyscanner); \
404
YY_CURRENT_BUFFER_LVALUE = \
405
execute__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
407
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
410
#define yy_set_bol(at_bol) \
412
if ( ! YY_CURRENT_BUFFER ){\
413
execute_ensure_buffer_stack (yyscanner); \
414
YY_CURRENT_BUFFER_LVALUE = \
415
execute__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
417
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
420
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
422
/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
423
/* Begin user sect3 */
425
#define execute_wrap(n) 1
426
#define YY_SKIP_YYWRAP
430
typedef unsigned char YY_CHAR;
432
typedef int yy_state_type;
434
#define yytext_ptr yytext_r
436
/* %if-c-only Standard (non-C++) definition */
438
static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
439
static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
440
static int yy_get_next_buffer (yyscan_t yyscanner );
441
static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
445
/* Done after the current pattern has been matched and before the
446
* corresponding action - sets up yytext.
448
#define YY_DO_BEFORE_ACTION \
449
yyg->yytext_ptr = yy_bp; \
450
/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
451
yyleng = (size_t) (yy_cp - yy_bp); \
452
yyg->yy_hold_char = *yy_cp; \
454
/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
455
yyg->yy_c_buf_p = yy_cp;
457
/* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
458
#define YY_NUM_RULES 5
459
#define YY_END_OF_BUFFER 6
460
/* This struct is not used in this scanner,
461
but its presence is necessary. */
464
flex_int32_t yy_verify;
467
static yyconst flex_int16_t yy_accept[46] =
469
3, 3, 6, 3, 2, 2, 3, 3, 3, 3,
470
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
471
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
472
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
476
static yyconst flex_int32_t yy_ec[256] =
478
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
479
1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
480
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
481
1, 2, 4, 5, 4, 4, 4, 4, 4, 4,
482
4, 4, 4, 4, 5, 5, 4, 6, 7, 7,
483
7, 7, 7, 7, 7, 7, 7, 4, 4, 4,
484
4, 4, 4, 4, 8, 1, 1, 1, 1, 9,
485
1, 1, 1, 1, 1, 8, 8, 8, 1, 1,
486
1, 1, 1, 1, 8, 1, 1, 9, 1, 1,
487
4, 4, 4, 4, 5, 4, 8, 1, 1, 1,
489
1, 9, 1, 1, 1, 1, 1, 8, 8, 8,
490
1, 1, 1, 1, 1, 1, 8, 1, 1, 9,
491
1, 1, 5, 4, 5, 4, 1, 10, 10, 10,
492
10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
493
10, 10, 10, 11, 11, 11, 11, 11, 11, 11,
494
11, 11, 11, 11, 11, 11, 11, 11, 11, 12,
495
12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
496
12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
497
12, 12, 12, 12, 12, 12, 13, 12, 12, 12,
498
14, 1, 1, 15, 15, 15, 15, 15, 15, 15,
500
15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
501
15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
502
15, 15, 15, 16, 17, 17, 17, 17, 17, 17,
503
17, 17, 17, 17, 17, 17, 18, 19, 20, 1,
504
21, 21, 21, 22, 1, 1, 1, 1, 1, 1,
508
static yyconst flex_int32_t yy_meta[23] =
510
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
511
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
515
static yyconst flex_int16_t yy_base[46] =
517
0, 0, 114, 22, 0, 34, 0, 0, 38, 0,
518
0, 42, 47, 50, 55, 60, 62, 100, 67, 102,
519
0, 71, 0, 75, 0, 0, 78, 0, 83, 0,
520
0, 101, 85, 0, 0, 0, 0, 96, 90, 95,
524
static yyconst flex_int16_t yy_def[46] =
526
45, 1, 45, 45, 4, 4, 4, 4, 4, 4,
527
4, 4, 4, 4, 4, 4, 4, 17, 17, 4,
528
4, 4, 4, 4, 4, 13, 4, 15, 4, 17,
529
19, 4, 4, 13, 13, 13, 13, 13, 13, 13,
533
static yyconst flex_int16_t yy_nxt[138] =
535
4, 5, 6, 7, 8, 9, 10, 11, 12, 4,
536
4, 4, 4, 4, 13, 14, 15, 16, 17, 18,
537
19, 20, 21, 21, 22, 21, 23, 24, 25, 23,
538
22, 21, 21, 21, 21, 21, 26, 27, 28, 29,
539
30, 30, 31, 32, 33, 33, 33, 33, 33, 33,
540
33, 33, 33, 33, 33, 33, 25, 25, 25, 25,
541
25, 34, 34, 34, 35, 35, 35, 35, 35, 36,
542
36, 37, 37, 37, 37, 37, 39, 39, 39, 39,
543
39, 33, 33, 33, 33, 33, 33, 33, 33, 34,
544
34, 34, 36, 36, 41, 41, 41, 41, 41, 43,
546
43, 43, 43, 43, 44, 44, 44, 44, 44, 42,
547
40, 40, 38, 45, 3, 45, 45, 45, 45, 45,
548
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
549
45, 45, 45, 45, 45, 45, 45
552
static yyconst flex_int16_t yy_chk[138] =
554
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
555
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
556
1, 1, 4, 4, 4, 4, 4, 4, 4, 4,
557
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
558
4, 4, 4, 4, 6, 6, 6, 6, 9, 9,
559
9, 9, 12, 12, 12, 12, 13, 13, 13, 13,
560
13, 14, 14, 14, 15, 15, 15, 15, 15, 16,
561
16, 17, 17, 17, 17, 17, 19, 19, 19, 19,
562
19, 22, 22, 22, 22, 24, 24, 24, 24, 27,
563
27, 27, 29, 29, 33, 33, 33, 33, 33, 39,
565
39, 39, 39, 39, 40, 40, 40, 40, 40, 38,
566
32, 20, 18, 3, 45, 45, 45, 45, 45, 45,
567
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
568
45, 45, 45, 45, 45, 45, 45
571
static yyconst flex_int16_t yy_rule_linenum[5] =
576
/* The intent behind this definition is that it'll catch
577
* any uses of REJECT which flex missed.
579
#define REJECT reject_used_but_not_detected
580
#define yymore() yymore_used_but_not_detected
581
#define YY_MORE_ADJ 0
582
#define YY_RESTORE_YY_MORE_OFFSET
583
#line 1 "drizzled/execute/scanner.l"
584
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
586
* Drizzle Execute Parser
588
* Copyright (C) 2011 Data Differential, http://datadifferential.com/
589
* Copyright (C) 2011 Vijay Samuel, vjsamuel1990@gmail.com
591
* All rights reserved.
593
* Redistribution and use in source and binary forms, with or without
594
* modification, are permitted provided that the following conditions are
597
* * Redistributions of source code must retain the above copyright
598
* notice, this list of conditions and the following disclaimer.
600
* * Redistributions in binary form must reproduce the above
601
* copyright notice, this list of conditions and the following disclaimer
602
* in the documentation and/or other materials provided with the
605
* * The names of its contributors may not be used to endorse or
606
* promote products derived from this software without specific prior
607
* written permission.
609
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
610
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
611
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
612
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
613
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
614
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
615
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
616
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
617
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
618
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
619
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
623
#line 63 "drizzled/execute/scanner.l"
628
#define PARAM execute_get_extra(yyscanner)
630
#define get_lex_chars(buffer, result, max_size, context) \
632
if (context->pos >= context->length) \
638
result= (int)(context->length - context->pos); \
639
(size_t)result > (size_t)max_size ? result= max_size : 0; \
640
memcpy(buffer, context->buf + context->pos, result); \
641
context->pos += result; \
646
#define YY_INPUT(buffer, result, max_size) get_lex_chars(buffer, result, max_size, PARAM)
648
#define YY_NO_UNISTD_H 1
649
#line 650 "drizzled/execute/scanner.cc"
653
#ifndef YY_NO_UNISTD_H
654
/* Special case for "unistd.h", since it is non-ANSI. We include it way
655
* down here because we want the user's section 1 to have been scanned first.
656
* The user has a chance to override it with an option.
665
#ifndef YY_EXTRA_TYPE
666
#define YY_EXTRA_TYPE void *
669
/* %if-c-only Reentrant structure and macros (non-C++). */
672
/* Holds the entire state of the reentrant scanner. */
676
/* User-defined. Not touched by flex. */
677
YY_EXTRA_TYPE yyextra_r;
679
/* The rest are the same as the globals declared in the non-reentrant scanner. */
680
FILE *yyin_r, *yyout_r;
681
size_t yy_buffer_stack_top; /**< index of top of stack. */
682
size_t yy_buffer_stack_max; /**< capacity of stack. */
683
YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
690
int yy_did_buffer_switch_on_eof;
691
int yy_start_stack_ptr;
692
int yy_start_stack_depth;
694
yy_state_type yy_last_accepting_state;
695
char* yy_last_accepting_cpos;
706
}; /* end struct yyguts_t */
710
static int yy_init_globals (yyscan_t yyscanner );
716
/* This must go here because YYSTYPE and YYLTYPE are included
717
* from bison output in section 1.*/
718
# define yylval yyg->yylval_r
720
int execute_lex_init (yyscan_t* scanner);
722
int execute_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
726
/* %endif End reentrant structures and macros. */
728
/* Accessor methods to globals.
729
These are made visible to non-reentrant scanners for convenience. */
731
int execute_lex_destroy (yyscan_t yyscanner );
733
int execute_get_debug (yyscan_t yyscanner );
735
void execute_set_debug (int debug_flag ,yyscan_t yyscanner );
737
YY_EXTRA_TYPE execute_get_extra (yyscan_t yyscanner );
739
void execute_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
741
FILE *execute_get_in (yyscan_t yyscanner );
743
void execute_set_in (FILE * in_str ,yyscan_t yyscanner );
745
FILE *execute_get_out (yyscan_t yyscanner );
747
void execute_set_out (FILE * out_str ,yyscan_t yyscanner );
749
int execute_get_leng (yyscan_t yyscanner );
751
char *execute_get_text (yyscan_t yyscanner );
753
int execute_get_lineno (yyscan_t yyscanner );
755
void execute_set_lineno (int line_number ,yyscan_t yyscanner );
757
int execute_get_column (yyscan_t yyscanner );
759
void execute_set_column (int column_no ,yyscan_t yyscanner );
761
/* %if-bison-bridge */
763
YYSTYPE * execute_get_lval (yyscan_t yyscanner );
765
void execute_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
769
/* Macros after this point can all be overridden by user definitions in
773
#ifndef YY_SKIP_YYWRAP
775
extern "C" int execute_wrap (yyscan_t yyscanner );
777
extern int execute_wrap (yyscan_t yyscanner );
781
/* %not-for-header */
788
static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
791
#ifdef YY_NEED_STRLEN
792
static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
796
/* %if-c-only Standard (non-C++) definition */
797
/* %not-for-header */
800
static int yyinput (yyscan_t yyscanner );
802
static int input (yyscan_t yyscanner );
813
/* Amount of stuff to slurp up with each read. */
814
#ifndef YY_READ_BUF_SIZE
815
#define YY_READ_BUF_SIZE 8192
818
/* Copy whatever the last rule matched to the standard output. */
820
/* %if-c-only Standard (non-C++) definition */
821
/* This used to be an fputs(), but since the string might contain NUL's,
822
* we now use fwrite().
824
#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
826
/* %if-c++-only C++ definition */
830
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
831
* is returned in "result".
834
#define YY_INPUT(buf,result,max_size) \
835
/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
836
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
840
for ( n = 0; n < max_size && \
841
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
844
buf[n++] = (char) c; \
845
if ( c == EOF && ferror( yyin ) ) \
846
YY_FATAL_ERROR( "input in flex scanner failed" ); \
852
while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
854
if( errno != EINTR) \
856
YY_FATAL_ERROR( "input in flex scanner failed" ); \
864
/* %if-c++-only C++ definition \ */\
869
/* No semi-colon after return; correct usage is to write "yyterminate();" -
870
* we don't want an extra ';' after the "return" because that will cause
871
* some compilers to complain about unreachable statements.
874
#define yyterminate() return YY_NULL
877
/* Number of entries by which start-condition stack grows. */
878
#ifndef YY_START_STACK_INCR
879
#define YY_START_STACK_INCR 25
882
/* Report a fatal error. */
883
#ifndef YY_FATAL_ERROR
885
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
891
/* %if-tables-serialization structures and prototypes */
892
/* %not-for-header */
896
/* %not-for-header */
898
/* %tables-yydmap generated elements */
900
/* end tables serialization structures and prototypes */
904
/* Default declaration of generated scanner - a define so the user can
905
* easily add parameters.
908
#define YY_DECL_IS_OURS 1
909
/* %if-c-only Standard (non-C++) definition */
911
extern int execute_lex \
912
(YYSTYPE * yylval_param ,yyscan_t yyscanner);
914
#define YY_DECL int execute_lex \
915
(YYSTYPE * yylval_param , yyscan_t yyscanner)
917
/* %if-c++-only C++ definition */
919
#endif /* !YY_DECL */
921
/* Code executed at the beginning of each rule, after yytext and yyleng
924
#ifndef YY_USER_ACTION
925
#define YY_USER_ACTION
928
/* Code executed at the end of each rule. */
930
#define YY_BREAK break;
933
/* %% [6.0] YY_RULE_SETUP definition goes here */
934
#define YY_RULE_SETUP \
937
/* %not-for-header */
939
/** The main scanner function which does all the work.
943
register yy_state_type yy_current_state;
944
register char *yy_cp, *yy_bp;
946
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
948
/* %% [7.0] user's declarations go here */
949
#line 120 "drizzled/execute/scanner.l"
952
#line 953 "drizzled/execute/scanner.cc"
954
yylval = yylval_param;
964
if ( ! yyg->yy_start )
965
yyg->yy_start = 1; /* first start state */
981
if ( ! YY_CURRENT_BUFFER ) {
982
execute_ensure_buffer_stack (yyscanner);
983
YY_CURRENT_BUFFER_LVALUE =
984
execute__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
987
execute__load_buffer_state(yyscanner );
990
while ( 1 ) /* loops until end-of-file is reached */
992
/* %% [8.0] yymore()-related code goes here */
993
yy_cp = yyg->yy_c_buf_p;
995
/* Support of yytext. */
996
*yy_cp = yyg->yy_hold_char;
998
/* yy_bp points to the position in yy_ch_buf of the start of
1003
/* %% [9.0] code to set up and find next match goes here */
1004
yy_current_state = yyg->yy_start;
1008
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1009
if ( yy_accept[yy_current_state] )
1011
yyg->yy_last_accepting_state = yy_current_state;
1012
yyg->yy_last_accepting_cpos = yy_cp;
1014
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1016
yy_current_state = (int) yy_def[yy_current_state];
1017
if ( yy_current_state >= 46 )
1018
yy_c = yy_meta[(unsigned int) yy_c];
1020
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1023
while ( yy_current_state != 45 );
1024
yy_cp = yyg->yy_last_accepting_cpos;
1025
yy_current_state = yyg->yy_last_accepting_state;
1028
/* %% [10.0] code to find the action number goes here */
1029
yy_act = yy_accept[yy_current_state];
1031
YY_DO_BEFORE_ACTION;
1033
/* %% [11.0] code for yylineno update goes here */
1035
do_action: /* This label is used only to access EOF actions. */
1037
/* %% [12.0] debug code goes here */
1038
if ( yy_flex_debug )
1041
fprintf( stderr, "--scanner backing up\n" );
1042
else if ( yy_act < 5 )
1043
fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
1044
(long)yy_rule_linenum[yy_act], yytext );
1045
else if ( yy_act == 5 )
1046
fprintf( stderr, "--accepting default rule (\"%s\")\n",
1048
else if ( yy_act == 6 )
1049
fprintf( stderr, "--(end of buffer or a NUL)\n" );
1051
fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
1055
{ /* beginning of action switch */
1056
/* %% [13.0] actions go here */
1057
case 0: /* must back up */
1058
/* undo the effects of YY_DO_BEFORE_ACTION */
1059
*yy_cp = yyg->yy_hold_char;
1060
yy_cp = yyg->yy_last_accepting_cpos;
1061
yy_current_state = yyg->yy_last_accepting_state;
1062
goto yy_find_action;
1066
#line 122 "drizzled/execute/scanner.l"
1067
{ /* Byte Order Mark */ }
1070
/* rule 2 can match eol */
1072
#line 124 "drizzled/execute/scanner.l"
1073
; /* skip whitespace */
1076
/* rule 3 can match eol */
1078
#line 127 "drizzled/execute/scanner.l"
1080
yylval->string.assign(yytext, yyleng);
1086
#line 132 "drizzled/execute/scanner.l"
1088
yyextra->begin= yytext;
1094
#line 137 "drizzled/execute/scanner.l"
1097
#line 1098 "drizzled/execute/scanner.cc"
1098
case YY_STATE_EOF(INITIAL):
1101
case YY_END_OF_BUFFER:
1103
/* Amount of text matched not including the EOB char. */
1104
int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1106
/* Undo the effects of YY_DO_BEFORE_ACTION. */
1107
*yy_cp = yyg->yy_hold_char;
1108
YY_RESTORE_YY_MORE_OFFSET
1110
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1112
/* We're scanning a new file or input source. It's
1113
* possible that this happened because the user
1114
* just pointed yyin at a new source and called
1115
* execute_lex(). If so, then we have to assure
1116
* consistency between YY_CURRENT_BUFFER and our
1117
* globals. Here is the right place to do so, because
1118
* this is the first action (other than possibly a
1119
* back-up) that will match for the new input source.
1121
yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1122
YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1123
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1126
/* Note that here we test for yy_c_buf_p "<=" to the position
1127
* of the first EOB in the buffer, since yy_c_buf_p will
1128
* already have been incremented past the NUL character
1129
* (since all states make transitions on EOB to the
1130
* end-of-buffer state). Contrast this with the test
1133
if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1134
{ /* This was really a NUL. */
1135
yy_state_type yy_next_state;
1137
yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1139
yy_current_state = yy_get_previous_state( yyscanner );
1141
/* Okay, we're now positioned to make the NUL
1142
* transition. We couldn't have
1143
* yy_get_previous_state() go ahead and do it
1144
* for us because it doesn't know how to deal
1145
* with the possibility of jamming (and we don't
1146
* want to build jamming into it because then it
1147
* will run more slowly).
1150
yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1152
yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1154
if ( yy_next_state )
1156
/* Consume the NUL. */
1157
yy_cp = ++yyg->yy_c_buf_p;
1158
yy_current_state = yy_next_state;
1164
/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
1165
yy_cp = yyg->yy_last_accepting_cpos;
1166
yy_current_state = yyg->yy_last_accepting_state;
1167
goto yy_find_action;
1171
else switch ( yy_get_next_buffer( yyscanner ) )
1173
case EOB_ACT_END_OF_FILE:
1175
yyg->yy_did_buffer_switch_on_eof = 0;
1177
if ( execute_wrap(yyscanner ) )
1179
/* Note: because we've taken care in
1180
* yy_get_next_buffer() to have set up
1181
* yytext, we can now set up
1182
* yy_c_buf_p so that if some total
1183
* hoser (like flex itself) wants to
1184
* call the scanner after we return the
1185
* YY_NULL, it'll still work - another
1186
* YY_NULL will get returned.
1188
yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1190
yy_act = YY_STATE_EOF(YY_START);
1196
if ( ! yyg->yy_did_buffer_switch_on_eof )
1202
case EOB_ACT_CONTINUE_SCAN:
1204
yyg->yytext_ptr + yy_amount_of_matched_text;
1206
yy_current_state = yy_get_previous_state( yyscanner );
1208
yy_cp = yyg->yy_c_buf_p;
1209
yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1212
case EOB_ACT_LAST_MATCH:
1214
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1216
yy_current_state = yy_get_previous_state( yyscanner );
1218
yy_cp = yyg->yy_c_buf_p;
1219
yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1220
goto yy_find_action;
1227
"fatal flex scanner internal error--no action found" );
1228
} /* end of action switch */
1229
} /* end of scanning one token */
1230
} /* end of execute_lex */
1231
/* %ok-for-header */
1234
/* %not-for-header */
1236
/* %ok-for-header */
1240
/* yy_get_next_buffer - try to read in a new buffer
1242
* Returns a code representing an action:
1243
* EOB_ACT_LAST_MATCH -
1244
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1245
* EOB_ACT_END_OF_FILE - end of file
1248
static int yy_get_next_buffer (yyscan_t yyscanner)
1253
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1254
register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1255
register char *source = yyg->yytext_ptr;
1256
register int number_to_move, i;
1259
if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1261
"fatal flex scanner internal error--end of buffer missed" );
1263
if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1264
{ /* Don't try to fill the buffer, so this is an EOF. */
1265
if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1267
/* We matched a single character, the EOB, so
1268
* treat this as a final EOF.
1270
return EOB_ACT_END_OF_FILE;
1275
/* We matched some text prior to the EOB, first
1278
return EOB_ACT_LAST_MATCH;
1282
/* Try to read more data. */
1284
/* First move last chars to start of buffer. */
1285
number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1287
for ( i = 0; i < number_to_move; ++i )
1288
*(dest++) = *(source++);
1290
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1291
/* don't do the read, it's not guaranteed to return an EOF,
1294
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1299
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1301
while ( num_to_read <= 0 )
1302
{ /* Not enough room in the buffer - grow it. */
1304
/* just a shorter name for the current buffer */
1305
YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1307
int yy_c_buf_p_offset =
1308
(int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1310
if ( b->yy_is_our_buffer )
1312
int new_size = b->yy_buf_size * 2;
1314
if ( new_size <= 0 )
1315
b->yy_buf_size += b->yy_buf_size / 8;
1317
b->yy_buf_size *= 2;
1319
b->yy_ch_buf = (char *)
1320
/* Include room in for 2 EOB chars. */
1321
execute_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1324
/* Can't grow it, we don't own it. */
1327
if ( ! b->yy_ch_buf )
1329
"fatal error - scanner input buffer overflow" );
1331
yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1333
num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1338
if ( num_to_read > YY_READ_BUF_SIZE )
1339
num_to_read = YY_READ_BUF_SIZE;
1341
/* Read in more data. */
1342
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1343
yyg->yy_n_chars, (size_t) num_to_read );
1345
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1348
if ( yyg->yy_n_chars == 0 )
1350
if ( number_to_move == YY_MORE_ADJ )
1352
ret_val = EOB_ACT_END_OF_FILE;
1353
execute_restart(yyin ,yyscanner);
1358
ret_val = EOB_ACT_LAST_MATCH;
1359
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1360
YY_BUFFER_EOF_PENDING;
1365
ret_val = EOB_ACT_CONTINUE_SCAN;
1367
if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1368
/* Extend the array by 50%, plus the number we really need. */
1369
yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1370
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) execute_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
1371
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1372
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1375
yyg->yy_n_chars += number_to_move;
1376
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1377
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1379
yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1384
/* yy_get_previous_state - get the state just before the EOB char was reached */
1387
/* %not-for-header */
1389
static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1394
register yy_state_type yy_current_state;
1395
register char *yy_cp;
1396
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1398
/* %% [15.0] code to get the start state into yy_current_state goes here */
1399
yy_current_state = yyg->yy_start;
1401
for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1403
/* %% [16.0] code to find the next state goes here */
1404
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1405
if ( yy_accept[yy_current_state] )
1407
yyg->yy_last_accepting_state = yy_current_state;
1408
yyg->yy_last_accepting_cpos = yy_cp;
1410
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1412
yy_current_state = (int) yy_def[yy_current_state];
1413
if ( yy_current_state >= 46 )
1414
yy_c = yy_meta[(unsigned int) yy_c];
1416
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1419
return yy_current_state;
1422
/* yy_try_NUL_trans - try to make a transition on the NUL character
1425
* next_state = yy_try_NUL_trans( current_state );
1428
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1433
register int yy_is_jam;
1434
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1435
/* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
1436
register char *yy_cp = yyg->yy_c_buf_p;
1438
register YY_CHAR yy_c = 1;
1439
if ( yy_accept[yy_current_state] )
1441
yyg->yy_last_accepting_state = yy_current_state;
1442
yyg->yy_last_accepting_cpos = yy_cp;
1444
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1446
yy_current_state = (int) yy_def[yy_current_state];
1447
if ( yy_current_state >= 46 )
1448
yy_c = yy_meta[(unsigned int) yy_c];
1450
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1451
yy_is_jam = (yy_current_state == 45);
1453
return yy_is_jam ? 0 : yy_current_state;
1463
static int yyinput (yyscan_t yyscanner)
1465
static int input (yyscan_t yyscanner)
1473
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1475
*yyg->yy_c_buf_p = yyg->yy_hold_char;
1477
if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1479
/* yy_c_buf_p now points to the character we want to return.
1480
* If this occurs *before* the EOB characters, then it's a
1481
* valid NUL; if not, then we've hit the end of the buffer.
1483
if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1484
/* This was really a NUL. */
1485
*yyg->yy_c_buf_p = '\0';
1488
{ /* need more input */
1489
int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1492
switch ( yy_get_next_buffer( yyscanner ) )
1494
case EOB_ACT_LAST_MATCH:
1495
/* This happens because yy_g_n_b()
1496
* sees that we've accumulated a
1497
* token and flags that we need to
1498
* try matching the token before
1499
* proceeding. But for input(),
1500
* there's no matching to consider.
1501
* So convert the EOB_ACT_LAST_MATCH
1502
* to EOB_ACT_END_OF_FILE.
1505
/* Reset buffer status. */
1506
execute_restart(yyin ,yyscanner);
1510
case EOB_ACT_END_OF_FILE:
1512
if ( execute_wrap(yyscanner ) )
1515
if ( ! yyg->yy_did_buffer_switch_on_eof )
1518
return yyinput(yyscanner);
1520
return input(yyscanner);
1524
case EOB_ACT_CONTINUE_SCAN:
1525
yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1531
c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1532
*yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1533
yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1535
/* %% [19.0] update BOL and yylineno */
1540
#endif /* ifndef YY_NO_INPUT */
1543
/** Immediately switch to a different input stream.
1544
* @param input_file A readable stream.
1545
* @param yyscanner The scanner object.
1546
* @note This function does not reset the start condition to @c INITIAL .
1549
void execute_restart (FILE * input_file , yyscan_t yyscanner)
1554
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1556
if ( ! YY_CURRENT_BUFFER ){
1557
execute_ensure_buffer_stack (yyscanner);
1558
YY_CURRENT_BUFFER_LVALUE =
1559
execute__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1562
execute__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1563
execute__load_buffer_state(yyscanner );
1566
/** Switch to a different input buffer.
1567
* @param new_buffer The new input buffer.
1568
* @param yyscanner The scanner object.
1571
void execute__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1576
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1578
/* TODO. We should be able to replace this entire function body
1580
* execute_pop_buffer_state();
1581
* execute_push_buffer_state(new_buffer);
1583
execute_ensure_buffer_stack (yyscanner);
1584
if ( YY_CURRENT_BUFFER == new_buffer )
1587
if ( YY_CURRENT_BUFFER )
1589
/* Flush out information for old buffer. */
1590
*yyg->yy_c_buf_p = yyg->yy_hold_char;
1591
YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1592
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1595
YY_CURRENT_BUFFER_LVALUE = new_buffer;
1596
execute__load_buffer_state(yyscanner );
1598
/* We don't actually know whether we did this switch during
1599
* EOF (execute_wrap()) processing, but the only time this flag
1600
* is looked at is after execute_wrap() is called, so it's safe
1601
* to go ahead and always set it.
1603
yyg->yy_did_buffer_switch_on_eof = 1;
1607
static void execute__load_buffer_state (yyscan_t yyscanner)
1612
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1613
yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1614
yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1615
yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1616
yyg->yy_hold_char = *yyg->yy_c_buf_p;
1619
/** Allocate and initialize an input buffer state.
1620
* @param file A readable stream.
1621
* @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1622
* @param yyscanner The scanner object.
1623
* @return the allocated buffer state.
1626
YY_BUFFER_STATE execute__create_buffer (FILE * file, int size , yyscan_t yyscanner)
1633
b = (YY_BUFFER_STATE) execute_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1635
YY_FATAL_ERROR( "out of dynamic memory in execute__create_buffer()" );
1637
b->yy_buf_size = size;
1639
/* yy_ch_buf has to be 2 characters longer than the size given because
1640
* we need to put in 2 end-of-buffer characters.
1642
b->yy_ch_buf = (char *) execute_alloc(b->yy_buf_size + 2 ,yyscanner );
1643
if ( ! b->yy_ch_buf )
1644
YY_FATAL_ERROR( "out of dynamic memory in execute__create_buffer()" );
1646
b->yy_is_our_buffer = 1;
1648
execute__init_buffer(b,file ,yyscanner);
1653
/** Destroy the buffer.
1654
* @param b a buffer created with execute__create_buffer()
1655
* @param yyscanner The scanner object.
1658
void execute__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1663
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1668
if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1669
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1671
if ( b->yy_is_our_buffer )
1672
execute_free((void *) b->yy_ch_buf ,yyscanner );
1674
execute_free((void *) b ,yyscanner );
1684
/* Initializes or reinitializes a buffer.
1685
* This function is sometimes called more than once on the same buffer,
1686
* such as during a execute_restart() or at EOF.
1689
static void execute__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
1696
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1698
execute__flush_buffer(b ,yyscanner);
1700
b->yy_input_file = file;
1701
b->yy_fill_buffer = 1;
1703
/* If b is the current buffer, then execute__init_buffer was _probably_
1704
* called from execute_restart() or through yy_get_next_buffer.
1705
* In that case, we don't want to reset the lineno or column.
1707
if (b != YY_CURRENT_BUFFER){
1708
b->yy_bs_lineno = 1;
1709
b->yy_bs_column = 0;
1714
b->yy_is_interactive = 0;
1722
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1723
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1724
* @param yyscanner The scanner object.
1727
void execute__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1732
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1738
/* We always need two end-of-buffer characters. The first causes
1739
* a transition to the end-of-buffer state. The second causes
1740
* a jam in that state.
1742
b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1743
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1745
b->yy_buf_pos = &b->yy_ch_buf[0];
1748
b->yy_buffer_status = YY_BUFFER_NEW;
1750
if ( b == YY_CURRENT_BUFFER )
1751
execute__load_buffer_state(yyscanner );
1755
/** Pushes the new state onto the stack. The new state becomes
1756
* the current state. This function will allocate the stack
1758
* @param new_buffer The new state.
1759
* @param yyscanner The scanner object.
1762
void execute_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1767
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1768
if (new_buffer == NULL)
1771
execute_ensure_buffer_stack(yyscanner);
1773
/* This block is copied from execute__switch_to_buffer. */
1774
if ( YY_CURRENT_BUFFER )
1776
/* Flush out information for old buffer. */
1777
*yyg->yy_c_buf_p = yyg->yy_hold_char;
1778
YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1779
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1782
/* Only push if top exists. Otherwise, replace top. */
1783
if (YY_CURRENT_BUFFER)
1784
yyg->yy_buffer_stack_top++;
1785
YY_CURRENT_BUFFER_LVALUE = new_buffer;
1787
/* copied from execute__switch_to_buffer. */
1788
execute__load_buffer_state(yyscanner );
1789
yyg->yy_did_buffer_switch_on_eof = 1;
1794
/** Removes and deletes the top of the stack, if present.
1795
* The next element becomes the new top.
1796
* @param yyscanner The scanner object.
1799
void execute_pop_buffer_state (yyscan_t yyscanner)
1804
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1805
if (!YY_CURRENT_BUFFER)
1808
execute__delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
1809
YY_CURRENT_BUFFER_LVALUE = NULL;
1810
if (yyg->yy_buffer_stack_top > 0)
1811
--yyg->yy_buffer_stack_top;
1813
if (YY_CURRENT_BUFFER) {
1814
execute__load_buffer_state(yyscanner );
1815
yyg->yy_did_buffer_switch_on_eof = 1;
1821
/* Allocates the stack if it does not exist.
1822
* Guarantees space for at least one push.
1825
static void execute_ensure_buffer_stack (yyscan_t yyscanner)
1831
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1833
if (!yyg->yy_buffer_stack) {
1835
/* First allocation is just for 2 elements, since we don't know if this
1836
* scanner will even need a stack. We use 2 instead of 1 to avoid an
1837
* immediate realloc on the next call.
1840
yyg->yy_buffer_stack = (struct yy_buffer_state**)execute_alloc
1841
(num_to_alloc * sizeof(struct yy_buffer_state*)
1843
if ( ! yyg->yy_buffer_stack )
1844
YY_FATAL_ERROR( "out of dynamic memory in execute_ensure_buffer_stack()" );
1846
memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1848
yyg->yy_buffer_stack_max = num_to_alloc;
1849
yyg->yy_buffer_stack_top = 0;
1853
if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
1855
/* Increase the buffer to prepare for a possible push. */
1856
int grow_size = 8 /* arbitrary grow size */;
1858
num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
1859
yyg->yy_buffer_stack = (struct yy_buffer_state**)execute_realloc
1860
(yyg->yy_buffer_stack,
1861
num_to_alloc * sizeof(struct yy_buffer_state*)
1863
if ( ! yyg->yy_buffer_stack )
1864
YY_FATAL_ERROR( "out of dynamic memory in execute_ensure_buffer_stack()" );
1866
/* zero only the new slots.*/
1867
memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
1868
yyg->yy_buffer_stack_max = num_to_alloc;
1874
/** Setup the input buffer state to scan directly from a user-specified character buffer.
1875
* @param base the character buffer
1876
* @param size the size in bytes of the character buffer
1877
* @param yyscanner The scanner object.
1878
* @return the newly allocated buffer state object.
1880
YY_BUFFER_STATE execute__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
1885
base[size-2] != YY_END_OF_BUFFER_CHAR ||
1886
base[size-1] != YY_END_OF_BUFFER_CHAR )
1887
/* They forgot to leave room for the EOB's. */
1890
b = (YY_BUFFER_STATE) execute_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1892
YY_FATAL_ERROR( "out of dynamic memory in execute__scan_buffer()" );
1894
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1895
b->yy_buf_pos = b->yy_ch_buf = base;
1896
b->yy_is_our_buffer = 0;
1897
b->yy_input_file = 0;
1898
b->yy_n_chars = b->yy_buf_size;
1899
b->yy_is_interactive = 0;
1901
b->yy_fill_buffer = 0;
1902
b->yy_buffer_status = YY_BUFFER_NEW;
1904
execute__switch_to_buffer(b ,yyscanner );
1911
/** Setup the input buffer state to scan a string. The next call to execute_lex() will
1912
* scan from a @e copy of @a str.
1913
* @param yystr a NUL-terminated string to scan
1914
* @param yyscanner The scanner object.
1915
* @return the newly allocated buffer state object.
1916
* @note If you want to scan bytes that may contain NUL values, then use
1917
* execute__scan_bytes() instead.
1919
YY_BUFFER_STATE execute__scan_string (yyconst char * yystr , yyscan_t yyscanner)
1922
return execute__scan_bytes(yystr,strlen(yystr) ,yyscanner);
1927
/** Setup the input buffer state to scan the given bytes. The next call to execute_lex() will
1928
* scan from a @e copy of @a bytes.
1929
* @param bytes the byte buffer to scan
1930
* @param len the number of bytes in the buffer pointed to by @a bytes.
1931
* @param yyscanner The scanner object.
1932
* @return the newly allocated buffer state object.
1934
YY_BUFFER_STATE execute__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
1941
/* Get memory for full buffer, including space for trailing EOB's. */
1942
n = _yybytes_len + 2;
1943
buf = (char *) execute_alloc(n ,yyscanner );
1945
YY_FATAL_ERROR( "out of dynamic memory in execute__scan_bytes()" );
1947
for ( i = 0; i < _yybytes_len; ++i )
1948
buf[i] = yybytes[i];
1950
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1952
b = execute__scan_buffer(buf,n ,yyscanner);
1954
YY_FATAL_ERROR( "bad buffer in execute__scan_bytes()" );
1956
/* It's okay to grow etc. this buffer, and we should throw it
1957
* away when we're done.
1959
b->yy_is_our_buffer = 1;
1965
#ifndef YY_EXIT_FAILURE
1966
#define YY_EXIT_FAILURE 2
1970
static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
1972
(void) fprintf( stderr, "%s\n", msg );
1973
exit( YY_EXIT_FAILURE );
1979
/* Redefine yyless() so it works in section 3 code. */
1985
/* Undo effects of setting up yytext. */ \
1986
int yyless_macro_arg = (n); \
1987
YY_LESS_LINENO(yyless_macro_arg);\
1988
yytext[yyleng] = yyg->yy_hold_char; \
1989
yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
1990
yyg->yy_hold_char = *yyg->yy_c_buf_p; \
1991
*yyg->yy_c_buf_p = '\0'; \
1992
yyleng = yyless_macro_arg; \
1996
/* Accessor methods (get/set functions) to struct members. */
2001
/** Get the user-defined data for this scanner.
2002
* @param yyscanner The scanner object.
2004
YY_EXTRA_TYPE execute_get_extra (yyscan_t yyscanner)
2006
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2012
/** Get the current line number.
2013
* @param yyscanner The scanner object.
2015
int execute_get_lineno (yyscan_t yyscanner)
2017
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2019
if (! YY_CURRENT_BUFFER)
2025
/** Get the current column number.
2026
* @param yyscanner The scanner object.
2028
int execute_get_column (yyscan_t yyscanner)
2030
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2032
if (! YY_CURRENT_BUFFER)
2038
/** Get the input stream.
2039
* @param yyscanner The scanner object.
2041
FILE *execute_get_in (yyscan_t yyscanner)
2043
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2047
/** Get the output stream.
2048
* @param yyscanner The scanner object.
2050
FILE *execute_get_out (yyscan_t yyscanner)
2052
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2056
/** Get the length of the current token.
2057
* @param yyscanner The scanner object.
2059
int execute_get_leng (yyscan_t yyscanner)
2061
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2065
/** Get the current token.
2066
* @param yyscanner The scanner object.
2069
char *execute_get_text (yyscan_t yyscanner)
2071
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2077
/** Set the user-defined data. This data is never touched by the scanner.
2078
* @param user_defined The data to be associated with this scanner.
2079
* @param yyscanner The scanner object.
2081
void execute_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
2083
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2084
yyextra = user_defined ;
2089
/** Set the current line number.
2090
* @param line_number
2091
* @param yyscanner The scanner object.
2093
void execute_set_lineno (int line_number , yyscan_t yyscanner)
2095
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2097
/* lineno is only valid if an input buffer exists. */
2098
if (! YY_CURRENT_BUFFER )
2099
yy_fatal_error( "execute_set_lineno called with no buffer" , yyscanner);
2101
yylineno = line_number;
2104
/** Set the current column.
2105
* @param line_number
2106
* @param yyscanner The scanner object.
2108
void execute_set_column (int column_no , yyscan_t yyscanner)
2110
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2112
/* column is only valid if an input buffer exists. */
2113
if (! YY_CURRENT_BUFFER )
2114
yy_fatal_error( "execute_set_column called with no buffer" , yyscanner);
2116
yycolumn = column_no;
2119
/** Set the input stream. This does not discard the current
2121
* @param in_str A readable stream.
2122
* @param yyscanner The scanner object.
2123
* @see execute__switch_to_buffer
2125
void execute_set_in (FILE * in_str , yyscan_t yyscanner)
2127
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2131
void execute_set_out (FILE * out_str , yyscan_t yyscanner)
2133
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2137
int execute_get_debug (yyscan_t yyscanner)
2139
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2140
return yy_flex_debug;
2143
void execute_set_debug (int bdebug , yyscan_t yyscanner)
2145
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2146
yy_flex_debug = bdebug ;
2152
/* Accessor methods for yylval and yylloc */
2154
/* %if-bison-bridge */
2156
YYSTYPE * execute_get_lval (yyscan_t yyscanner)
2158
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2162
void execute_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
2164
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2165
yylval = yylval_param;
2170
/* User-visible API */
2172
/* execute_lex_init is special because it creates the scanner itself, so it is
2173
* the ONLY reentrant function that doesn't take the scanner as the last argument.
2174
* That's why we explicitly handle the declaration, instead of using our macros.
2177
int execute_lex_init(yyscan_t* ptr_yy_globals)
2180
if (ptr_yy_globals == NULL){
2185
*ptr_yy_globals = (yyscan_t) execute_alloc ( sizeof( struct yyguts_t ), NULL );
2187
if (*ptr_yy_globals == NULL){
2192
/* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2193
memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2195
return yy_init_globals ( *ptr_yy_globals );
2198
/* execute_lex_init_extra has the same functionality as execute_lex_init, but follows the
2199
* convention of taking the scanner as the last argument. Note however, that
2200
* this is a *pointer* to a scanner, as it will be allocated by this call (and
2201
* is the reason, too, why this function also must handle its own declaration).
2202
* The user defined value in the first argument will be available to execute_alloc in
2203
* the yyextra field.
2206
int execute_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
2209
struct yyguts_t dummy_yyguts;
2211
execute_set_extra (yy_user_defined, &dummy_yyguts);
2213
if (ptr_yy_globals == NULL){
2218
*ptr_yy_globals = (yyscan_t) execute_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2220
if (*ptr_yy_globals == NULL){
2225
/* By setting to 0xAA, we expose bugs in
2226
yy_init_globals. Leave at 0x00 for releases. */
2227
memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2229
execute_set_extra (yy_user_defined, *ptr_yy_globals);
2231
return yy_init_globals ( *ptr_yy_globals );
2234
/* %endif if-c-only */
2237
static int yy_init_globals (yyscan_t yyscanner)
2239
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2240
/* Initialization is the same as for the non-reentrant scanner.
2241
* This function is called from execute_lex_destroy(), so don't allocate here.
2244
yyg->yy_buffer_stack = 0;
2245
yyg->yy_buffer_stack_top = 0;
2246
yyg->yy_buffer_stack_max = 0;
2247
yyg->yy_c_buf_p = (char *) 0;
2251
yyg->yy_start_stack_ptr = 0;
2252
yyg->yy_start_stack_depth = 0;
2253
yyg->yy_start_stack = NULL;
2255
/* Defined in main.c */
2264
/* For future reference: Set errno on error, since we are called by
2265
* execute_lex_init()
2271
/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
2272
/* execute_lex_destroy is for both reentrant and non-reentrant scanners. */
2273
int execute_lex_destroy (yyscan_t yyscanner)
2275
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2277
/* Pop the buffer stack, destroying each element. */
2278
while(YY_CURRENT_BUFFER){
2279
execute__delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
2280
YY_CURRENT_BUFFER_LVALUE = NULL;
2281
execute_pop_buffer_state(yyscanner);
2284
/* Destroy the stack itself. */
2285
execute_free(yyg->yy_buffer_stack ,yyscanner);
2286
yyg->yy_buffer_stack = NULL;
2288
/* Destroy the start condition stack. */
2289
execute_free(yyg->yy_start_stack ,yyscanner );
2290
yyg->yy_start_stack = NULL;
2292
/* Reset the globals. This is important in a non-reentrant scanner so the next time
2293
* execute_lex() is called, initialization will occur. */
2294
yy_init_globals( yyscanner);
2297
/* Destroy the main struct (reentrant only). */
2298
execute_free ( yyscanner , yyscanner );
2306
* Internal utility routines.
2310
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
2313
for ( i = 0; i < n; ++i )
2318
#ifdef YY_NEED_STRLEN
2319
static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
2322
for ( n = 0; s[n]; ++n )
2329
void *execute_alloc (yy_size_t size , yyscan_t yyscanner)
2331
return (void *) malloc( size );
2334
void *execute_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
2336
/* The cast to (char *) in the following accommodates both
2337
* implementations that use char* generic pointers, and those
2338
* that use void* generic pointers. It works with the latter
2339
* because both ANSI C and C++ allow castless assignment from
2340
* any pointer type to void*, and deal with argument conversions
2341
* as though doing an assignment.
2343
return (void *) realloc( (char *) ptr, size );
2346
void execute_free (void * ptr , yyscan_t yyscanner)
2348
free( (char *) ptr ); /* see execute_realloc() for (char *) cast */
2351
/* %if-tables-serialization definitions */
2352
/* %define-yytables The name for this specific scanner's tables. */
2353
#define YYTABLES_NAME "yytables"
2356
/* %ok-for-header */
2358
#line 137 "drizzled/execute/scanner.l"
2361
namespace drizzled {
2364
void Context::init_scanner()
2366
execute_lex_init(&scanner);
2367
execute_set_extra(this,scanner);
2370
void Context::destroy_scanner()
2372
execute_lex_destroy(scanner);
2375
} // namespace execute
2376
} // namespace drizzled