1
#line 2 "sqlscanner.cpp"
2
/* A lexical scanner generated by flex */
4
/* Scanner skeleton version:
9
#define YY_FLEX_MAJOR_VERSION 2
10
#define YY_FLEX_MINOR_VERSION 5
15
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
28
/* Use prototypes in function declarations. */
31
/* The "const" storage-class-modifier is valid. */
34
#else /* ! __cplusplus */
42
#endif /* ! __cplusplus */
61
#define YY_PROTO(proto) proto
63
#define YY_PROTO(proto) ()
66
/* Returned upon end-of-file. */
69
/* Promotes a possibly negative, possibly signed char to an unsigned
70
* integer for use as an array index. If the signed char is negative,
71
* we want to instead treat it as an 8-bit unsigned char, hence the
74
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
76
/* Enter a start condition. This macro really ought to take a parameter,
77
* but we do it the disgusting crufty way forced on us by the ()-less
78
* definition of BEGIN.
80
#define BEGIN yy_start = 1 + 2 *
82
/* Translate the current start state into a value that can be later handed
83
* to BEGIN to return to the state. The YYSTATE alias is for lex
86
#define YY_START ((yy_start - 1) / 2)
87
#define YYSTATE YY_START
89
/* Action number for EOF rule of a given start state. */
90
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
92
/* Special action meaning "start processing a new file". */
93
#define YY_NEW_FILE yyrestart( yyin )
95
#define YY_END_OF_BUFFER_CHAR 0
97
/* Size of default input buffer. */
98
#define YY_BUF_SIZE 16384
100
typedef struct yy_buffer_state *YY_BUFFER_STATE;
103
extern FILE *yyin, *yyout;
105
#define EOB_ACT_CONTINUE_SCAN 0
106
#define EOB_ACT_END_OF_FILE 1
107
#define EOB_ACT_LAST_MATCH 2
109
/* The funky do-while in the following #define is used to turn the definition
110
* int a single C statement (which needs a semi-colon terminator). This
111
* avoids problems with code like:
113
* if ( condition_holds )
116
* do_something_else();
118
* Prior to using the do-while the compiler would get upset at the
119
* "else" because it interpreted the "if" statement as being all
120
* done when it reached the ';' after the yyless() call.
123
/* Return all but the first 'n' matched characters back to the input stream. */
128
/* Undo effects of setting up yytext. */ \
129
*yy_cp = yy_hold_char; \
130
YY_RESTORE_YY_MORE_OFFSET \
131
yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
132
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
136
#define unput(c) yyunput( c, yytext_ptr )
138
/* The following is because we cannot portably get our hands on size_t
139
* (without autoconf's help, which isn't available because we want
140
* flex-generated scanners to compile on their own).
142
typedef unsigned int yy_size_t;
145
struct yy_buffer_state
149
char *yy_ch_buf; /* input buffer */
150
char *yy_buf_pos; /* current position in input buffer */
152
/* Size of input buffer in bytes, not including room for EOB
155
yy_size_t yy_buf_size;
157
/* Number of characters read into yy_ch_buf, not including EOB
162
/* Whether we "own" the buffer - i.e., we know we created it,
163
* and can realloc() it to grow it, and should free() it to
166
int yy_is_our_buffer;
168
/* Whether this is an "interactive" input source; if so, and
169
* if we're using stdio for input, then we want to use getc()
170
* instead of fread(), to make sure we stop fetching input after
173
int yy_is_interactive;
175
/* Whether we're considered to be at the beginning of a line.
176
* If so, '^' rules will be active on the next match, otherwise
181
/* Whether to try to fill the input buffer when we reach the
186
int yy_buffer_status;
187
#define YY_BUFFER_NEW 0
188
#define YY_BUFFER_NORMAL 1
189
/* When an EOF's been seen but there's still some text to process
190
* then we mark the buffer as YY_EOF_PENDING, to indicate that we
191
* shouldn't try reading from the input source any more. We might
192
* still have a bunch of tokens to match, though, because of
193
* possible backing-up.
195
* When we actually see the EOF, we change the status to "new"
196
* (via yyrestart()), so that the user can continue scanning by
197
* just pointing yyin at a new input file.
199
#define YY_BUFFER_EOF_PENDING 2
202
static YY_BUFFER_STATE yy_current_buffer = 0;
204
/* We provide macros for accessing buffer states in case in the
205
* future we want to put the buffer states in a more general
208
#define YY_CURRENT_BUFFER yy_current_buffer
211
/* yy_hold_char holds the character lost when yytext is formed. */
212
static char yy_hold_char;
214
static int yy_n_chars; /* number of characters read into yy_ch_buf */
219
/* Points to current character in buffer. */
220
static char *yy_c_buf_p = (char *) 0;
221
static int yy_init = 1; /* whether we need to initialize */
222
static int yy_start = 0; /* start state number */
224
/* Flag which is used to allow yywrap()'s to do buffer switches
225
* instead of setting up a fresh yyin. A bit of a hack ...
227
static int yy_did_buffer_switch_on_eof;
229
void yyrestart YY_PROTO(( FILE *input_file ));
231
void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
232
void yy_load_buffer_state YY_PROTO(( void ));
233
YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
234
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
235
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
236
void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
237
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
239
YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
240
YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
241
YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
243
static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
244
static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
245
static void yy_flex_free YY_PROTO(( void * ));
247
#define yy_new_buffer yy_create_buffer
249
#define yy_set_interactive(is_interactive) \
251
if ( ! yy_current_buffer ) \
252
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
253
yy_current_buffer->yy_is_interactive = is_interactive; \
256
#define yy_set_bol(at_bol) \
258
if ( ! yy_current_buffer ) \
259
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
260
yy_current_buffer->yy_at_bol = at_bol; \
263
#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
267
#define YY_SKIP_YYWRAP
268
typedef unsigned char YY_CHAR;
269
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
270
typedef int yy_state_type;
272
#define yytext_ptr yytext
274
static yy_state_type yy_get_previous_state YY_PROTO(( void ));
275
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
276
static int yy_get_next_buffer YY_PROTO(( void ));
277
static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
279
/* Done after the current pattern has been matched and before the
280
* corresponding action - sets up yytext.
282
#define YY_DO_BEFORE_ACTION \
283
yytext_ptr = yy_bp; \
284
yyleng = (int) (yy_cp - yy_bp); \
285
yy_hold_char = *yy_cp; \
289
#define YY_NUM_RULES 39
290
#define YY_END_OF_BUFFER 40
291
static yyconst short int yy_accept[136] =
293
0, 0, 40, 39, 37, 38, 39, 38, 38, 39,
294
38, 7, 38, 38, 38, 35, 35, 35, 35, 35,
295
35, 35, 35, 35, 35, 35, 35, 35, 35, 38,
296
37, 2, 0, 9, 0, 34, 8, 8, 7, 35,
297
27, 4, 1, 3, 5, 28, 35, 10, 35, 35,
298
6, 22, 35, 35, 35, 35, 35, 24, 25, 35,
299
35, 35, 35, 35, 35, 26, 36, 8, 9, 35,
300
35, 35, 0, 35, 35, 35, 21, 35, 35, 35,
301
35, 35, 35, 29, 35, 12, 35, 0, 14, 15,
302
16, 0, 23, 35, 35, 35, 35, 35, 35, 35,
304
0, 0, 0, 30, 35, 35, 32, 33, 11, 35,
305
0, 0, 0, 31, 35, 13, 0, 20, 0, 35,
306
0, 0, 0, 0, 0, 0, 0, 0, 18, 19,
310
static yyconst int yy_ec[256] =
312
1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
313
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
314
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
315
1, 2, 3, 4, 5, 1, 5, 6, 7, 5,
316
5, 5, 5, 5, 5, 8, 5, 9, 9, 9,
317
9, 9, 9, 9, 9, 9, 9, 5, 5, 10,
318
11, 12, 5, 5, 14, 15, 16, 17, 18, 19,
319
20, 21, 22, 23, 24, 25, 26, 27, 28, 13,
320
13, 29, 30, 31, 32, 13, 33, 34, 13, 13,
321
5, 1, 5, 5, 13, 5, 14, 15, 16, 17,
323
18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
324
28, 13, 13, 29, 30, 31, 32, 13, 33, 34,
325
13, 13, 1, 35, 1, 5, 1, 1, 1, 1,
326
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
327
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
328
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
329
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
330
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
331
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
332
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
334
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
335
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
336
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
337
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
338
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
342
static yyconst int yy_meta[36] =
344
1, 1, 1, 1, 1, 1, 1, 2, 3, 1,
345
1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
346
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
350
static yyconst short int yy_base[139] =
352
0, 0, 228, 229, 225, 215, 0, 229, 219, 217,
353
214, 28, 28, 211, 30, 213, 35, 37, 38, 41,
354
36, 39, 42, 46, 47, 64, 44, 55, 51, 185,
355
217, 229, 214, 229, 210, 229, 207, 206, 69, 206,
356
229, 229, 229, 229, 229, 229, 43, 205, 72, 73,
357
75, 83, 76, 80, 79, 81, 84, 204, 203, 85,
358
86, 87, 89, 92, 88, 229, 229, 201, 201, 94,
359
99, 106, 113, 108, 110, 111, 118, 113, 115, 114,
360
120, 119, 122, 200, 123, 199, 125, 111, 198, 197,
361
196, 132, 195, 129, 40, 138, 139, 140, 141, 147,
363
165, 170, 172, 185, 142, 153, 184, 183, 182, 145,
364
186, 162, 160, 177, 148, 176, 162, 229, 161, 164,
365
150, 155, 150, 154, 164, 148, 150, 142, 229, 229,
366
168, 166, 141, 229, 229, 50, 197, 199
369
static yyconst short int yy_def[139] =
371
135, 1, 135, 135, 135, 135, 136, 135, 135, 137,
372
135, 138, 135, 135, 135, 138, 138, 138, 138, 138,
373
138, 138, 138, 138, 138, 138, 138, 138, 138, 135,
374
135, 135, 136, 135, 137, 135, 135, 135, 138, 138,
375
135, 135, 135, 135, 135, 135, 138, 138, 138, 138,
376
138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
377
138, 138, 138, 138, 138, 135, 135, 135, 138, 138,
378
138, 138, 135, 138, 138, 138, 138, 138, 138, 138,
379
138, 138, 138, 138, 138, 138, 138, 135, 138, 138,
380
138, 135, 138, 138, 138, 138, 138, 138, 138, 138,
382
135, 135, 135, 138, 138, 138, 138, 138, 138, 138,
383
135, 135, 135, 138, 138, 138, 135, 135, 135, 138,
384
135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
385
135, 135, 135, 135, 0, 135, 135, 135
388
static yyconst short int yy_nxt[265] =
390
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
391
14, 15, 16, 17, 16, 18, 16, 16, 19, 16,
392
16, 20, 21, 16, 22, 16, 23, 24, 25, 26,
393
27, 16, 28, 29, 30, 38, 39, 41, 42, 43,
394
45, 46, 135, 135, 135, 135, 135, 135, 135, 135,
395
135, 135, 33, 135, 135, 105, 54, 63, 135, 69,
396
55, 47, 135, 53, 48, 49, 50, 51, 60, 56,
397
52, 135, 58, 57, 59, 64, 38, 39, 65, 135,
398
135, 61, 135, 135, 73, 62, 135, 135, 135, 70,
399
135, 135, 135, 135, 135, 135, 135, 74, 75, 135,
401
71, 135, 76, 82, 79, 72, 135, 85, 78, 83,
402
80, 77, 81, 135, 73, 135, 84, 135, 135, 92,
403
135, 135, 135, 87, 86, 135, 135, 135, 91, 135,
404
135, 95, 135, 92, 89, 94, 135, 93, 101, 88,
405
90, 96, 102, 97, 100, 135, 135, 135, 135, 135,
406
98, 123, 135, 99, 135, 135, 107, 108, 109, 104,
407
135, 103, 106, 117, 110, 123, 115, 132, 134, 132,
408
131, 135, 114, 116, 130, 129, 120, 128, 127, 125,
409
126, 124, 122, 135, 135, 119, 118, 117, 121, 135,
410
135, 135, 135, 113, 112, 111, 133, 35, 35, 35,
412
40, 40, 135, 135, 135, 135, 135, 135, 135, 68,
413
135, 135, 135, 135, 68, 37, 36, 67, 31, 66,
414
135, 44, 37, 36, 34, 32, 31, 135, 3, 135,
415
135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
416
135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
417
135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
421
static yyconst short int yy_chk[265] =
423
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
424
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
425
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
426
1, 1, 1, 1, 1, 12, 12, 13, 13, 13,
427
15, 15, 17, 21, 18, 19, 22, 95, 20, 23,
428
47, 27, 136, 24, 25, 95, 22, 27, 29, 47,
429
22, 17, 28, 21, 17, 18, 19, 20, 25, 23,
430
20, 26, 24, 23, 24, 28, 39, 39, 29, 49,
431
50, 26, 51, 53, 52, 26, 55, 54, 56, 49,
432
52, 57, 60, 61, 62, 65, 63, 53, 54, 64,
434
50, 70, 55, 63, 60, 51, 71, 70, 57, 64,
435
61, 56, 62, 72, 73, 74, 65, 75, 76, 77,
436
78, 80, 79, 72, 71, 77, 82, 81, 76, 83,
437
85, 80, 87, 92, 74, 79, 94, 78, 88, 73,
438
75, 81, 88, 82, 87, 96, 97, 98, 99, 105,
439
83, 123, 110, 85, 100, 115, 97, 98, 99, 94,
440
106, 92, 96, 117, 100, 120, 106, 132, 133, 131,
441
128, 120, 105, 110, 127, 126, 115, 125, 124, 122,
442
123, 121, 119, 116, 114, 113, 112, 111, 117, 109,
443
108, 107, 104, 103, 102, 101, 132, 137, 137, 137,
445
138, 138, 93, 91, 90, 89, 86, 84, 69, 68,
446
59, 58, 48, 40, 38, 37, 35, 33, 31, 30,
447
16, 14, 11, 10, 9, 6, 5, 3, 135, 135,
448
135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
449
135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
450
135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
454
static yy_state_type yy_last_accepting_state;
455
static char *yy_last_accepting_cpos;
457
/* The intent behind this definition is that it'll catch
458
* any uses of REJECT which flex missed.
460
#define REJECT reject_used_but_not_detected
461
#define yymore() yymore_used_but_not_detected
462
#define YY_MORE_ADJ 0
463
#define YY_RESTORE_YY_MORE_OFFSET
465
#line 1 "sqlscanner.l"
467
/* This file is part of the KDE project
468
Copyright (C) 2004 Lucijan Busch <lucijan@kde.org>
469
Copyright (C) 2004 Jaroslaw Staniek <js@iidea.pl>
471
This library is free software; you can redistribute it and/or
472
modify it under the terms of the GNU Library General Public
473
License as published by the Free Software Foundation; either
474
version 2 of the License, or (at your option) any later version.
476
This library is distributed in the hope that it will be useful,
477
but WITHOUT ANY WARRANTY; without even the implied warranty of
478
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
479
Library General Public License for more details.
481
You should have received a copy of the GNU Library General Public License
482
along with this library; see the file COPYING.LIB. If not, write to
483
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
484
Boston, MA 02111-1307, USA.
486
#line 22 "sqlscanner.l"
488
#include <expression.h>
490
#include "sqlparser.h"
491
#include "sqltypes.h"
497
#define ECOUNT current += yyleng; ctoken = yytext
499
extern void setError(const QString& errDesc);
500
extern void setError(const QString& errName, const QString& errDesc);
502
/* *** Please reflect changes to this file in ../driver_p.cpp *** */
503
#define YY_NEVER_INTERACTIVE 1
504
/*identifier [a-zA-Z_][a-zA-Z_0-9]* */
505
/* todo: support for real numbers */
506
#line 507 "sqlscanner.cpp"
508
/* Macros after this point can all be overridden by user definitions in
512
#ifndef YY_SKIP_YYWRAP
514
extern "C" int yywrap YY_PROTO(( void ));
516
extern int yywrap YY_PROTO(( void ));
521
static void yyunput YY_PROTO(( int c, char *buf_ptr ));
525
static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
528
#ifdef YY_NEED_STRLEN
529
static int yy_flex_strlen YY_PROTO(( yyconst char * ));
534
static int yyinput YY_PROTO(( void ));
536
static int input YY_PROTO(( void ));
541
static int yy_start_stack_ptr = 0;
542
static int yy_start_stack_depth = 0;
543
static int *yy_start_stack = 0;
544
#ifndef YY_NO_PUSH_STATE
545
static void yy_push_state YY_PROTO(( int new_state ));
547
#ifndef YY_NO_POP_STATE
548
static void yy_pop_state YY_PROTO(( void ));
550
#ifndef YY_NO_TOP_STATE
551
static int yy_top_state YY_PROTO(( void ));
555
#define YY_NO_PUSH_STATE 1
556
#define YY_NO_POP_STATE 1
557
#define YY_NO_TOP_STATE 1
560
#ifdef YY_MALLOC_DECL
568
/* Just try to get by without declaring the routines. This will fail
569
* miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
570
* or sizeof(void*) != sizeof(int).
575
/* Amount of stuff to slurp up with each read. */
576
#ifndef YY_READ_BUF_SIZE
577
#define YY_READ_BUF_SIZE 8192
580
/* Copy whatever the last rule matched to the standard output. */
583
/* This used to be an fputs(), but since the string might contain NUL's,
584
* we now use fwrite().
586
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
589
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
590
* is returned in "result".
593
#define YY_INPUT(buf,result,max_size) \
594
if ( yy_current_buffer->yy_is_interactive ) \
597
for ( n = 0; n < max_size && \
598
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
601
buf[n++] = (char) c; \
602
if ( c == EOF && ferror( yyin ) ) \
603
YY_FATAL_ERROR( "input in flex scanner failed" ); \
606
else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
607
&& ferror( yyin ) ) \
608
YY_FATAL_ERROR( "input in flex scanner failed" );
611
/* No semi-colon after return; correct usage is to write "yyterminate();" -
612
* we don't want an extra ';' after the "return" because that will cause
613
* some compilers to complain about unreachable statements.
616
#define yyterminate() return YY_NULL
619
/* Number of entries by which start-condition stack grows. */
620
#ifndef YY_START_STACK_INCR
621
#define YY_START_STACK_INCR 25
624
/* Report a fatal error. */
625
#ifndef YY_FATAL_ERROR
626
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
629
/* Default declaration of generated scanner - a define so the user can
630
* easily add parameters.
633
#define YY_DECL int yylex YY_PROTO(( void ))
636
/* Code executed at the beginning of each rule, after yytext and yyleng
639
#ifndef YY_USER_ACTION
640
#define YY_USER_ACTION
643
/* Code executed at the end of each rule. */
645
#define YY_BREAK break;
648
#define YY_RULE_SETUP \
653
register yy_state_type yy_current_state;
654
register char *yy_cp, *yy_bp;
657
#line 57 "sqlscanner.l"
661
#line 662 "sqlscanner.cpp"
672
yy_start = 1; /* first start state */
680
if ( ! yy_current_buffer )
682
yy_create_buffer( yyin, YY_BUF_SIZE );
684
yy_load_buffer_state();
687
while ( 1 ) /* loops until end-of-file is reached */
691
/* Support of yytext. */
692
*yy_cp = yy_hold_char;
694
/* yy_bp points to the position in yy_ch_buf of the start of
699
yy_current_state = yy_start;
703
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
704
if ( yy_accept[yy_current_state] )
706
yy_last_accepting_state = yy_current_state;
707
yy_last_accepting_cpos = yy_cp;
709
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
711
yy_current_state = (int) yy_def[yy_current_state];
712
if ( yy_current_state >= 136 )
713
yy_c = yy_meta[(unsigned int) yy_c];
715
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
718
while ( yy_base[yy_current_state] != 229 );
721
yy_act = yy_accept[yy_current_state];
723
{ /* have to back up */
724
yy_cp = yy_last_accepting_cpos;
725
yy_current_state = yy_last_accepting_state;
726
yy_act = yy_accept[yy_current_state];
732
do_action: /* This label is used only to access EOF actions. */
736
{ /* beginning of action switch */
737
case 0: /* must back up */
738
/* undo the effects of YY_DO_BEFORE_ACTION */
739
*yy_cp = yy_hold_char;
740
yy_cp = yy_last_accepting_cpos;
741
yy_current_state = yy_last_accepting_state;
746
#line 60 "sqlscanner.l"
754
#line 65 "sqlscanner.l"
762
#line 70 "sqlscanner.l"
770
#line 75 "sqlscanner.l"
773
return LESS_OR_EQUAL;
778
#line 80 "sqlscanner.l"
781
return GREATER_OR_EQUAL;
786
#line 85 "sqlscanner.l"
794
#line 90 "sqlscanner.l"
796
//TODO: what about hex or octal values?
797
//we're using QString:toLongLong() here because atoll() is not so portable:
800
yylval.integerValue = QString(yytext).toLongLong( &ok );
802
setError(i18n("Invalid integer number"),i18n("This integer number may be too large."));
805
// yylval.integerValue = atol(yytext);
806
return INTEGER_CONST;
811
#line 104 "sqlscanner.l"
814
if (yytext[0]=='.') { /* no integer part */
815
yylval.realValue.integer = 0;
818
yylval.realValue.integer = atoi(p);
820
while (p && i < yyleng && *p != '.') {
824
if (i==0 || !p || *p!='.') {
825
yylval.realValue.fractional = 0;
829
/* fractional part */
831
yylval.realValue.fractional = atoi(p);
837
#line 127 "sqlscanner.l"
845
#line 132 "sqlscanner.l"
853
#line 137 "sqlscanner.l"
861
#line 142 "sqlscanner.l"
869
#line 147 "sqlscanner.l"
877
#line 152 "sqlscanner.l"
885
#line 157 "sqlscanner.l"
893
#line 162 "sqlscanner.l"
901
#line 167 "sqlscanner.l"
904
return NOT_SIMILAR_TO;
909
#line 172 "sqlscanner.l"
917
#line 177 "sqlscanner.l"
920
return SQL_IS_NOT_NULL;
925
#line 182 "sqlscanner.l"
933
#line 187 "sqlscanner.l"
941
#line 192 "sqlscanner.l"
949
#line 197 "sqlscanner.l"
957
#line 202 "sqlscanner.l"
965
#line 207 "sqlscanner.l"
973
#line 212 "sqlscanner.l"
974
{ /* also means OR for numbers (mysql) */
976
return CONCATENATION;
981
#line 217 "sqlscanner.l"
984
return BITWISE_SHIFT_LEFT;
989
#line 222 "sqlscanner.l"
992
return BITWISE_SHIFT_RIGHT;
997
#line 227 "sqlscanner.l"
1005
#line 232 "sqlscanner.l"
1013
#line 237 "sqlscanner.l"
1021
#line 242 "sqlscanner.l"
1029
#line 247 "sqlscanner.l"
1037
#line 253 "sqlscanner.l"
1040
strncpy(yylval.stringValue, yytext, yyleng + 1);
1041
return CHARACTER_STRING_LITERAL;
1043
/* "ZZZ" sentinel for script */
1048
#line 261 "sqlscanner.l"
1050
kdDebug() << "yytext: '" << yytext << "' (" << yyleng << ")" << endl;
1052
strncpy(yylval.stringValue, yytext, yyleng + 1);
1053
if (yytext[0]>='0' && yytext[0]<='9') {
1054
setError(i18n("Invalid identifier"),
1055
i18n("Identifiers should start with a letter or '_' character"));
1057
// return ERROR_DIGIT_BEFORE_IDENTIFIER;
1064
#line 274 "sqlscanner.l"
1066
kdDebug() << "yytext: '" << yytext << "' (" << yyleng << ")" << endl;
1068
strncpy(yylval.stringValue, yytext + 1, yyleng - 1);
1069
yylval.stringValue[yyleng - 2] = 0x00;
1070
if (yytext[1]>='0' && yytext[1]<='9') {
1071
setError(i18n("Invalid identifier"),
1072
i18n("Identifiers should start with a letter or '_' character"));
1074
// return ERROR_DIGIT_BEFORE_IDENTIFIER;
1081
#line 288 "sqlscanner.l"
1088
#line 292 "sqlscanner.l"
1090
kdDebug() << "char: '" << yytext[0] << "'" << endl;
1097
#line 298 "sqlscanner.l"
1100
#line 1101 "sqlscanner.cpp"
1101
case YY_STATE_EOF(INITIAL):
1104
case YY_END_OF_BUFFER:
1106
/* Amount of text matched not including the EOB char. */
1107
int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1109
/* Undo the effects of YY_DO_BEFORE_ACTION. */
1110
*yy_cp = yy_hold_char;
1111
YY_RESTORE_YY_MORE_OFFSET
1113
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1115
/* We're scanning a new file or input source. It's
1116
* possible that this happened because the user
1117
* just pointed yyin at a new source and called
1118
* yylex(). If so, then we have to assure
1119
* consistency between yy_current_buffer and our
1120
* globals. Here is the right place to do so, because
1121
* this is the first action (other than possibly a
1122
* back-up) that will match for the new input source.
1124
yy_n_chars = yy_current_buffer->yy_n_chars;
1125
yy_current_buffer->yy_input_file = yyin;
1126
yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1129
/* Note that here we test for yy_c_buf_p "<=" to the position
1130
* of the first EOB in the buffer, since yy_c_buf_p will
1131
* already have been incremented past the NUL character
1132
* (since all states make transitions on EOB to the
1133
* end-of-buffer state). Contrast this with the test
1136
if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1137
{ /* This was really a NUL. */
1138
yy_state_type yy_next_state;
1140
yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1142
yy_current_state = yy_get_previous_state();
1144
/* Okay, we're now positioned to make the NUL
1145
* transition. We couldn't have
1146
* yy_get_previous_state() go ahead and do it
1147
* for us because it doesn't know how to deal
1148
* with the possibility of jamming (and we don't
1149
* want to build jamming into it because then it
1150
* will run more slowly).
1153
yy_next_state = yy_try_NUL_trans( yy_current_state );
1155
yy_bp = yytext_ptr + YY_MORE_ADJ;
1157
if ( yy_next_state )
1159
/* Consume the NUL. */
1160
yy_cp = ++yy_c_buf_p;
1161
yy_current_state = yy_next_state;
1168
goto yy_find_action;
1172
else switch ( yy_get_next_buffer() )
1174
case EOB_ACT_END_OF_FILE:
1176
yy_did_buffer_switch_on_eof = 0;
1180
/* Note: because we've taken care in
1181
* yy_get_next_buffer() to have set up
1182
* yytext, we can now set up
1183
* yy_c_buf_p so that if some total
1184
* hoser (like flex itself) wants to
1185
* call the scanner after we return the
1186
* YY_NULL, it'll still work - another
1187
* YY_NULL will get returned.
1189
yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1191
yy_act = YY_STATE_EOF(YY_START);
1197
if ( ! yy_did_buffer_switch_on_eof )
1203
case EOB_ACT_CONTINUE_SCAN:
1205
yytext_ptr + yy_amount_of_matched_text;
1207
yy_current_state = yy_get_previous_state();
1210
yy_bp = yytext_ptr + YY_MORE_ADJ;
1213
case EOB_ACT_LAST_MATCH:
1215
&yy_current_buffer->yy_ch_buf[yy_n_chars];
1217
yy_current_state = yy_get_previous_state();
1220
yy_bp = yytext_ptr + YY_MORE_ADJ;
1221
goto yy_find_action;
1228
"fatal flex scanner internal error--no action found" );
1229
} /* end of action switch */
1230
} /* end of scanning one token */
1231
} /* end of yylex */
1234
/* yy_get_next_buffer - try to read in a new buffer
1236
* Returns a code representing an action:
1237
* EOB_ACT_LAST_MATCH -
1238
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1239
* EOB_ACT_END_OF_FILE - end of file
1242
static int yy_get_next_buffer()
1244
register char *dest = yy_current_buffer->yy_ch_buf;
1245
register char *source = yytext_ptr;
1246
register int number_to_move, i;
1249
if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1251
"fatal flex scanner internal error--end of buffer missed" );
1253
if ( yy_current_buffer->yy_fill_buffer == 0 )
1254
{ /* Don't try to fill the buffer, so this is an EOF. */
1255
if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1257
/* We matched a single character, the EOB, so
1258
* treat this as a final EOF.
1260
return EOB_ACT_END_OF_FILE;
1265
/* We matched some text prior to the EOB, first
1268
return EOB_ACT_LAST_MATCH;
1272
/* Try to read more data. */
1274
/* First move last chars to start of buffer. */
1275
number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1277
for ( i = 0; i < number_to_move; ++i )
1278
*(dest++) = *(source++);
1280
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1281
/* don't do the read, it's not guaranteed to return an EOF,
1284
yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1289
yy_current_buffer->yy_buf_size - number_to_move - 1;
1291
while ( num_to_read <= 0 )
1292
{ /* Not enough room in the buffer - grow it. */
1293
#ifdef YY_USES_REJECT
1295
"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1298
/* just a shorter name for the current buffer */
1299
YY_BUFFER_STATE b = yy_current_buffer;
1301
int yy_c_buf_p_offset =
1302
(int) (yy_c_buf_p - b->yy_ch_buf);
1304
if ( b->yy_is_our_buffer )
1306
int new_size = b->yy_buf_size * 2;
1308
if ( new_size <= 0 )
1309
b->yy_buf_size += b->yy_buf_size / 8;
1311
b->yy_buf_size *= 2;
1313
b->yy_ch_buf = (char *)
1314
/* Include room in for 2 EOB chars. */
1315
yy_flex_realloc( (void *) b->yy_ch_buf,
1316
b->yy_buf_size + 2 );
1319
/* Can't grow it, we don't own it. */
1322
if ( ! b->yy_ch_buf )
1324
"fatal error - scanner input buffer overflow" );
1326
yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1328
num_to_read = yy_current_buffer->yy_buf_size -
1333
if ( num_to_read > YY_READ_BUF_SIZE )
1334
num_to_read = YY_READ_BUF_SIZE;
1336
/* Read in more data. */
1337
YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1338
yy_n_chars, num_to_read );
1340
yy_current_buffer->yy_n_chars = yy_n_chars;
1343
if ( yy_n_chars == 0 )
1345
if ( number_to_move == YY_MORE_ADJ )
1347
ret_val = EOB_ACT_END_OF_FILE;
1353
ret_val = EOB_ACT_LAST_MATCH;
1354
yy_current_buffer->yy_buffer_status =
1355
YY_BUFFER_EOF_PENDING;
1360
ret_val = EOB_ACT_CONTINUE_SCAN;
1362
yy_n_chars += number_to_move;
1363
yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1364
yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1366
yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1372
/* yy_get_previous_state - get the state just before the EOB char was reached */
1374
static yy_state_type yy_get_previous_state()
1376
register yy_state_type yy_current_state;
1377
register char *yy_cp;
1379
yy_current_state = yy_start;
1381
for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1383
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1384
if ( yy_accept[yy_current_state] )
1386
yy_last_accepting_state = yy_current_state;
1387
yy_last_accepting_cpos = yy_cp;
1389
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1391
yy_current_state = (int) yy_def[yy_current_state];
1392
if ( yy_current_state >= 136 )
1393
yy_c = yy_meta[(unsigned int) yy_c];
1395
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1398
return yy_current_state;
1402
/* yy_try_NUL_trans - try to make a transition on the NUL character
1405
* next_state = yy_try_NUL_trans( current_state );
1408
#ifdef YY_USE_PROTOS
1409
static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1411
static yy_state_type yy_try_NUL_trans( yy_current_state )
1412
yy_state_type yy_current_state;
1415
register int yy_is_jam;
1416
register char *yy_cp = yy_c_buf_p;
1418
register YY_CHAR yy_c = 1;
1419
if ( yy_accept[yy_current_state] )
1421
yy_last_accepting_state = yy_current_state;
1422
yy_last_accepting_cpos = yy_cp;
1424
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1426
yy_current_state = (int) yy_def[yy_current_state];
1427
if ( yy_current_state >= 136 )
1428
yy_c = yy_meta[(unsigned int) yy_c];
1430
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1431
yy_is_jam = (yy_current_state == 135);
1433
return yy_is_jam ? 0 : yy_current_state;
1438
#ifdef YY_USE_PROTOS
1439
static void yyunput( int c, register char *yy_bp )
1441
static void yyunput( c, yy_bp )
1443
register char *yy_bp;
1446
register char *yy_cp = yy_c_buf_p;
1448
/* undo effects of setting up yytext */
1449
*yy_cp = yy_hold_char;
1451
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1452
{ /* need to shift things up to make room */
1453
/* +2 for EOB chars. */
1454
register int number_to_move = yy_n_chars + 2;
1455
register char *dest = &yy_current_buffer->yy_ch_buf[
1456
yy_current_buffer->yy_buf_size + 2];
1457
register char *source =
1458
&yy_current_buffer->yy_ch_buf[number_to_move];
1460
while ( source > yy_current_buffer->yy_ch_buf )
1461
*--dest = *--source;
1463
yy_cp += (int) (dest - source);
1464
yy_bp += (int) (dest - source);
1465
yy_current_buffer->yy_n_chars =
1466
yy_n_chars = yy_current_buffer->yy_buf_size;
1468
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1469
YY_FATAL_ERROR( "flex scanner push-back overflow" );
1472
*--yy_cp = (char) c;
1476
yy_hold_char = *yy_cp;
1479
#endif /* ifndef YY_NO_UNPUT */
1483
static int yyinput()
1490
*yy_c_buf_p = yy_hold_char;
1492
if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1494
/* yy_c_buf_p now points to the character we want to return.
1495
* If this occurs *before* the EOB characters, then it's a
1496
* valid NUL; if not, then we've hit the end of the buffer.
1498
if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1499
/* This was really a NUL. */
1503
{ /* need more input */
1504
int offset = yy_c_buf_p - yytext_ptr;
1507
switch ( yy_get_next_buffer() )
1509
case EOB_ACT_LAST_MATCH:
1510
/* This happens because yy_g_n_b()
1511
* sees that we've accumulated a
1512
* token and flags that we need to
1513
* try matching the token before
1514
* proceeding. But for input(),
1515
* there's no matching to consider.
1516
* So convert the EOB_ACT_LAST_MATCH
1517
* to EOB_ACT_END_OF_FILE.
1520
/* Reset buffer status. */
1525
case EOB_ACT_END_OF_FILE:
1530
if ( ! yy_did_buffer_switch_on_eof )
1539
case EOB_ACT_CONTINUE_SCAN:
1540
yy_c_buf_p = yytext_ptr + offset;
1546
c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1547
*yy_c_buf_p = '\0'; /* preserve yytext */
1548
yy_hold_char = *++yy_c_buf_p;
1555
#ifdef YY_USE_PROTOS
1556
void yyrestart( FILE *input_file )
1558
void yyrestart( input_file )
1562
if ( ! yy_current_buffer )
1563
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1565
yy_init_buffer( yy_current_buffer, input_file );
1566
yy_load_buffer_state();
1570
#ifdef YY_USE_PROTOS
1571
void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1573
void yy_switch_to_buffer( new_buffer )
1574
YY_BUFFER_STATE new_buffer;
1577
if ( yy_current_buffer == new_buffer )
1580
if ( yy_current_buffer )
1582
/* Flush out information for old buffer. */
1583
*yy_c_buf_p = yy_hold_char;
1584
yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1585
yy_current_buffer->yy_n_chars = yy_n_chars;
1588
yy_current_buffer = new_buffer;
1589
yy_load_buffer_state();
1591
/* We don't actually know whether we did this switch during
1592
* EOF (yywrap()) processing, but the only time this flag
1593
* is looked at is after yywrap() is called, so it's safe
1594
* to go ahead and always set it.
1596
yy_did_buffer_switch_on_eof = 1;
1600
#ifdef YY_USE_PROTOS
1601
void yy_load_buffer_state( void )
1603
void yy_load_buffer_state()
1606
yy_n_chars = yy_current_buffer->yy_n_chars;
1607
yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1608
yyin = yy_current_buffer->yy_input_file;
1609
yy_hold_char = *yy_c_buf_p;
1613
#ifdef YY_USE_PROTOS
1614
YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1616
YY_BUFFER_STATE yy_create_buffer( file, size )
1623
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1625
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1627
b->yy_buf_size = size;
1629
/* yy_ch_buf has to be 2 characters longer than the size given because
1630
* we need to put in 2 end-of-buffer characters.
1632
b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1633
if ( ! b->yy_ch_buf )
1634
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1636
b->yy_is_our_buffer = 1;
1638
yy_init_buffer( b, file );
1644
#ifdef YY_USE_PROTOS
1645
void yy_delete_buffer( YY_BUFFER_STATE b )
1647
void yy_delete_buffer( b )
1654
if ( b == yy_current_buffer )
1655
yy_current_buffer = (YY_BUFFER_STATE) 0;
1657
if ( b->yy_is_our_buffer )
1658
yy_flex_free( (void *) b->yy_ch_buf );
1660
yy_flex_free( (void *) b );
1664
#ifndef YY_ALWAYS_INTERACTIVE
1665
#ifndef YY_NEVER_INTERACTIVE
1666
extern int isatty YY_PROTO(( int ));
1670
#ifdef YY_USE_PROTOS
1671
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1673
void yy_init_buffer( b, file )
1680
yy_flush_buffer( b );
1682
b->yy_input_file = file;
1683
b->yy_fill_buffer = 1;
1685
#if YY_ALWAYS_INTERACTIVE
1686
b->yy_is_interactive = 1;
1688
#if YY_NEVER_INTERACTIVE
1689
b->yy_is_interactive = 0;
1691
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1697
#ifdef YY_USE_PROTOS
1698
void yy_flush_buffer( YY_BUFFER_STATE b )
1700
void yy_flush_buffer( b )
1710
/* We always need two end-of-buffer characters. The first causes
1711
* a transition to the end-of-buffer state. The second causes
1712
* a jam in that state.
1714
b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1715
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1717
b->yy_buf_pos = &b->yy_ch_buf[0];
1720
b->yy_buffer_status = YY_BUFFER_NEW;
1722
if ( b == yy_current_buffer )
1723
yy_load_buffer_state();
1727
#ifndef YY_NO_SCAN_BUFFER
1728
#ifdef YY_USE_PROTOS
1729
YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1731
YY_BUFFER_STATE yy_scan_buffer( base, size )
1739
base[size-2] != YY_END_OF_BUFFER_CHAR ||
1740
base[size-1] != YY_END_OF_BUFFER_CHAR )
1741
/* They forgot to leave room for the EOB's. */
1744
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1746
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1748
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1749
b->yy_buf_pos = b->yy_ch_buf = base;
1750
b->yy_is_our_buffer = 0;
1751
b->yy_input_file = 0;
1752
b->yy_n_chars = b->yy_buf_size;
1753
b->yy_is_interactive = 0;
1755
b->yy_fill_buffer = 0;
1756
b->yy_buffer_status = YY_BUFFER_NEW;
1758
yy_switch_to_buffer( b );
1765
#ifndef YY_NO_SCAN_STRING
1766
#ifdef YY_USE_PROTOS
1767
YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1769
YY_BUFFER_STATE yy_scan_string( yy_str )
1770
yyconst char *yy_str;
1774
for ( len = 0; yy_str[len]; ++len )
1777
return yy_scan_bytes( yy_str, len );
1782
#ifndef YY_NO_SCAN_BYTES
1783
#ifdef YY_USE_PROTOS
1784
YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1786
YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1787
yyconst char *bytes;
1796
/* Get memory for full buffer, including space for trailing EOB's. */
1798
buf = (char *) yy_flex_alloc( n );
1800
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1802
for ( i = 0; i < len; ++i )
1805
buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1807
b = yy_scan_buffer( buf, n );
1809
YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1811
/* It's okay to grow etc. this buffer, and we should throw it
1812
* away when we're done.
1814
b->yy_is_our_buffer = 1;
1821
#ifndef YY_NO_PUSH_STATE
1822
#ifdef YY_USE_PROTOS
1823
static void yy_push_state( int new_state )
1825
static void yy_push_state( new_state )
1829
if ( yy_start_stack_ptr >= yy_start_stack_depth )
1833
yy_start_stack_depth += YY_START_STACK_INCR;
1834
new_size = yy_start_stack_depth * sizeof( int );
1836
if ( ! yy_start_stack )
1837
yy_start_stack = (int *) yy_flex_alloc( new_size );
1840
yy_start_stack = (int *) yy_flex_realloc(
1841
(void *) yy_start_stack, new_size );
1843
if ( ! yy_start_stack )
1845
"out of memory expanding start-condition stack" );
1848
yy_start_stack[yy_start_stack_ptr++] = YY_START;
1855
#ifndef YY_NO_POP_STATE
1856
static void yy_pop_state()
1858
if ( --yy_start_stack_ptr < 0 )
1859
YY_FATAL_ERROR( "start-condition stack underflow" );
1861
BEGIN(yy_start_stack[yy_start_stack_ptr]);
1866
#ifndef YY_NO_TOP_STATE
1867
static int yy_top_state()
1869
return yy_start_stack[yy_start_stack_ptr - 1];
1873
#ifndef YY_EXIT_FAILURE
1874
#define YY_EXIT_FAILURE 2
1877
#ifdef YY_USE_PROTOS
1878
static void yy_fatal_error( yyconst char msg[] )
1880
static void yy_fatal_error( msg )
1884
(void) fprintf( stderr, "%s\n", msg );
1885
exit( YY_EXIT_FAILURE );
1890
/* Redefine yyless() so it works in section 3 code. */
1896
/* Undo effects of setting up yytext. */ \
1897
yytext[yyleng] = yy_hold_char; \
1898
yy_c_buf_p = yytext + n; \
1899
yy_hold_char = *yy_c_buf_p; \
1900
*yy_c_buf_p = '\0'; \
1906
/* Internal utility routines. */
1909
#ifdef YY_USE_PROTOS
1910
static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1912
static void yy_flex_strncpy( s1, s2, n )
1919
for ( i = 0; i < n; ++i )
1924
#ifdef YY_NEED_STRLEN
1925
#ifdef YY_USE_PROTOS
1926
static int yy_flex_strlen( yyconst char *s )
1928
static int yy_flex_strlen( s )
1933
for ( n = 0; s[n]; ++n )
1941
#ifdef YY_USE_PROTOS
1942
static void *yy_flex_alloc( yy_size_t size )
1944
static void *yy_flex_alloc( size )
1948
return (void *) malloc( size );
1951
#ifdef YY_USE_PROTOS
1952
static void *yy_flex_realloc( void *ptr, yy_size_t size )
1954
static void *yy_flex_realloc( ptr, size )
1959
/* The cast to (char *) in the following accommodates both
1960
* implementations that use char* generic pointers, and those
1961
* that use void* generic pointers. It works with the latter
1962
* because both ANSI C and C++ allow castless assignment from
1963
* any pointer type to void*, and deal with argument conversions
1964
* as though doing an assignment.
1966
return (void *) realloc( (char *) ptr, size );
1969
#ifdef YY_USE_PROTOS
1970
static void yy_flex_free( void *ptr )
1972
static void yy_flex_free( ptr )
1986
#line 298 "sqlscanner.l"
1989
void tokenize(const char *data)
1991
yy_switch_to_buffer(yy_scan_string(data));