~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to drizzled/execute/scanner.cc

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.1.6)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20120619104649-e2l0ggd4oz3um0f4
Tags: upstream-7.1.36-stable
ImportĀ upstreamĀ versionĀ 7.1.36-stable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#line 2 "drizzled/execute/scanner.cc"
 
2
#line 41 "drizzled/execute/scanner.l"
 
3
 
 
4
#include <config.h>
 
5
#include <drizzled/execute/parser.h>  
 
6
#include <drizzled/execute/context.h>
 
7
#include <drizzled/execute/symbol.h>
 
8
#include <drizzled/lex_string.h>
 
9
 
 
10
using namespace drizzled;
 
11
 
 
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"
 
17
#endif
 
18
 
 
19
#define YY_EXTRA_TYPE ::drizzled::execute::Context*
 
20
 
 
21
 
 
22
 
 
23
 
 
24
#line 25 "drizzled/execute/scanner.cc"
 
25
 
 
26
#define  YY_INT_ALIGNED short int
 
27
 
 
28
/* A lexical scanner generated by flex */
 
29
 
 
30
/* %not-for-header */
 
31
 
 
32
/* %if-c-only */
 
33
/* %if-not-reentrant */
 
34
/* %endif */
 
35
/* %endif */
 
36
/* %ok-for-header */
 
37
 
 
38
#define FLEX_SCANNER
 
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
 
43
#define FLEX_BETA
 
44
#endif
 
45
 
 
46
/* %if-c++-only */
 
47
/* %endif */
 
48
 
 
49
/* %if-c-only */
 
50
    
 
51
/* %endif */
 
52
 
 
53
/* %if-c-only */
 
54
 
 
55
/* %endif */
 
56
 
 
57
/* First, we deal with  platform-specific or compiler-specific issues. */
 
58
 
 
59
/* begin standard C headers. */
 
60
/* %if-c-only */
 
61
#include <stdio.h>
 
62
#include <string.h>
 
63
#include <errno.h>
 
64
#include <stdlib.h>
 
65
/* %endif */
 
66
 
 
67
/* %if-tables-serialization */
 
68
/* %endif */
 
69
/* end standard C headers. */
 
70
 
 
71
/* %if-c-or-c++ */
 
72
/* flex integer type definitions */
 
73
 
 
74
#ifndef FLEXINT_H
 
75
#define FLEXINT_H
 
76
 
 
77
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
 
78
 
 
79
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 
80
 
 
81
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
 
82
 * if you want the limit (max/min) macros for int types. 
 
83
 */
 
84
#ifndef __STDC_LIMIT_MACROS
 
85
#define __STDC_LIMIT_MACROS 1
 
86
#endif
 
87
 
 
88
#include <inttypes.h>
 
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;
 
95
#else
 
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;
 
102
#endif /* ! C99 */
 
103
 
 
104
/* Limits of integral types. */
 
105
#ifndef INT8_MIN
 
106
#define INT8_MIN               (-128)
 
107
#endif
 
108
#ifndef INT16_MIN
 
109
#define INT16_MIN              (-32767-1)
 
110
#endif
 
111
#ifndef INT32_MIN
 
112
#define INT32_MIN              (-2147483647-1)
 
113
#endif
 
114
#ifndef INT8_MAX
 
115
#define INT8_MAX               (127)
 
116
#endif
 
117
#ifndef INT16_MAX
 
118
#define INT16_MAX              (32767)
 
119
#endif
 
120
#ifndef INT32_MAX
 
121
#define INT32_MAX              (2147483647)
 
122
#endif
 
123
#ifndef UINT8_MAX
 
124
#define UINT8_MAX              (255U)
 
125
#endif
 
126
#ifndef UINT16_MAX
 
127
#define UINT16_MAX             (65535U)
 
128
#endif
 
129
#ifndef UINT32_MAX
 
130
#define UINT32_MAX             (4294967295U)
 
131
#endif
 
132
 
 
133
#endif /* ! FLEXINT_H */
 
134
 
 
135
/* %endif */
 
136
 
 
137
/* %if-c++-only */
 
138
/* %endif */
 
139
 
 
140
#ifdef __cplusplus
 
141
 
 
142
/* The "const" storage-class-modifier is valid. */
 
143
#define YY_USE_CONST
 
144
 
 
145
#else   /* ! __cplusplus */
 
146
 
 
147
/* C99 requires __STDC__ to be defined as 1. */
 
148
#if defined (__STDC__)
 
149
 
 
150
#define YY_USE_CONST
 
151
 
 
152
#endif  /* defined (__STDC__) */
 
153
#endif  /* ! __cplusplus */
 
154
 
 
155
#ifdef YY_USE_CONST
 
156
#define yyconst const
 
157
#else
 
158
#define yyconst
 
159
#endif
 
160
 
 
161
/* %not-for-header */
 
162
 
 
163
/* Returned upon end-of-file. */
 
164
#define YY_NULL 0
 
165
/* %ok-for-header */
 
166
 
 
167
/* %not-for-header */
 
168
 
 
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
 
172
 * double cast.
 
173
 */
 
174
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
 
175
/* %ok-for-header */
 
176
 
 
177
/* %if-reentrant */
 
178
 
 
179
/* An opaque pointer. */
 
180
#ifndef YY_TYPEDEF_YY_SCANNER_T
 
181
#define YY_TYPEDEF_YY_SCANNER_T
 
182
typedef void* yyscan_t;
 
183
#endif
 
184
 
 
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
 
195
 
 
196
/* %endif */
 
197
 
 
198
/* %if-not-reentrant */
 
199
/* %endif */
 
200
 
 
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.
 
204
 */
 
205
#define BEGIN yyg->yy_start = 1 + 2 *
 
206
 
 
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
 
209
 * compatibility.
 
210
 */
 
211
#define YY_START ((yyg->yy_start - 1) / 2)
 
212
#define YYSTATE YY_START
 
213
 
 
214
/* Action number for EOF rule of a given start state. */
 
215
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
 
216
 
 
217
/* Special action meaning "start processing a new file". */
 
218
#define YY_NEW_FILE execute_restart(yyin ,yyscanner )
 
219
 
 
220
#define YY_END_OF_BUFFER_CHAR 0
 
221
 
 
222
/* Size of default input buffer. */
 
223
#ifndef YY_BUF_SIZE
 
224
#define YY_BUF_SIZE 16384
 
225
#endif
 
226
 
 
227
/* The state buf must be large enough to hold one state per character in the main buffer.
 
228
 */
 
229
#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
 
230
 
 
231
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
 
232
#define YY_TYPEDEF_YY_BUFFER_STATE
 
233
typedef struct yy_buffer_state *YY_BUFFER_STATE;
 
234
#endif
 
235
 
 
236
/* %if-not-reentrant */
 
237
/* %endif */
 
238
 
 
239
/* %if-c-only */
 
240
/* %if-not-reentrant */
 
241
/* %endif */
 
242
/* %endif */
 
243
 
 
244
#define EOB_ACT_CONTINUE_SCAN 0
 
245
#define EOB_ACT_END_OF_FILE 1
 
246
#define EOB_ACT_LAST_MATCH 2
 
247
 
 
248
    #define YY_LESS_LINENO(n)
 
249
    
 
250
/* Return all but the first "n" matched characters back to the input stream. */
 
251
#define yyless(n) \
 
252
        do \
 
253
                { \
 
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 */ \
 
261
                } \
 
262
        while ( 0 )
 
263
 
 
264
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
 
265
 
 
266
#ifndef YY_TYPEDEF_YY_SIZE_T
 
267
#define YY_TYPEDEF_YY_SIZE_T
 
268
typedef size_t yy_size_t;
 
269
#endif
 
270
 
 
271
#ifndef YY_STRUCT_YY_BUFFER_STATE
 
272
#define YY_STRUCT_YY_BUFFER_STATE
 
273
struct yy_buffer_state
 
274
        {
 
275
/* %if-c-only */
 
276
        FILE *yy_input_file;
 
277
/* %endif */
 
278
 
 
279
/* %if-c++-only */
 
280
/* %endif */
 
281
 
 
282
        char *yy_ch_buf;                /* input buffer */
 
283
        char *yy_buf_pos;               /* current position in input buffer */
 
284
 
 
285
        /* Size of input buffer in bytes, not including room for EOB
 
286
         * characters.
 
287
         */
 
288
        yy_size_t yy_buf_size;
 
289
 
 
290
        /* Number of characters read into yy_ch_buf, not including EOB
 
291
         * characters.
 
292
         */
 
293
        int yy_n_chars;
 
294
 
 
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
 
297
         * delete it.
 
298
         */
 
299
        int yy_is_our_buffer;
 
300
 
 
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
 
304
         * each newline.
 
305
         */
 
306
        int yy_is_interactive;
 
307
 
 
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
 
310
         * not.
 
311
         */
 
312
        int yy_at_bol;
 
313
 
 
314
    int yy_bs_lineno; /**< The line count. */
 
315
    int yy_bs_column; /**< The column count. */
 
316
    
 
317
        /* Whether to try to fill the input buffer when we reach the
 
318
         * end of it.
 
319
         */
 
320
        int yy_fill_buffer;
 
321
 
 
322
        int yy_buffer_status;
 
323
 
 
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.
 
331
         *
 
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.
 
335
         */
 
336
#define YY_BUFFER_EOF_PENDING 2
 
337
 
 
338
        };
 
339
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
 
340
 
 
341
/* %if-c-only Standard (non-C++) definition */
 
342
/* %not-for-header */
 
343
 
 
344
/* %if-not-reentrant */
 
345
/* %endif */
 
346
/* %ok-for-header */
 
347
 
 
348
/* %endif */
 
349
 
 
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
 
352
 * "scanner state".
 
353
 *
 
354
 * Returns the top of the stack, or NULL.
 
355
 */
 
356
#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
 
357
                          ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
 
358
                          : NULL)
 
359
 
 
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.
 
362
 */
 
363
#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
 
364
 
 
365
/* %if-c-only Standard (non-C++) definition */
 
366
 
 
367
/* %if-not-reentrant */
 
368
/* %not-for-header */
 
369
 
 
370
/* %ok-for-header */
 
371
 
 
372
/* %endif */
 
373
 
 
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 );
 
381
 
 
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 );
 
385
 
 
386
#define YY_FLUSH_BUFFER execute__flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
 
387
 
 
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 );
 
391
 
 
392
/* %endif */
 
393
 
 
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 );
 
397
 
 
398
#define yy_new_buffer execute__create_buffer
 
399
 
 
400
#define yy_set_interactive(is_interactive) \
 
401
        { \
 
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); \
 
406
        } \
 
407
        YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
 
408
        }
 
409
 
 
410
#define yy_set_bol(at_bol) \
 
411
        { \
 
412
        if ( ! YY_CURRENT_BUFFER ){\
 
413
        execute_ensure_buffer_stack (yyscanner); \
 
414
                YY_CURRENT_BUFFER_LVALUE =    \
 
415
            execute__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
 
416
        } \
 
417
        YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
 
418
        }
 
419
 
 
420
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
 
421
 
 
422
/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
 
423
/* Begin user sect3 */
 
424
 
 
425
#define execute_wrap(n) 1
 
426
#define YY_SKIP_YYWRAP
 
427
 
 
428
#define FLEX_DEBUG
 
429
 
 
430
typedef unsigned char YY_CHAR;
 
431
 
 
432
typedef int yy_state_type;
 
433
 
 
434
#define yytext_ptr yytext_r
 
435
 
 
436
/* %if-c-only Standard (non-C++) definition */
 
437
 
 
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 );
 
442
 
 
443
/* %endif */
 
444
 
 
445
/* Done after the current pattern has been matched and before the
 
446
 * corresponding action - sets up yytext.
 
447
 */
 
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; \
 
453
        *yy_cp = '\0'; \
 
454
/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
 
455
        yyg->yy_c_buf_p = yy_cp;
 
456
 
 
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. */
 
462
struct yy_trans_info
 
463
        {
 
464
        flex_int32_t yy_verify;
 
465
        flex_int32_t yy_nxt;
 
466
        };
 
467
static yyconst flex_int16_t yy_accept[46] =
 
468
    {   0,
 
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,
 
473
        3,    1,    3,    3,    0
 
474
    } ;
 
475
 
 
476
static yyconst flex_int32_t yy_ec[256] =
 
477
    {   0,
 
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,
 
488
 
 
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,
 
499
 
 
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,
 
505
        1,    1,    1,    1,    1
 
506
    } ;
 
507
 
 
508
static yyconst flex_int32_t yy_meta[23] =
 
509
    {   0,
 
510
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
511
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
512
        1,    1
 
513
    } ;
 
514
 
 
515
static yyconst flex_int16_t yy_base[46] =
 
516
    {   0,
 
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,
 
521
        0,    0,    0,    0,  115
 
522
    } ;
 
523
 
 
524
static yyconst flex_int16_t yy_def[46] =
 
525
    {   0,
 
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,
 
530
       13,    4,   13,   13,    0
 
531
    } ;
 
532
 
 
533
static yyconst flex_int16_t yy_nxt[138] =
 
534
    {   0,
 
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,
 
545
 
 
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
 
550
    } ;
 
551
 
 
552
static yyconst flex_int16_t yy_chk[138] =
 
553
    {   0,
 
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,
 
564
 
 
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
 
569
    } ;
 
570
 
 
571
static yyconst flex_int16_t yy_rule_linenum[5] =
 
572
    {   0,
 
573
      122,  124,  127,  132
 
574
    } ;
 
575
 
 
576
/* The intent behind this definition is that it'll catch
 
577
 * any uses of REJECT which flex missed.
 
578
 */
 
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:
 
585
 * 
 
586
 *  Drizzle Execute Parser
 
587
 *
 
588
 *  Copyright (C) 2011 Data Differential, http://datadifferential.com/
 
589
 *  Copyright (C) 2011 Vijay Samuel, vjsamuel1990@gmail.com
 
590
 *
 
591
 *  All rights reserved.
 
592
 *
 
593
 *  Redistribution and use in source and binary forms, with or without
 
594
 *  modification, are permitted provided that the following conditions are
 
595
 *  met:
 
596
 *
 
597
 *      * Redistributions of source code must retain the above copyright
 
598
 *  notice, this list of conditions and the following disclaimer.
 
599
 *
 
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
 
603
 *  distribution.
 
604
 *
 
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.
 
608
 *
 
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.
 
620
 *
 
621
 */
 
622
 
 
623
#line 63 "drizzled/execute/scanner.l"
 
624
#include <cstdio>
 
625
#include <cstdlib>
 
626
#include <cstring>
 
627
 
 
628
#define PARAM execute_get_extra(yyscanner)
 
629
 
 
630
#define get_lex_chars(buffer, result, max_size, context) \
 
631
{ \
 
632
  if (context->pos >= context->length) \
 
633
  { \
 
634
    result= YY_NULL; \
 
635
  } \
 
636
  else \
 
637
  { \
 
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; \
 
642
  } \
 
643
}
 
644
 
 
645
 
 
646
#define YY_INPUT(buffer, result, max_size) get_lex_chars(buffer, result, max_size, PARAM)
 
647
 
 
648
#define YY_NO_UNISTD_H 1
 
649
#line 650 "drizzled/execute/scanner.cc"
 
650
 
 
651
#define INITIAL 0
 
652
 
 
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.
 
657
 */
 
658
/* %if-c-only */
 
659
#include <unistd.h>
 
660
/* %endif */
 
661
/* %if-c++-only */
 
662
/* %endif */
 
663
#endif
 
664
 
 
665
#ifndef YY_EXTRA_TYPE
 
666
#define YY_EXTRA_TYPE void *
 
667
#endif
 
668
 
 
669
/* %if-c-only Reentrant structure and macros (non-C++). */
 
670
/* %if-reentrant */
 
671
 
 
672
/* Holds the entire state of the reentrant scanner. */
 
673
struct yyguts_t
 
674
    {
 
675
 
 
676
    /* User-defined. Not touched by flex. */
 
677
    YY_EXTRA_TYPE yyextra_r;
 
678
 
 
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. */
 
684
    char yy_hold_char;
 
685
    int yy_n_chars;
 
686
    int yyleng_r;
 
687
    char *yy_c_buf_p;
 
688
    int yy_init;
 
689
    int yy_start;
 
690
    int yy_did_buffer_switch_on_eof;
 
691
    int yy_start_stack_ptr;
 
692
    int yy_start_stack_depth;
 
693
    int *yy_start_stack;
 
694
    yy_state_type yy_last_accepting_state;
 
695
    char* yy_last_accepting_cpos;
 
696
 
 
697
    int yylineno_r;
 
698
    int yy_flex_debug_r;
 
699
 
 
700
    char *yytext_r;
 
701
    int yy_more_flag;
 
702
    int yy_more_len;
 
703
 
 
704
    YYSTYPE * yylval_r;
 
705
 
 
706
    }; /* end struct yyguts_t */
 
707
 
 
708
/* %if-c-only */
 
709
 
 
710
static int yy_init_globals (yyscan_t yyscanner );
 
711
 
 
712
/* %endif */
 
713
 
 
714
/* %if-reentrant */
 
715
 
 
716
    /* This must go here because YYSTYPE and YYLTYPE are included
 
717
     * from bison output in section 1.*/
 
718
    #    define yylval yyg->yylval_r
 
719
    
 
720
int execute_lex_init (yyscan_t* scanner);
 
721
 
 
722
int execute_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
 
723
 
 
724
/* %endif */
 
725
 
 
726
/* %endif End reentrant structures and macros. */
 
727
 
 
728
/* Accessor methods to globals.
 
729
   These are made visible to non-reentrant scanners for convenience. */
 
730
 
 
731
int execute_lex_destroy (yyscan_t yyscanner );
 
732
 
 
733
int execute_get_debug (yyscan_t yyscanner );
 
734
 
 
735
void execute_set_debug (int debug_flag ,yyscan_t yyscanner );
 
736
 
 
737
YY_EXTRA_TYPE execute_get_extra (yyscan_t yyscanner );
 
738
 
 
739
void execute_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
 
740
 
 
741
FILE *execute_get_in (yyscan_t yyscanner );
 
742
 
 
743
void execute_set_in  (FILE * in_str ,yyscan_t yyscanner );
 
744
 
 
745
FILE *execute_get_out (yyscan_t yyscanner );
 
746
 
 
747
void execute_set_out  (FILE * out_str ,yyscan_t yyscanner );
 
748
 
 
749
int execute_get_leng (yyscan_t yyscanner );
 
750
 
 
751
char *execute_get_text (yyscan_t yyscanner );
 
752
 
 
753
int execute_get_lineno (yyscan_t yyscanner );
 
754
 
 
755
void execute_set_lineno (int line_number ,yyscan_t yyscanner );
 
756
 
 
757
int execute_get_column  (yyscan_t yyscanner );
 
758
 
 
759
void execute_set_column (int column_no ,yyscan_t yyscanner );
 
760
 
 
761
/* %if-bison-bridge */
 
762
 
 
763
YYSTYPE * execute_get_lval (yyscan_t yyscanner );
 
764
 
 
765
void execute_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
 
766
 
 
767
/* %endif */
 
768
 
 
769
/* Macros after this point can all be overridden by user definitions in
 
770
 * section 1.
 
771
 */
 
772
 
 
773
#ifndef YY_SKIP_YYWRAP
 
774
#ifdef __cplusplus
 
775
extern "C" int execute_wrap (yyscan_t yyscanner );
 
776
#else
 
777
extern int execute_wrap (yyscan_t yyscanner );
 
778
#endif
 
779
#endif
 
780
 
 
781
/* %not-for-header */
 
782
 
 
783
/* %ok-for-header */
 
784
 
 
785
/* %endif */
 
786
 
 
787
#ifndef yytext_ptr
 
788
static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
 
789
#endif
 
790
 
 
791
#ifdef YY_NEED_STRLEN
 
792
static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
 
793
#endif
 
794
 
 
795
#ifndef YY_NO_INPUT
 
796
/* %if-c-only Standard (non-C++) definition */
 
797
/* %not-for-header */
 
798
 
 
799
#ifdef __cplusplus
 
800
static int yyinput (yyscan_t yyscanner );
 
801
#else
 
802
static int input (yyscan_t yyscanner );
 
803
#endif
 
804
/* %ok-for-header */
 
805
 
 
806
/* %endif */
 
807
#endif
 
808
 
 
809
/* %if-c-only */
 
810
 
 
811
/* %endif */
 
812
 
 
813
/* Amount of stuff to slurp up with each read. */
 
814
#ifndef YY_READ_BUF_SIZE
 
815
#define YY_READ_BUF_SIZE 8192
 
816
#endif
 
817
 
 
818
/* Copy whatever the last rule matched to the standard output. */
 
819
#ifndef ECHO
 
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().
 
823
 */
 
824
#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
 
825
/* %endif */
 
826
/* %if-c++-only C++ definition */
 
827
/* %endif */
 
828
#endif
 
829
 
 
830
/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
 
831
 * is returned in "result".
 
832
 */
 
833
#ifndef YY_INPUT
 
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 ) \
 
837
                { \
 
838
                int c = '*'; \
 
839
                unsigned n; \
 
840
                for ( n = 0; n < max_size && \
 
841
                             (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
 
842
                        buf[n] = (char) c; \
 
843
                if ( c == '\n' ) \
 
844
                        buf[n++] = (char) c; \
 
845
                if ( c == EOF && ferror( yyin ) ) \
 
846
                        YY_FATAL_ERROR( "input in flex scanner failed" ); \
 
847
                result = n; \
 
848
                } \
 
849
        else \
 
850
                { \
 
851
                errno=0; \
 
852
                while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
 
853
                        { \
 
854
                        if( errno != EINTR) \
 
855
                                { \
 
856
                                YY_FATAL_ERROR( "input in flex scanner failed" ); \
 
857
                                break; \
 
858
                                } \
 
859
                        errno=0; \
 
860
                        clearerr(yyin); \
 
861
                        } \
 
862
                }\
 
863
\
 
864
/* %if-c++-only C++ definition \ */\
 
865
/* %endif */
 
866
 
 
867
#endif
 
868
 
 
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.
 
872
 */
 
873
#ifndef yyterminate
 
874
#define yyterminate() return YY_NULL
 
875
#endif
 
876
 
 
877
/* Number of entries by which start-condition stack grows. */
 
878
#ifndef YY_START_STACK_INCR
 
879
#define YY_START_STACK_INCR 25
 
880
#endif
 
881
 
 
882
/* Report a fatal error. */
 
883
#ifndef YY_FATAL_ERROR
 
884
/* %if-c-only */
 
885
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
 
886
/* %endif */
 
887
/* %if-c++-only */
 
888
/* %endif */
 
889
#endif
 
890
 
 
891
/* %if-tables-serialization structures and prototypes */
 
892
/* %not-for-header */
 
893
 
 
894
/* %ok-for-header */
 
895
 
 
896
/* %not-for-header */
 
897
 
 
898
/* %tables-yydmap generated elements */
 
899
/* %endif */
 
900
/* end tables serialization structures and prototypes */
 
901
 
 
902
/* %ok-for-header */
 
903
 
 
904
/* Default declaration of generated scanner - a define so the user can
 
905
 * easily add parameters.
 
906
 */
 
907
#ifndef YY_DECL
 
908
#define YY_DECL_IS_OURS 1
 
909
/* %if-c-only Standard (non-C++) definition */
 
910
 
 
911
extern int execute_lex \
 
912
               (YYSTYPE * yylval_param ,yyscan_t yyscanner);
 
913
 
 
914
#define YY_DECL int execute_lex \
 
915
               (YYSTYPE * yylval_param , yyscan_t yyscanner)
 
916
/* %endif */
 
917
/* %if-c++-only C++ definition */
 
918
/* %endif */
 
919
#endif /* !YY_DECL */
 
920
 
 
921
/* Code executed at the beginning of each rule, after yytext and yyleng
 
922
 * have been set up.
 
923
 */
 
924
#ifndef YY_USER_ACTION
 
925
#define YY_USER_ACTION
 
926
#endif
 
927
 
 
928
/* Code executed at the end of each rule. */
 
929
#ifndef YY_BREAK
 
930
#define YY_BREAK break;
 
931
#endif
 
932
 
 
933
/* %% [6.0] YY_RULE_SETUP definition goes here */
 
934
#define YY_RULE_SETUP \
 
935
        YY_USER_ACTION
 
936
 
 
937
/* %not-for-header */
 
938
 
 
939
/** The main scanner function which does all the work.
 
940
 */
 
941
YY_DECL
 
942
{
 
943
        register yy_state_type yy_current_state;
 
944
        register char *yy_cp, *yy_bp;
 
945
        register int yy_act;
 
946
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
947
 
 
948
/* %% [7.0] user's declarations go here */
 
949
#line 120 "drizzled/execute/scanner.l"
 
950
 
 
951
 
 
952
#line 953 "drizzled/execute/scanner.cc"
 
953
 
 
954
    yylval = yylval_param;
 
955
 
 
956
        if ( !yyg->yy_init )
 
957
                {
 
958
                yyg->yy_init = 1;
 
959
 
 
960
#ifdef YY_USER_INIT
 
961
                YY_USER_INIT;
 
962
#endif
 
963
 
 
964
                if ( ! yyg->yy_start )
 
965
                        yyg->yy_start = 1;      /* first start state */
 
966
 
 
967
                if ( ! yyin )
 
968
/* %if-c-only */
 
969
                        yyin = stdin;
 
970
/* %endif */
 
971
/* %if-c++-only */
 
972
/* %endif */
 
973
 
 
974
                if ( ! yyout )
 
975
/* %if-c-only */
 
976
                        yyout = stdout;
 
977
/* %endif */
 
978
/* %if-c++-only */
 
979
/* %endif */
 
980
 
 
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);
 
985
                }
 
986
 
 
987
                execute__load_buffer_state(yyscanner );
 
988
                }
 
989
 
 
990
        while ( 1 )             /* loops until end-of-file is reached */
 
991
                {
 
992
/* %% [8.0] yymore()-related code goes here */
 
993
                yy_cp = yyg->yy_c_buf_p;
 
994
 
 
995
                /* Support of yytext. */
 
996
                *yy_cp = yyg->yy_hold_char;
 
997
 
 
998
                /* yy_bp points to the position in yy_ch_buf of the start of
 
999
                 * the current run.
 
1000
                 */
 
1001
                yy_bp = yy_cp;
 
1002
 
 
1003
/* %% [9.0] code to set up and find next match goes here */
 
1004
                yy_current_state = yyg->yy_start;
 
1005
yy_match:
 
1006
                do
 
1007
                        {
 
1008
                        register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
 
1009
                        if ( yy_accept[yy_current_state] )
 
1010
                                {
 
1011
                                yyg->yy_last_accepting_state = yy_current_state;
 
1012
                                yyg->yy_last_accepting_cpos = yy_cp;
 
1013
                                }
 
1014
                        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 
1015
                                {
 
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];
 
1019
                                }
 
1020
                        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 
1021
                        ++yy_cp;
 
1022
                        }
 
1023
                while ( yy_current_state != 45 );
 
1024
                yy_cp = yyg->yy_last_accepting_cpos;
 
1025
                yy_current_state = yyg->yy_last_accepting_state;
 
1026
 
 
1027
yy_find_action:
 
1028
/* %% [10.0] code to find the action number goes here */
 
1029
                yy_act = yy_accept[yy_current_state];
 
1030
 
 
1031
                YY_DO_BEFORE_ACTION;
 
1032
 
 
1033
/* %% [11.0] code for yylineno update goes here */
 
1034
 
 
1035
do_action:      /* This label is used only to access EOF actions. */
 
1036
 
 
1037
/* %% [12.0] debug code goes here */
 
1038
                if ( yy_flex_debug )
 
1039
                        {
 
1040
                        if ( yy_act == 0 )
 
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",
 
1047
                                         yytext );
 
1048
                        else if ( yy_act == 6 )
 
1049
                                fprintf( stderr, "--(end of buffer or a NUL)\n" );
 
1050
                        else
 
1051
                                fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
 
1052
                        }
 
1053
 
 
1054
                switch ( yy_act )
 
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;
 
1063
 
 
1064
case 1:
 
1065
YY_RULE_SETUP
 
1066
#line 122 "drizzled/execute/scanner.l"
 
1067
{  /*  Byte Order Mark */   } 
 
1068
        YY_BREAK
 
1069
case 2:
 
1070
/* rule 2 can match eol */
 
1071
YY_RULE_SETUP
 
1072
#line 124 "drizzled/execute/scanner.l"
 
1073
; /* skip whitespace */
 
1074
        YY_BREAK
 
1075
case 3:
 
1076
/* rule 3 can match eol */
 
1077
YY_RULE_SETUP
 
1078
#line 127 "drizzled/execute/scanner.l"
 
1079
{
 
1080
      yylval->string.assign(yytext, yyleng);
 
1081
      return STRING;
 
1082
    }
 
1083
        YY_BREAK
 
1084
case 4:
 
1085
YY_RULE_SETUP
 
1086
#line 132 "drizzled/execute/scanner.l"
 
1087
{
 
1088
      yyextra->begin= yytext;
 
1089
      return UNKNOWN;
 
1090
    }
 
1091
        YY_BREAK
 
1092
case 5:
 
1093
YY_RULE_SETUP
 
1094
#line 137 "drizzled/execute/scanner.l"
 
1095
ECHO;
 
1096
        YY_BREAK
 
1097
#line 1098 "drizzled/execute/scanner.cc"
 
1098
case YY_STATE_EOF(INITIAL):
 
1099
        yyterminate();
 
1100
 
 
1101
        case YY_END_OF_BUFFER:
 
1102
                {
 
1103
                /* Amount of text matched not including the EOB char. */
 
1104
                int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
 
1105
 
 
1106
                /* Undo the effects of YY_DO_BEFORE_ACTION. */
 
1107
                *yy_cp = yyg->yy_hold_char;
 
1108
                YY_RESTORE_YY_MORE_OFFSET
 
1109
 
 
1110
                if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
 
1111
                        {
 
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.
 
1120
                         */
 
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;
 
1124
                        }
 
1125
 
 
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
 
1131
                 * in input().
 
1132
                 */
 
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;
 
1136
 
 
1137
                        yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
 
1138
 
 
1139
                        yy_current_state = yy_get_previous_state( yyscanner );
 
1140
 
 
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).
 
1148
                         */
 
1149
 
 
1150
                        yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
 
1151
 
 
1152
                        yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
 
1153
 
 
1154
                        if ( yy_next_state )
 
1155
                                {
 
1156
                                /* Consume the NUL. */
 
1157
                                yy_cp = ++yyg->yy_c_buf_p;
 
1158
                                yy_current_state = yy_next_state;
 
1159
                                goto yy_match;
 
1160
                                }
 
1161
 
 
1162
                        else
 
1163
                                {
 
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;
 
1168
                                }
 
1169
                        }
 
1170
 
 
1171
                else switch ( yy_get_next_buffer( yyscanner ) )
 
1172
                        {
 
1173
                        case EOB_ACT_END_OF_FILE:
 
1174
                                {
 
1175
                                yyg->yy_did_buffer_switch_on_eof = 0;
 
1176
 
 
1177
                                if ( execute_wrap(yyscanner ) )
 
1178
                                        {
 
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.
 
1187
                                         */
 
1188
                                        yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
 
1189
 
 
1190
                                        yy_act = YY_STATE_EOF(YY_START);
 
1191
                                        goto do_action;
 
1192
                                        }
 
1193
 
 
1194
                                else
 
1195
                                        {
 
1196
                                        if ( ! yyg->yy_did_buffer_switch_on_eof )
 
1197
                                                YY_NEW_FILE;
 
1198
                                        }
 
1199
                                break;
 
1200
                                }
 
1201
 
 
1202
                        case EOB_ACT_CONTINUE_SCAN:
 
1203
                                yyg->yy_c_buf_p =
 
1204
                                        yyg->yytext_ptr + yy_amount_of_matched_text;
 
1205
 
 
1206
                                yy_current_state = yy_get_previous_state( yyscanner );
 
1207
 
 
1208
                                yy_cp = yyg->yy_c_buf_p;
 
1209
                                yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
 
1210
                                goto yy_match;
 
1211
 
 
1212
                        case EOB_ACT_LAST_MATCH:
 
1213
                                yyg->yy_c_buf_p =
 
1214
                                &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
 
1215
 
 
1216
                                yy_current_state = yy_get_previous_state( yyscanner );
 
1217
 
 
1218
                                yy_cp = yyg->yy_c_buf_p;
 
1219
                                yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
 
1220
                                goto yy_find_action;
 
1221
                        }
 
1222
                break;
 
1223
                }
 
1224
 
 
1225
        default:
 
1226
                YY_FATAL_ERROR(
 
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 */
 
1232
 
 
1233
/* %if-c++-only */
 
1234
/* %not-for-header */
 
1235
 
 
1236
/* %ok-for-header */
 
1237
 
 
1238
/* %endif */
 
1239
 
 
1240
/* yy_get_next_buffer - try to read in a new buffer
 
1241
 *
 
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
 
1246
 */
 
1247
/* %if-c-only */
 
1248
static int yy_get_next_buffer (yyscan_t yyscanner)
 
1249
/* %endif */
 
1250
/* %if-c++-only */
 
1251
/* %endif */
 
1252
{
 
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;
 
1257
        int ret_val;
 
1258
 
 
1259
        if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
 
1260
                YY_FATAL_ERROR(
 
1261
                "fatal flex scanner internal error--end of buffer missed" );
 
1262
 
 
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 )
 
1266
                        {
 
1267
                        /* We matched a single character, the EOB, so
 
1268
                         * treat this as a final EOF.
 
1269
                         */
 
1270
                        return EOB_ACT_END_OF_FILE;
 
1271
                        }
 
1272
 
 
1273
                else
 
1274
                        {
 
1275
                        /* We matched some text prior to the EOB, first
 
1276
                         * process it.
 
1277
                         */
 
1278
                        return EOB_ACT_LAST_MATCH;
 
1279
                        }
 
1280
                }
 
1281
 
 
1282
        /* Try to read more data. */
 
1283
 
 
1284
        /* First move last chars to start of buffer. */
 
1285
        number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
 
1286
 
 
1287
        for ( i = 0; i < number_to_move; ++i )
 
1288
                *(dest++) = *(source++);
 
1289
 
 
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,
 
1292
                 * just force an EOF
 
1293
                 */
 
1294
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
 
1295
 
 
1296
        else
 
1297
                {
 
1298
                        int num_to_read =
 
1299
                        YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
1300
 
 
1301
                while ( num_to_read <= 0 )
 
1302
                        { /* Not enough room in the buffer - grow it. */
 
1303
 
 
1304
                        /* just a shorter name for the current buffer */
 
1305
                        YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
 
1306
 
 
1307
                        int yy_c_buf_p_offset =
 
1308
                                (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
 
1309
 
 
1310
                        if ( b->yy_is_our_buffer )
 
1311
                                {
 
1312
                                int new_size = b->yy_buf_size * 2;
 
1313
 
 
1314
                                if ( new_size <= 0 )
 
1315
                                        b->yy_buf_size += b->yy_buf_size / 8;
 
1316
                                else
 
1317
                                        b->yy_buf_size *= 2;
 
1318
 
 
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 );
 
1322
                                }
 
1323
                        else
 
1324
                                /* Can't grow it, we don't own it. */
 
1325
                                b->yy_ch_buf = 0;
 
1326
 
 
1327
                        if ( ! b->yy_ch_buf )
 
1328
                                YY_FATAL_ERROR(
 
1329
                                "fatal error - scanner input buffer overflow" );
 
1330
 
 
1331
                        yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
 
1332
 
 
1333
                        num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
 
1334
                                                number_to_move - 1;
 
1335
 
 
1336
                        }
 
1337
 
 
1338
                if ( num_to_read > YY_READ_BUF_SIZE )
 
1339
                        num_to_read = YY_READ_BUF_SIZE;
 
1340
 
 
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 );
 
1344
 
 
1345
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
 
1346
                }
 
1347
 
 
1348
        if ( yyg->yy_n_chars == 0 )
 
1349
                {
 
1350
                if ( number_to_move == YY_MORE_ADJ )
 
1351
                        {
 
1352
                        ret_val = EOB_ACT_END_OF_FILE;
 
1353
                        execute_restart(yyin  ,yyscanner);
 
1354
                        }
 
1355
 
 
1356
                else
 
1357
                        {
 
1358
                        ret_val = EOB_ACT_LAST_MATCH;
 
1359
                        YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
 
1360
                                YY_BUFFER_EOF_PENDING;
 
1361
                        }
 
1362
                }
 
1363
 
 
1364
        else
 
1365
                ret_val = EOB_ACT_CONTINUE_SCAN;
 
1366
 
 
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()" );
 
1373
        }
 
1374
 
 
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;
 
1378
 
 
1379
        yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
 
1380
 
 
1381
        return ret_val;
 
1382
}
 
1383
 
 
1384
/* yy_get_previous_state - get the state just before the EOB char was reached */
 
1385
 
 
1386
/* %if-c-only */
 
1387
/* %not-for-header */
 
1388
 
 
1389
    static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
 
1390
/* %endif */
 
1391
/* %if-c++-only */
 
1392
/* %endif */
 
1393
{
 
1394
        register yy_state_type yy_current_state;
 
1395
        register char *yy_cp;
 
1396
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
1397
 
 
1398
/* %% [15.0] code to get the start state into yy_current_state goes here */
 
1399
        yy_current_state = yyg->yy_start;
 
1400
 
 
1401
        for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
 
1402
                {
 
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] )
 
1406
                        {
 
1407
                        yyg->yy_last_accepting_state = yy_current_state;
 
1408
                        yyg->yy_last_accepting_cpos = yy_cp;
 
1409
                        }
 
1410
                while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 
1411
                        {
 
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];
 
1415
                        }
 
1416
                yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 
1417
                }
 
1418
 
 
1419
        return yy_current_state;
 
1420
}
 
1421
 
 
1422
/* yy_try_NUL_trans - try to make a transition on the NUL character
 
1423
 *
 
1424
 * synopsis
 
1425
 *      next_state = yy_try_NUL_trans( current_state );
 
1426
 */
 
1427
/* %if-c-only */
 
1428
    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
 
1429
/* %endif */
 
1430
/* %if-c++-only */
 
1431
/* %endif */
 
1432
{
 
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;
 
1437
 
 
1438
        register YY_CHAR yy_c = 1;
 
1439
        if ( yy_accept[yy_current_state] )
 
1440
                {
 
1441
                yyg->yy_last_accepting_state = yy_current_state;
 
1442
                yyg->yy_last_accepting_cpos = yy_cp;
 
1443
                }
 
1444
        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 
1445
                {
 
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];
 
1449
                }
 
1450
        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 
1451
        yy_is_jam = (yy_current_state == 45);
 
1452
 
 
1453
        return yy_is_jam ? 0 : yy_current_state;
 
1454
}
 
1455
 
 
1456
/* %if-c-only */
 
1457
 
 
1458
/* %endif */
 
1459
 
 
1460
/* %if-c-only */
 
1461
#ifndef YY_NO_INPUT
 
1462
#ifdef __cplusplus
 
1463
    static int yyinput (yyscan_t yyscanner)
 
1464
#else
 
1465
    static int input  (yyscan_t yyscanner)
 
1466
#endif
 
1467
 
 
1468
/* %endif */
 
1469
/* %if-c++-only */
 
1470
/* %endif */
 
1471
{
 
1472
        int c;
 
1473
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
1474
 
 
1475
        *yyg->yy_c_buf_p = yyg->yy_hold_char;
 
1476
 
 
1477
        if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
 
1478
                {
 
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.
 
1482
                 */
 
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';
 
1486
 
 
1487
                else
 
1488
                        { /* need more input */
 
1489
                        int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
 
1490
                        ++yyg->yy_c_buf_p;
 
1491
 
 
1492
                        switch ( yy_get_next_buffer( yyscanner ) )
 
1493
                                {
 
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.
 
1503
                                         */
 
1504
 
 
1505
                                        /* Reset buffer status. */
 
1506
                                        execute_restart(yyin ,yyscanner);
 
1507
 
 
1508
                                        /*FALLTHROUGH*/
 
1509
 
 
1510
                                case EOB_ACT_END_OF_FILE:
 
1511
                                        {
 
1512
                                        if ( execute_wrap(yyscanner ) )
 
1513
                                                return EOF;
 
1514
 
 
1515
                                        if ( ! yyg->yy_did_buffer_switch_on_eof )
 
1516
                                                YY_NEW_FILE;
 
1517
#ifdef __cplusplus
 
1518
                                        return yyinput(yyscanner);
 
1519
#else
 
1520
                                        return input(yyscanner);
 
1521
#endif
 
1522
                                        }
 
1523
 
 
1524
                                case EOB_ACT_CONTINUE_SCAN:
 
1525
                                        yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
 
1526
                                        break;
 
1527
                                }
 
1528
                        }
 
1529
                }
 
1530
 
 
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;
 
1534
 
 
1535
/* %% [19.0] update BOL and yylineno */
 
1536
 
 
1537
        return c;
 
1538
}
 
1539
/* %if-c-only */
 
1540
#endif  /* ifndef YY_NO_INPUT */
 
1541
/* %endif */
 
1542
 
 
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 .
 
1547
 */
 
1548
/* %if-c-only */
 
1549
    void execute_restart  (FILE * input_file , yyscan_t yyscanner)
 
1550
/* %endif */
 
1551
/* %if-c++-only */
 
1552
/* %endif */
 
1553
{
 
1554
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
1555
 
 
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);
 
1560
        }
 
1561
 
 
1562
        execute__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
 
1563
        execute__load_buffer_state(yyscanner );
 
1564
}
 
1565
 
 
1566
/** Switch to a different input buffer.
 
1567
 * @param new_buffer The new input buffer.
 
1568
 * @param yyscanner The scanner object.
 
1569
 */
 
1570
/* %if-c-only */
 
1571
    void execute__switch_to_buffer  (YY_BUFFER_STATE  new_buffer , yyscan_t yyscanner)
 
1572
/* %endif */
 
1573
/* %if-c++-only */
 
1574
/* %endif */
 
1575
{
 
1576
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
1577
 
 
1578
        /* TODO. We should be able to replace this entire function body
 
1579
         * with
 
1580
         *              execute_pop_buffer_state();
 
1581
         *              execute_push_buffer_state(new_buffer);
 
1582
     */
 
1583
        execute_ensure_buffer_stack (yyscanner);
 
1584
        if ( YY_CURRENT_BUFFER == new_buffer )
 
1585
                return;
 
1586
 
 
1587
        if ( YY_CURRENT_BUFFER )
 
1588
                {
 
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;
 
1593
                }
 
1594
 
 
1595
        YY_CURRENT_BUFFER_LVALUE = new_buffer;
 
1596
        execute__load_buffer_state(yyscanner );
 
1597
 
 
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.
 
1602
         */
 
1603
        yyg->yy_did_buffer_switch_on_eof = 1;
 
1604
}
 
1605
 
 
1606
/* %if-c-only */
 
1607
static void execute__load_buffer_state  (yyscan_t yyscanner)
 
1608
/* %endif */
 
1609
/* %if-c++-only */
 
1610
/* %endif */
 
1611
{
 
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;
 
1617
}
 
1618
 
 
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.
 
1624
 */
 
1625
/* %if-c-only */
 
1626
    YY_BUFFER_STATE execute__create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
 
1627
/* %endif */
 
1628
/* %if-c++-only */
 
1629
/* %endif */
 
1630
{
 
1631
        YY_BUFFER_STATE b;
 
1632
    
 
1633
        b = (YY_BUFFER_STATE) execute_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
 
1634
        if ( ! b )
 
1635
                YY_FATAL_ERROR( "out of dynamic memory in execute__create_buffer()" );
 
1636
 
 
1637
        b->yy_buf_size = size;
 
1638
 
 
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.
 
1641
         */
 
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()" );
 
1645
 
 
1646
        b->yy_is_our_buffer = 1;
 
1647
 
 
1648
        execute__init_buffer(b,file ,yyscanner);
 
1649
 
 
1650
        return b;
 
1651
}
 
1652
 
 
1653
/** Destroy the buffer.
 
1654
 * @param b a buffer created with execute__create_buffer()
 
1655
 * @param yyscanner The scanner object.
 
1656
 */
 
1657
/* %if-c-only */
 
1658
    void execute__delete_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
 
1659
/* %endif */
 
1660
/* %if-c++-only */
 
1661
/* %endif */
 
1662
{
 
1663
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
1664
 
 
1665
        if ( ! b )
 
1666
                return;
 
1667
 
 
1668
        if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
 
1669
                YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
 
1670
 
 
1671
        if ( b->yy_is_our_buffer )
 
1672
                execute_free((void *) b->yy_ch_buf ,yyscanner );
 
1673
 
 
1674
        execute_free((void *) b ,yyscanner );
 
1675
}
 
1676
 
 
1677
/* %if-c-only */
 
1678
 
 
1679
/* %endif */
 
1680
 
 
1681
/* %if-c++-only */
 
1682
/* %endif */
 
1683
 
 
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.
 
1687
 */
 
1688
/* %if-c-only */
 
1689
    static void execute__init_buffer  (YY_BUFFER_STATE  b, FILE * file , yyscan_t yyscanner)
 
1690
/* %endif */
 
1691
/* %if-c++-only */
 
1692
/* %endif */
 
1693
 
 
1694
{
 
1695
        int oerrno = errno;
 
1696
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
1697
 
 
1698
        execute__flush_buffer(b ,yyscanner);
 
1699
 
 
1700
        b->yy_input_file = file;
 
1701
        b->yy_fill_buffer = 1;
 
1702
 
 
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.
 
1706
     */
 
1707
    if (b != YY_CURRENT_BUFFER){
 
1708
        b->yy_bs_lineno = 1;
 
1709
        b->yy_bs_column = 0;
 
1710
    }
 
1711
 
 
1712
/* %if-c-only */
 
1713
 
 
1714
        b->yy_is_interactive = 0;
 
1715
    
 
1716
/* %endif */
 
1717
/* %if-c++-only */
 
1718
/* %endif */
 
1719
        errno = oerrno;
 
1720
}
 
1721
 
 
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.
 
1725
 */
 
1726
/* %if-c-only */
 
1727
    void execute__flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
 
1728
/* %endif */
 
1729
/* %if-c++-only */
 
1730
/* %endif */
 
1731
{
 
1732
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
1733
        if ( ! b )
 
1734
                return;
 
1735
 
 
1736
        b->yy_n_chars = 0;
 
1737
 
 
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.
 
1741
         */
 
1742
        b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
 
1743
        b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
 
1744
 
 
1745
        b->yy_buf_pos = &b->yy_ch_buf[0];
 
1746
 
 
1747
        b->yy_at_bol = 1;
 
1748
        b->yy_buffer_status = YY_BUFFER_NEW;
 
1749
 
 
1750
        if ( b == YY_CURRENT_BUFFER )
 
1751
                execute__load_buffer_state(yyscanner );
 
1752
}
 
1753
 
 
1754
/* %if-c-or-c++ */
 
1755
/** Pushes the new state onto the stack. The new state becomes
 
1756
 *  the current state. This function will allocate the stack
 
1757
 *  if necessary.
 
1758
 *  @param new_buffer The new state.
 
1759
 *  @param yyscanner The scanner object.
 
1760
 */
 
1761
/* %if-c-only */
 
1762
void execute_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
 
1763
/* %endif */
 
1764
/* %if-c++-only */
 
1765
/* %endif */
 
1766
{
 
1767
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
1768
        if (new_buffer == NULL)
 
1769
                return;
 
1770
 
 
1771
        execute_ensure_buffer_stack(yyscanner);
 
1772
 
 
1773
        /* This block is copied from execute__switch_to_buffer. */
 
1774
        if ( YY_CURRENT_BUFFER )
 
1775
                {
 
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;
 
1780
                }
 
1781
 
 
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;
 
1786
 
 
1787
        /* copied from execute__switch_to_buffer. */
 
1788
        execute__load_buffer_state(yyscanner );
 
1789
        yyg->yy_did_buffer_switch_on_eof = 1;
 
1790
}
 
1791
/* %endif */
 
1792
 
 
1793
/* %if-c-or-c++ */
 
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.
 
1797
 */
 
1798
/* %if-c-only */
 
1799
void execute_pop_buffer_state (yyscan_t yyscanner)
 
1800
/* %endif */
 
1801
/* %if-c++-only */
 
1802
/* %endif */
 
1803
{
 
1804
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
1805
        if (!YY_CURRENT_BUFFER)
 
1806
                return;
 
1807
 
 
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;
 
1812
 
 
1813
        if (YY_CURRENT_BUFFER) {
 
1814
                execute__load_buffer_state(yyscanner );
 
1815
                yyg->yy_did_buffer_switch_on_eof = 1;
 
1816
        }
 
1817
}
 
1818
/* %endif */
 
1819
 
 
1820
/* %if-c-or-c++ */
 
1821
/* Allocates the stack if it does not exist.
 
1822
 *  Guarantees space for at least one push.
 
1823
 */
 
1824
/* %if-c-only */
 
1825
static void execute_ensure_buffer_stack (yyscan_t yyscanner)
 
1826
/* %endif */
 
1827
/* %if-c++-only */
 
1828
/* %endif */
 
1829
{
 
1830
        int num_to_alloc;
 
1831
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
1832
 
 
1833
        if (!yyg->yy_buffer_stack) {
 
1834
 
 
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.
 
1838
         */
 
1839
                num_to_alloc = 1;
 
1840
                yyg->yy_buffer_stack = (struct yy_buffer_state**)execute_alloc
 
1841
                                                                (num_to_alloc * sizeof(struct yy_buffer_state*)
 
1842
                                                                , yyscanner);
 
1843
                if ( ! yyg->yy_buffer_stack )
 
1844
                        YY_FATAL_ERROR( "out of dynamic memory in execute_ensure_buffer_stack()" );
 
1845
                                                                  
 
1846
                memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
 
1847
                                
 
1848
                yyg->yy_buffer_stack_max = num_to_alloc;
 
1849
                yyg->yy_buffer_stack_top = 0;
 
1850
                return;
 
1851
        }
 
1852
 
 
1853
        if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
 
1854
 
 
1855
                /* Increase the buffer to prepare for a possible push. */
 
1856
                int grow_size = 8 /* arbitrary grow size */;
 
1857
 
 
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*)
 
1862
                                                                , yyscanner);
 
1863
                if ( ! yyg->yy_buffer_stack )
 
1864
                        YY_FATAL_ERROR( "out of dynamic memory in execute_ensure_buffer_stack()" );
 
1865
 
 
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;
 
1869
        }
 
1870
}
 
1871
/* %endif */
 
1872
 
 
1873
/* %if-c-only */
 
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. 
 
1879
 */
 
1880
YY_BUFFER_STATE execute__scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
 
1881
{
 
1882
        YY_BUFFER_STATE b;
 
1883
    
 
1884
        if ( size < 2 ||
 
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. */
 
1888
                return 0;
 
1889
 
 
1890
        b = (YY_BUFFER_STATE) execute_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
 
1891
        if ( ! b )
 
1892
                YY_FATAL_ERROR( "out of dynamic memory in execute__scan_buffer()" );
 
1893
 
 
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;
 
1900
        b->yy_at_bol = 1;
 
1901
        b->yy_fill_buffer = 0;
 
1902
        b->yy_buffer_status = YY_BUFFER_NEW;
 
1903
 
 
1904
        execute__switch_to_buffer(b ,yyscanner );
 
1905
 
 
1906
        return b;
 
1907
}
 
1908
/* %endif */
 
1909
 
 
1910
/* %if-c-only */
 
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.
 
1918
 */
 
1919
YY_BUFFER_STATE execute__scan_string (yyconst char * yystr , yyscan_t yyscanner)
 
1920
{
 
1921
    
 
1922
        return execute__scan_bytes(yystr,strlen(yystr) ,yyscanner);
 
1923
}
 
1924
/* %endif */
 
1925
 
 
1926
/* %if-c-only */
 
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.
 
1933
 */
 
1934
YY_BUFFER_STATE execute__scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
 
1935
{
 
1936
        YY_BUFFER_STATE b;
 
1937
        char *buf;
 
1938
        yy_size_t n;
 
1939
        int i;
 
1940
    
 
1941
        /* Get memory for full buffer, including space for trailing EOB's. */
 
1942
        n = _yybytes_len + 2;
 
1943
        buf = (char *) execute_alloc(n ,yyscanner );
 
1944
        if ( ! buf )
 
1945
                YY_FATAL_ERROR( "out of dynamic memory in execute__scan_bytes()" );
 
1946
 
 
1947
        for ( i = 0; i < _yybytes_len; ++i )
 
1948
                buf[i] = yybytes[i];
 
1949
 
 
1950
        buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
 
1951
 
 
1952
        b = execute__scan_buffer(buf,n ,yyscanner);
 
1953
        if ( ! b )
 
1954
                YY_FATAL_ERROR( "bad buffer in execute__scan_bytes()" );
 
1955
 
 
1956
        /* It's okay to grow etc. this buffer, and we should throw it
 
1957
         * away when we're done.
 
1958
         */
 
1959
        b->yy_is_our_buffer = 1;
 
1960
 
 
1961
        return b;
 
1962
}
 
1963
/* %endif */
 
1964
 
 
1965
#ifndef YY_EXIT_FAILURE
 
1966
#define YY_EXIT_FAILURE 2
 
1967
#endif
 
1968
 
 
1969
/* %if-c-only */
 
1970
static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
 
1971
{
 
1972
        (void) fprintf( stderr, "%s\n", msg );
 
1973
        exit( YY_EXIT_FAILURE );
 
1974
}
 
1975
/* %endif */
 
1976
/* %if-c++-only */
 
1977
/* %endif */
 
1978
 
 
1979
/* Redefine yyless() so it works in section 3 code. */
 
1980
 
 
1981
#undef yyless
 
1982
#define yyless(n) \
 
1983
        do \
 
1984
                { \
 
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; \
 
1993
                } \
 
1994
        while ( 0 )
 
1995
 
 
1996
/* Accessor  methods (get/set functions) to struct members. */
 
1997
 
 
1998
/* %if-c-only */
 
1999
/* %if-reentrant */
 
2000
 
 
2001
/** Get the user-defined data for this scanner.
 
2002
 * @param yyscanner The scanner object.
 
2003
 */
 
2004
YY_EXTRA_TYPE execute_get_extra  (yyscan_t yyscanner)
 
2005
{
 
2006
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
2007
    return yyextra;
 
2008
}
 
2009
 
 
2010
/* %endif */
 
2011
 
 
2012
/** Get the current line number.
 
2013
 * @param yyscanner The scanner object.
 
2014
 */
 
2015
int execute_get_lineno  (yyscan_t yyscanner)
 
2016
{
 
2017
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
2018
    
 
2019
        if (! YY_CURRENT_BUFFER)
 
2020
            return 0;
 
2021
    
 
2022
    return yylineno;
 
2023
}
 
2024
 
 
2025
/** Get the current column number.
 
2026
 * @param yyscanner The scanner object.
 
2027
 */
 
2028
int execute_get_column  (yyscan_t yyscanner)
 
2029
{
 
2030
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
2031
    
 
2032
        if (! YY_CURRENT_BUFFER)
 
2033
            return 0;
 
2034
    
 
2035
    return yycolumn;
 
2036
}
 
2037
 
 
2038
/** Get the input stream.
 
2039
 * @param yyscanner The scanner object.
 
2040
 */
 
2041
FILE *execute_get_in  (yyscan_t yyscanner)
 
2042
{
 
2043
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
2044
    return yyin;
 
2045
}
 
2046
 
 
2047
/** Get the output stream.
 
2048
 * @param yyscanner The scanner object.
 
2049
 */
 
2050
FILE *execute_get_out  (yyscan_t yyscanner)
 
2051
{
 
2052
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
2053
    return yyout;
 
2054
}
 
2055
 
 
2056
/** Get the length of the current token.
 
2057
 * @param yyscanner The scanner object.
 
2058
 */
 
2059
int execute_get_leng  (yyscan_t yyscanner)
 
2060
{
 
2061
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
2062
    return yyleng;
 
2063
}
 
2064
 
 
2065
/** Get the current token.
 
2066
 * @param yyscanner The scanner object.
 
2067
 */
 
2068
 
 
2069
char *execute_get_text  (yyscan_t yyscanner)
 
2070
{
 
2071
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
2072
    return yytext;
 
2073
}
 
2074
 
 
2075
/* %if-reentrant */
 
2076
 
 
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.
 
2080
 */
 
2081
void execute_set_extra (YY_EXTRA_TYPE  user_defined , yyscan_t yyscanner)
 
2082
{
 
2083
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
2084
    yyextra = user_defined ;
 
2085
}
 
2086
 
 
2087
/* %endif */
 
2088
 
 
2089
/** Set the current line number.
 
2090
 * @param line_number
 
2091
 * @param yyscanner The scanner object.
 
2092
 */
 
2093
void execute_set_lineno (int  line_number , yyscan_t yyscanner)
 
2094
{
 
2095
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
2096
 
 
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); 
 
2100
    
 
2101
    yylineno = line_number;
 
2102
}
 
2103
 
 
2104
/** Set the current column.
 
2105
 * @param line_number
 
2106
 * @param yyscanner The scanner object.
 
2107
 */
 
2108
void execute_set_column (int  column_no , yyscan_t yyscanner)
 
2109
{
 
2110
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
2111
 
 
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); 
 
2115
    
 
2116
    yycolumn = column_no;
 
2117
}
 
2118
 
 
2119
/** Set the input stream. This does not discard the current
 
2120
 * input buffer.
 
2121
 * @param in_str A readable stream.
 
2122
 * @param yyscanner The scanner object.
 
2123
 * @see execute__switch_to_buffer
 
2124
 */
 
2125
void execute_set_in (FILE *  in_str , yyscan_t yyscanner)
 
2126
{
 
2127
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
2128
    yyin = in_str ;
 
2129
}
 
2130
 
 
2131
void execute_set_out (FILE *  out_str , yyscan_t yyscanner)
 
2132
{
 
2133
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
2134
    yyout = out_str ;
 
2135
}
 
2136
 
 
2137
int execute_get_debug  (yyscan_t yyscanner)
 
2138
{
 
2139
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
2140
    return yy_flex_debug;
 
2141
}
 
2142
 
 
2143
void execute_set_debug (int  bdebug , yyscan_t yyscanner)
 
2144
{
 
2145
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
2146
    yy_flex_debug = bdebug ;
 
2147
}
 
2148
 
 
2149
/* %endif */
 
2150
 
 
2151
/* %if-reentrant */
 
2152
/* Accessor methods for yylval and yylloc */
 
2153
 
 
2154
/* %if-bison-bridge */
 
2155
 
 
2156
YYSTYPE * execute_get_lval  (yyscan_t yyscanner)
 
2157
{
 
2158
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
2159
    return yylval;
 
2160
}
 
2161
 
 
2162
void execute_set_lval (YYSTYPE *  yylval_param , yyscan_t yyscanner)
 
2163
{
 
2164
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
2165
    yylval = yylval_param;
 
2166
}
 
2167
 
 
2168
/* %endif */
 
2169
 
 
2170
/* User-visible API */
 
2171
 
 
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.
 
2175
 */
 
2176
 
 
2177
int execute_lex_init(yyscan_t* ptr_yy_globals)
 
2178
 
 
2179
{
 
2180
    if (ptr_yy_globals == NULL){
 
2181
        errno = EINVAL;
 
2182
        return 1;
 
2183
    }
 
2184
 
 
2185
    *ptr_yy_globals = (yyscan_t) execute_alloc ( sizeof( struct yyguts_t ), NULL );
 
2186
 
 
2187
    if (*ptr_yy_globals == NULL){
 
2188
        errno = ENOMEM;
 
2189
        return 1;
 
2190
    }
 
2191
 
 
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));
 
2194
 
 
2195
    return yy_init_globals ( *ptr_yy_globals );
 
2196
}
 
2197
 
 
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.
 
2204
 */
 
2205
 
 
2206
int execute_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
 
2207
 
 
2208
{
 
2209
    struct yyguts_t dummy_yyguts;
 
2210
 
 
2211
    execute_set_extra (yy_user_defined, &dummy_yyguts);
 
2212
 
 
2213
    if (ptr_yy_globals == NULL){
 
2214
        errno = EINVAL;
 
2215
        return 1;
 
2216
    }
 
2217
        
 
2218
    *ptr_yy_globals = (yyscan_t) execute_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
 
2219
        
 
2220
    if (*ptr_yy_globals == NULL){
 
2221
        errno = ENOMEM;
 
2222
        return 1;
 
2223
    }
 
2224
    
 
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));
 
2228
    
 
2229
    execute_set_extra (yy_user_defined, *ptr_yy_globals);
 
2230
    
 
2231
    return yy_init_globals ( *ptr_yy_globals );
 
2232
}
 
2233
 
 
2234
/* %endif if-c-only */
 
2235
 
 
2236
/* %if-c-only */
 
2237
static int yy_init_globals (yyscan_t yyscanner)
 
2238
{
 
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.
 
2242
     */
 
2243
 
 
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;
 
2248
    yyg->yy_init = 0;
 
2249
    yyg->yy_start = 0;
 
2250
 
 
2251
    yyg->yy_start_stack_ptr = 0;
 
2252
    yyg->yy_start_stack_depth = 0;
 
2253
    yyg->yy_start_stack =  NULL;
 
2254
 
 
2255
/* Defined in main.c */
 
2256
#ifdef YY_STDINIT
 
2257
    yyin = stdin;
 
2258
    yyout = stdout;
 
2259
#else
 
2260
    yyin = (FILE *) 0;
 
2261
    yyout = (FILE *) 0;
 
2262
#endif
 
2263
 
 
2264
    /* For future reference: Set errno on error, since we are called by
 
2265
     * execute_lex_init()
 
2266
     */
 
2267
    return 0;
 
2268
}
 
2269
/* %endif */
 
2270
 
 
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)
 
2274
{
 
2275
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
2276
 
 
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);
 
2282
        }
 
2283
 
 
2284
        /* Destroy the stack itself. */
 
2285
        execute_free(yyg->yy_buffer_stack ,yyscanner);
 
2286
        yyg->yy_buffer_stack = NULL;
 
2287
 
 
2288
    /* Destroy the start condition stack. */
 
2289
        execute_free(yyg->yy_start_stack ,yyscanner );
 
2290
        yyg->yy_start_stack = NULL;
 
2291
 
 
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);
 
2295
 
 
2296
/* %if-reentrant */
 
2297
    /* Destroy the main struct (reentrant only). */
 
2298
    execute_free ( yyscanner , yyscanner );
 
2299
    yyscanner = NULL;
 
2300
/* %endif */
 
2301
    return 0;
 
2302
}
 
2303
/* %endif */
 
2304
 
 
2305
/*
 
2306
 * Internal utility routines.
 
2307
 */
 
2308
 
 
2309
#ifndef yytext_ptr
 
2310
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
 
2311
{
 
2312
        register int i;
 
2313
        for ( i = 0; i < n; ++i )
 
2314
                s1[i] = s2[i];
 
2315
}
 
2316
#endif
 
2317
 
 
2318
#ifdef YY_NEED_STRLEN
 
2319
static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
 
2320
{
 
2321
        register int n;
 
2322
        for ( n = 0; s[n]; ++n )
 
2323
                ;
 
2324
 
 
2325
        return n;
 
2326
}
 
2327
#endif
 
2328
 
 
2329
void *execute_alloc (yy_size_t  size , yyscan_t yyscanner)
 
2330
{
 
2331
        return (void *) malloc( size );
 
2332
}
 
2333
 
 
2334
void *execute_realloc  (void * ptr, yy_size_t  size , yyscan_t yyscanner)
 
2335
{
 
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.
 
2342
         */
 
2343
        return (void *) realloc( (char *) ptr, size );
 
2344
}
 
2345
 
 
2346
void execute_free (void * ptr , yyscan_t yyscanner)
 
2347
{
 
2348
        free( (char *) ptr );   /* see execute_realloc() for (char *) cast */
 
2349
}
 
2350
 
 
2351
/* %if-tables-serialization definitions */
 
2352
/* %define-yytables   The name for this specific scanner's tables. */
 
2353
#define YYTABLES_NAME "yytables"
 
2354
/* %endif */
 
2355
 
 
2356
/* %ok-for-header */
 
2357
 
 
2358
#line 137 "drizzled/execute/scanner.l"
 
2359
 
 
2360
 
 
2361
namespace drizzled {
 
2362
namespace execute {
 
2363
 
 
2364
void Context::init_scanner()
 
2365
{
 
2366
  execute_lex_init(&scanner);
 
2367
  execute_set_extra(this,scanner);
 
2368
}
 
2369
 
 
2370
void Context::destroy_scanner()
 
2371
{
 
2372
  execute_lex_destroy(scanner);
 
2373
}
 
2374
 
 
2375
} // namespace execute
 
2376
} // namespace drizzled
 
2377
 
 
2378