GRASS Programmer's Manual  6.4.3(2013)-r
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
lex.yy.c
Go to the documentation of this file.
1 
2 #line 3 "lex.yy.c"
3 
4 #define YY_INT_ALIGNED short int
5 
6 /* A lexical scanner generated by flex */
7 
8 #define FLEX_SCANNER
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 5
11 #define YY_FLEX_SUBMINOR_VERSION 35
12 #if YY_FLEX_SUBMINOR_VERSION > 0
13 #define FLEX_BETA
14 #endif
15 
16 /* First, we deal with platform-specific or compiler-specific issues. */
17 
18 /* begin standard C headers. */
19 #include <stdio.h>
20 #include <string.h>
21 #include <errno.h>
22 #include <stdlib.h>
23 
24 /* end standard C headers. */
25 
26 /* flex integer type definitions */
27 
28 #ifndef FLEXINT_H
29 #define FLEXINT_H
30 
31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
32 
33 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
34 
35 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36  * if you want the limit (max/min) macros for int types.
37  */
38 #ifndef __STDC_LIMIT_MACROS
39 #define __STDC_LIMIT_MACROS 1
40 #endif
41 
42 #include <inttypes.h>
43 typedef int8_t flex_int8_t;
44 typedef uint8_t flex_uint8_t;
45 typedef int16_t flex_int16_t;
46 typedef uint16_t flex_uint16_t;
47 typedef int32_t flex_int32_t;
48 typedef uint32_t flex_uint32_t;
49 #else
50 typedef signed char flex_int8_t;
51 typedef short int flex_int16_t;
52 typedef int flex_int32_t;
53 typedef unsigned char flex_uint8_t;
54 typedef unsigned short int flex_uint16_t;
55 typedef unsigned int flex_uint32_t;
56 
57 /* Limits of integral types. */
58 #ifndef INT8_MIN
59 #define INT8_MIN (-128)
60 #endif
61 #ifndef INT16_MIN
62 #define INT16_MIN (-32767-1)
63 #endif
64 #ifndef INT32_MIN
65 #define INT32_MIN (-2147483647-1)
66 #endif
67 #ifndef INT8_MAX
68 #define INT8_MAX (127)
69 #endif
70 #ifndef INT16_MAX
71 #define INT16_MAX (32767)
72 #endif
73 #ifndef INT32_MAX
74 #define INT32_MAX (2147483647)
75 #endif
76 #ifndef UINT8_MAX
77 #define UINT8_MAX (255U)
78 #endif
79 #ifndef UINT16_MAX
80 #define UINT16_MAX (65535U)
81 #endif
82 #ifndef UINT32_MAX
83 #define UINT32_MAX (4294967295U)
84 #endif
85 
86 #endif /* ! C99 */
87 
88 #endif /* ! FLEXINT_H */
89 
90 #ifdef __cplusplus
91 
92 /* The "const" storage-class-modifier is valid. */
93 #define YY_USE_CONST
94 
95 #else /* ! __cplusplus */
96 
97 /* C99 requires __STDC__ to be defined as 1. */
98 #if defined (__STDC__)
99 
100 #define YY_USE_CONST
101 
102 #endif /* defined (__STDC__) */
103 #endif /* ! __cplusplus */
104 
105 #ifdef YY_USE_CONST
106 #define yyconst const
107 #else
108 #define yyconst
109 #endif
110 
111 /* Returned upon end-of-file. */
112 #define YY_NULL 0
113 
114 /* Promotes a possibly negative, possibly signed char to an unsigned
115  * integer for use as an array index. If the signed char is negative,
116  * we want to instead treat it as an 8-bit unsigned char, hence the
117  * double cast.
118  */
119 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
120 
121 /* Enter a start condition. This macro really ought to take a parameter,
122  * but we do it the disgusting crufty way forced on us by the ()-less
123  * definition of BEGIN.
124  */
125 #define BEGIN (yy_start) = 1 + 2 *
126 
127 /* Translate the current start state into a value that can be later handed
128  * to BEGIN to return to the state. The YYSTATE alias is for lex
129  * compatibility.
130  */
131 #define YY_START (((yy_start) - 1) / 2)
132 #define YYSTATE YY_START
133 
134 /* Action number for EOF rule of a given start state. */
135 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
136 
137 /* Special action meaning "start processing a new file". */
138 #define YY_NEW_FILE yyrestart(yyin )
139 
140 #define YY_END_OF_BUFFER_CHAR 0
141 
142 /* Size of default input buffer. */
143 #ifndef YY_BUF_SIZE
144 #ifdef __ia64__
145 /* On IA-64, the buffer size is 16k, not 8k.
146  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
147  * Ditto for the __ia64__ case accordingly.
148  */
149 #define YY_BUF_SIZE 32768
150 #else
151 #define YY_BUF_SIZE 16384
152 #endif /* __ia64__ */
153 #endif
154 
155 /* The state buf must be large enough to hold one state per character in the main buffer.
156  */
157 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
158 
159 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
160 #define YY_TYPEDEF_YY_BUFFER_STATE
162 #endif
163 
164 extern int yyleng;
165 
166 extern FILE *yyin, *yyout;
167 
168 #define EOB_ACT_CONTINUE_SCAN 0
169 #define EOB_ACT_END_OF_FILE 1
170 #define EOB_ACT_LAST_MATCH 2
171 
172  #define YY_LESS_LINENO(n)
173 
174 /* Return all but the first "n" matched characters back to the input stream. */
175 #define yyless(n) \
176  do \
177  { \
178  /* Undo effects of setting up yytext. */ \
179  int yyless_macro_arg = (n); \
180  YY_LESS_LINENO(yyless_macro_arg);\
181  *yy_cp = (yy_hold_char); \
182  YY_RESTORE_YY_MORE_OFFSET \
183  (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
184  YY_DO_BEFORE_ACTION; /* set up yytext again */ \
185  } \
186  while ( 0 )
187 
188 #define unput(c) yyunput( c, (yytext_ptr) )
189 
190 #ifndef YY_TYPEDEF_YY_SIZE_T
191 #define YY_TYPEDEF_YY_SIZE_T
192 typedef size_t yy_size_t;
193 #endif
194 
195 #ifndef YY_STRUCT_YY_BUFFER_STATE
196 #define YY_STRUCT_YY_BUFFER_STATE
198  {
200 
201  char *yy_ch_buf; /* input buffer */
202  char *yy_buf_pos; /* current position in input buffer */
203 
204  /* Size of input buffer in bytes, not including room for EOB
205  * characters.
206  */
208 
209  /* Number of characters read into yy_ch_buf, not including EOB
210  * characters.
211  */
213 
214  /* Whether we "own" the buffer - i.e., we know we created it,
215  * and can realloc() it to grow it, and should free() it to
216  * delete it.
217  */
219 
220  /* Whether this is an "interactive" input source; if so, and
221  * if we're using stdio for input, then we want to use getc()
222  * instead of fread(), to make sure we stop fetching input after
223  * each newline.
224  */
226 
227  /* Whether we're considered to be at the beginning of a line.
228  * If so, '^' rules will be active on the next match, otherwise
229  * not.
230  */
232 
236  /* Whether to try to fill the input buffer when we reach the
237  * end of it.
238  */
240 
242 
243 #define YY_BUFFER_NEW 0
244 #define YY_BUFFER_NORMAL 1
245  /* When an EOF's been seen but there's still some text to process
246  * then we mark the buffer as YY_EOF_PENDING, to indicate that we
247  * shouldn't try reading from the input source any more. We might
248  * still have a bunch of tokens to match, though, because of
249  * possible backing-up.
250  *
251  * When we actually see the EOF, we change the status to "new"
252  * (via yyrestart()), so that the user can continue scanning by
253  * just pointing yyin at a new input file.
254  */
255 #define YY_BUFFER_EOF_PENDING 2
256 
257  };
258 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
259 
260 /* Stack of input buffers. */
261 static size_t yy_buffer_stack_top = 0;
262 static size_t yy_buffer_stack_max = 0;
263 static YY_BUFFER_STATE * yy_buffer_stack = 0;
265 /* We provide macros for accessing buffer states in case in the
266  * future we want to put the buffer states in a more general
267  * "scanner state".
268  *
269  * Returns the top of the stack, or NULL.
270  */
271 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
272  ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
273  : NULL)
274 
275 /* Same as previous macro, but useful when we know that the buffer stack is not
276  * NULL or when we need an lvalue. For internal use only.
277  */
278 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
279 
280 /* yy_hold_char holds the character lost when yytext is formed. */
281 static char yy_hold_char;
282 static int yy_n_chars; /* number of characters read into yy_ch_buf */
283 int yyleng;
284 
285 /* Points to current character in buffer. */
286 static char *yy_c_buf_p = (char *) 0;
287 static int yy_init = 0; /* whether we need to initialize */
288 static int yy_start = 0; /* start state number */
289 
290 /* Flag which is used to allow yywrap()'s to do buffer switches
291  * instead of setting up a fresh yyin. A bit of a hack ...
292  */
293 static int yy_did_buffer_switch_on_eof;
294 
295 void yyrestart (FILE *input_file );
296 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
297 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
298 void yy_delete_buffer (YY_BUFFER_STATE b );
299 void yy_flush_buffer (YY_BUFFER_STATE b );
300 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
301 void yypop_buffer_state (void );
302 
303 static void yyensure_buffer_stack (void );
304 static void yy_load_buffer_state (void );
305 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
306 
307 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
308 
309 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
310 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
311 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
312 
313 void *yyalloc (yy_size_t );
314 void *yyrealloc (void *,yy_size_t );
315 void yyfree (void * );
316 
317 #define yy_new_buffer yy_create_buffer
318 
319 #define yy_set_interactive(is_interactive) \
320  { \
321  if ( ! YY_CURRENT_BUFFER ){ \
322  yyensure_buffer_stack (); \
323  YY_CURRENT_BUFFER_LVALUE = \
324  yy_create_buffer(yyin,YY_BUF_SIZE ); \
325  } \
326  YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
327  }
328 
329 #define yy_set_bol(at_bol) \
330  { \
331  if ( ! YY_CURRENT_BUFFER ){\
332  yyensure_buffer_stack (); \
333  YY_CURRENT_BUFFER_LVALUE = \
334  yy_create_buffer(yyin,YY_BUF_SIZE ); \
335  } \
336  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
337  }
338 
339 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
340 
341 /* Begin user sect3 */
342 
343 typedef unsigned char YY_CHAR;
344 
345 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
346 
347 typedef int yy_state_type;
348 
349 extern int yylineno;
350 
351 int yylineno = 1;
352 
353 extern char *yytext;
354 #define yytext_ptr yytext
355 
356 static yy_state_type yy_get_previous_state (void );
357 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
358 static int yy_get_next_buffer (void );
359 static void yy_fatal_error (yyconst char msg[] );
360 
361 /* Done after the current pattern has been matched and before the
362  * corresponding action - sets up yytext.
363  */
364 #define YY_DO_BEFORE_ACTION \
365  (yytext_ptr) = yy_bp; \
366  (yytext_ptr) -= (yy_more_len); \
367  yyleng = (size_t) (yy_cp - (yytext_ptr)); \
368  (yy_hold_char) = *yy_cp; \
369  *yy_cp = '\0'; \
370  (yy_c_buf_p) = yy_cp;
371 
372 #define YY_NUM_RULES 53
373 #define YY_END_OF_BUFFER 54
374 /* This struct is not used in this scanner,
375  but its presence is necessary. */
377  {
380  };
381 static yyconst flex_int16_t yy_accept[164] =
382  { 0,
383  0, 0, 54, 53, 51, 50, 53, 40, 40, 40,
384  42, 35, 33, 36, 41, 41, 41, 41, 41, 41,
385  41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
386  39, 51, 0, 49, 48, 0, 43, 0, 44, 42,
387  0, 37, 34, 38, 41, 41, 41, 41, 41, 28,
388  41, 41, 41, 41, 41, 41, 41, 41, 31, 41,
389  41, 41, 25, 41, 41, 41, 41, 41, 41, 41,
390  0, 0, 52, 0, 47, 44, 0, 0, 45, 1,
391  41, 13, 29, 41, 41, 41, 41, 41, 41, 41,
392  41, 41, 19, 41, 26, 41, 41, 41, 41, 9,
393 
394  41, 41, 41, 41, 41, 41, 0, 46, 41, 41,
395  41, 23, 41, 30, 41, 15, 5, 41, 41, 7,
396  32, 17, 41, 41, 41, 41, 24, 41, 41, 41,
397  41, 2, 41, 41, 41, 41, 41, 41, 27, 41,
398  41, 16, 41, 41, 41, 12, 3, 14, 4, 21,
399  6, 41, 41, 8, 10, 11, 41, 20, 41, 18,
400  41, 22, 0
401  } ;
402 
403 static yyconst flex_int32_t yy_ec[256] =
404  { 0,
405  1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
406  1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
407  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
408  1, 2, 1, 1, 1, 1, 1, 1, 4, 5,
409  5, 5, 6, 5, 7, 8, 5, 9, 9, 9,
410  9, 9, 9, 9, 9, 9, 9, 5, 5, 10,
411  11, 12, 1, 1, 13, 14, 15, 16, 17, 18,
412  19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
413  22, 29, 30, 31, 32, 33, 34, 22, 35, 22,
414  1, 1, 1, 1, 36, 1, 13, 14, 15, 16,
415 
416  17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
417  27, 28, 22, 29, 30, 31, 32, 33, 34, 22,
418  35, 22, 1, 1, 1, 37, 1, 1, 1, 1,
419  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
422  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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 
427  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
428  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
429  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
430  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
431  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
432  1, 1, 1, 1, 1
433  } ;
434 
435 static yyconst flex_int32_t yy_meta[38] =
436  { 0,
437  1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
438  1, 1, 2, 2, 2, 2, 2, 2, 2, 2,
439  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440  2, 2, 2, 2, 2, 2, 1
441  } ;
442 
443 static yyconst flex_int16_t yy_base[168] =
444  { 0,
445  0, 0, 194, 195, 191, 195, 35, 195, 185, 31,
446  33, 32, 195, 180, 29, 155, 20, 39, 0, 160,
447  28, 167, 19, 158, 157, 168, 44, 156, 170, 162,
448  195, 179, 57, 176, 195, 176, 53, 65, 58, 68,
449  72, 195, 195, 195, 0, 162, 146, 160, 160, 0,
450  150, 156, 141, 39, 139, 143, 142, 52, 0, 145,
451  136, 142, 149, 147, 49, 149, 137, 145, 60, 143,
452  155, 155, 195, 148, 147, 77, 81, 146, 145, 0,
453  136, 0, 0, 120, 138, 133, 132, 133, 133, 118,
454  120, 127, 74, 126, 0, 118, 124, 125, 122, 0,
455 
456  114, 120, 123, 103, 119, 104, 123, 122, 101, 104,
457  97, 0, 96, 0, 102, 0, 0, 96, 105, 0,
458  0, 0, 94, 101, 106, 103, 0, 88, 101, 97,
459  99, 0, 89, 97, 96, 95, 80, 93, 0, 79,
460  77, 0, 83, 69, 85, 0, 0, 0, 0, 0,
461  0, 68, 75, 0, 0, 0, 66, 0, 66, 0,
462  66, 0, 195, 101, 62, 103, 105
463  } ;
464 
465 static yyconst flex_int16_t yy_def[168] =
466  { 0,
467  163, 1, 163, 163, 163, 163, 164, 163, 163, 163,
468  163, 163, 163, 163, 165, 165, 165, 165, 165, 165,
469  165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
470  163, 163, 164, 166, 163, 167, 163, 163, 163, 163,
471  163, 163, 163, 163, 165, 165, 165, 165, 165, 165,
472  165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
473  165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
474  166, 167, 163, 163, 163, 163, 163, 163, 163, 165,
475  165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
476  165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
477 
478  165, 165, 165, 165, 165, 165, 163, 163, 165, 165,
479  165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
480  165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
481  165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
482  165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
483  165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
484  165, 165, 0, 163, 163, 163, 163
485  } ;
486 
487 static yyconst flex_int16_t yy_nxt[233] =
488  { 0,
489  4, 5, 6, 7, 8, 8, 9, 10, 11, 12,
490  13, 14, 15, 16, 17, 18, 19, 20, 19, 19,
491  21, 19, 19, 22, 19, 23, 24, 25, 19, 26,
492  27, 28, 29, 30, 19, 4, 31, 34, 35, 37,
493  39, 40, 42, 43, 46, 61, 51, 38, 52, 41,
494  62, 53, 47, 58, 48, 54, 66, 59, 49, 34,
495  35, 37, 87, 45, 67, 55, 76, 56, 88, 38,
496  74, 74, 99, 75, 77, 39, 40, 78, 78, 100,
497  79, 92, 93, 104, 41, 76, 107, 107, 105, 108,
498  119, 162, 161, 77, 160, 159, 158, 157, 156, 155,
499 
500  120, 33, 33, 71, 71, 72, 72, 154, 153, 152,
501  151, 150, 149, 148, 147, 146, 145, 144, 143, 142,
502  141, 140, 139, 138, 137, 136, 135, 134, 133, 132,
503  108, 108, 131, 130, 129, 128, 127, 126, 125, 124,
504  123, 122, 121, 118, 117, 116, 115, 114, 113, 112,
505  111, 110, 109, 79, 79, 75, 75, 73, 35, 106,
506  103, 102, 101, 98, 97, 96, 95, 94, 91, 90,
507  89, 86, 85, 84, 83, 82, 81, 80, 73, 35,
508  32, 70, 69, 68, 65, 64, 63, 60, 57, 50,
509  44, 36, 32, 163, 3, 163, 163, 163, 163, 163,
510 
511  163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
512  163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
513  163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
514  163, 163
515  } ;
516 
517 static yyconst flex_int16_t yy_chk[233] =
518  { 0,
519  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
520  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
521  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
522  1, 1, 1, 1, 1, 1, 1, 7, 7, 10,
523  11, 11, 12, 12, 15, 23, 17, 10, 17, 11,
524  23, 18, 15, 21, 15, 18, 27, 21, 15, 33,
525  33, 37, 54, 165, 27, 18, 39, 18, 54, 37,
526  38, 38, 65, 38, 39, 40, 40, 41, 41, 65,
527  41, 58, 58, 69, 40, 76, 77, 77, 69, 77,
528  93, 161, 159, 76, 157, 153, 152, 145, 144, 143,
529 
530  93, 164, 164, 166, 166, 167, 167, 141, 140, 138,
531  137, 136, 135, 134, 133, 131, 130, 129, 128, 126,
532  125, 124, 123, 119, 118, 115, 113, 111, 110, 109,
533  108, 107, 106, 105, 104, 103, 102, 101, 99, 98,
534  97, 96, 94, 92, 91, 90, 89, 88, 87, 86,
535  85, 84, 81, 79, 78, 75, 74, 72, 71, 70,
536  68, 67, 66, 64, 63, 62, 61, 60, 57, 56,
537  55, 53, 52, 51, 49, 48, 47, 46, 36, 34,
538  32, 30, 29, 28, 26, 25, 24, 22, 20, 16,
539  14, 9, 5, 3, 163, 163, 163, 163, 163, 163,
540 
541  163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
542  163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
543  163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
544  163, 163
545  } ;
546 
547 static yy_state_type yy_last_accepting_state;
548 static char *yy_last_accepting_cpos;
549 
550 extern int yy_flex_debug;
551 int yy_flex_debug = 0;
552 
553 /* The intent behind this definition is that it'll catch
554  * any uses of REJECT which flex missed.
555  */
556 #define REJECT reject_used_but_not_detected
557 static int yy_more_flag = 0;
558 static int yy_more_len = 0;
559 #define yymore() ((yy_more_flag) = 1)
560 #define YY_MORE_ADJ (yy_more_len)
561 #define YY_RESTORE_YY_MORE_OFFSET
562 char *yytext;
563 #line 1 "lex.l"
564 /*****************************************************************************
565 *
566 * MODULE: SQL statement parser library
567 *
568 * AUTHOR(S): lex.l and yac.y were originaly taken from unixODBC and
569 * probably written by Peter Harvey <pharvey@codebydesigns.com>,
570 * modifications and other code by Radim Blazek
571 *
572 * PURPOSE: Parse input string containing SQL statement to
573 * SQLPSTMT structure.
574 * SQL parser may be used by simple database drivers.
575 *
576 * COPYRIGHT: (C) 2000 by the GRASS Development Team
577 *
578 * This program is free software under the GNU General Public
579 * License (>=v2). Read the file COPYING that comes with GRASS
580 * for details.
581 *
582 *****************************************************************************/
583 /**************** C-CODE *****************/
584 #line 24 "lex.l"
585 #include <grass/sqlp.h>
586 #include "y.tab.h"
587 #include <string.h>
588 
589 #undef YY_INPUT
590 #define YY_INPUT(b, r, ms) (r = my_yyinput(b, ms))
591 
592 /*************** LEX HEADER **************/
593 /**************** LEX BODY ****************/
594 #line 595 "lex.yy.c"
595 
596 #define INITIAL 0
597 
598 #ifndef YY_NO_UNISTD_H
599 /* Special case for "unistd.h", since it is non-ANSI. We include it way
600  * down here because we want the user's section 1 to have been scanned first.
601  * The user has a chance to override it with an option.
602  */
603 #include <unistd.h>
604 #endif
605 
606 #ifndef YY_EXTRA_TYPE
607 #define YY_EXTRA_TYPE void *
608 #endif
609 
610 static int yy_init_globals (void );
611 
612 /* Accessor methods to globals.
613  These are made visible to non-reentrant scanners for convenience. */
614 
615 int yylex_destroy (void );
616 
617 int yyget_debug (void );
618 
619 void yyset_debug (int debug_flag );
620 
621 YY_EXTRA_TYPE yyget_extra (void );
622 
623 void yyset_extra (YY_EXTRA_TYPE user_defined );
624 
625 FILE *yyget_in (void );
626 
627 void yyset_in (FILE * in_str );
628 
629 FILE *yyget_out (void );
630 
631 void yyset_out (FILE * out_str );
632 
633 int yyget_leng (void );
634 
635 char *yyget_text (void );
636 
637 int yyget_lineno (void );
638 
639 void yyset_lineno (int line_number );
640 
641 /* Macros after this point can all be overridden by user definitions in
642  * section 1.
643  */
644 
645 #ifndef YY_SKIP_YYWRAP
646 #ifdef __cplusplus
647 extern "C" int yywrap (void );
648 #else
649 extern int yywrap (void );
650 #endif
651 #endif
652 
653  static void yyunput (int c,char *buf_ptr );
654 
655 #ifndef yytext_ptr
656 static void yy_flex_strncpy (char *,yyconst char *,int );
657 #endif
658 
659 #ifdef YY_NEED_STRLEN
660 static int yy_flex_strlen (yyconst char * );
661 #endif
662 
663 #ifndef YY_NO_INPUT
664 
665 #ifdef __cplusplus
666 static int yyinput (void );
667 #else
668 static int input (void );
669 #endif
670 
671 #endif
672 
673 /* Amount of stuff to slurp up with each read. */
674 #ifndef YY_READ_BUF_SIZE
675 #ifdef __ia64__
676 /* On IA-64, the buffer size is 16k, not 8k */
677 #define YY_READ_BUF_SIZE 16384
678 #else
679 #define YY_READ_BUF_SIZE 8192
680 #endif /* __ia64__ */
681 #endif
682 
683 /* Copy whatever the last rule matched to the standard output. */
684 #ifndef ECHO
685 /* This used to be an fputs(), but since the string might contain NUL's,
686  * we now use fwrite().
687  */
688 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
689 #endif
690 
691 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
692  * is returned in "result".
693  */
694 #ifndef YY_INPUT
695 #define YY_INPUT(buf,result,max_size) \
696  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
697  { \
698  int c = '*'; \
699  size_t n; \
700  for ( n = 0; n < max_size && \
701  (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
702  buf[n] = (char) c; \
703  if ( c == '\n' ) \
704  buf[n++] = (char) c; \
705  if ( c == EOF && ferror( yyin ) ) \
706  YY_FATAL_ERROR( "input in flex scanner failed" ); \
707  result = n; \
708  } \
709  else \
710  { \
711  errno=0; \
712  while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
713  { \
714  if( errno != EINTR) \
715  { \
716  YY_FATAL_ERROR( "input in flex scanner failed" ); \
717  break; \
718  } \
719  errno=0; \
720  clearerr(yyin); \
721  } \
722  }\
723 \
724 
725 #endif
726 
727 /* No semi-colon after return; correct usage is to write "yyterminate();" -
728  * we don't want an extra ';' after the "return" because that will cause
729  * some compilers to complain about unreachable statements.
730  */
731 #ifndef yyterminate
732 #define yyterminate() return YY_NULL
733 #endif
734 
735 /* Number of entries by which start-condition stack grows. */
736 #ifndef YY_START_STACK_INCR
737 #define YY_START_STACK_INCR 25
738 #endif
739 
740 /* Report a fatal error. */
741 #ifndef YY_FATAL_ERROR
742 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
743 #endif
744 
745 /* end tables serialization structures and prototypes */
746 
747 /* Default declaration of generated scanner - a define so the user can
748  * easily add parameters.
749  */
750 #ifndef YY_DECL
751 #define YY_DECL_IS_OURS 1
752 
753 extern int yylex (void);
754 
755 #define YY_DECL int yylex (void)
756 #endif /* !YY_DECL */
757 
758 /* Code executed at the beginning of each rule, after yytext and yyleng
759  * have been set up.
760  */
761 #ifndef YY_USER_ACTION
762 #define YY_USER_ACTION
763 #endif
764 
765 /* Code executed at the end of each rule. */
766 #ifndef YY_BREAK
767 #define YY_BREAK break;
768 #endif
769 
770 #define YY_RULE_SETUP \
771  YY_USER_ACTION
772 
775 YY_DECL
776 {
777  register yy_state_type yy_current_state;
778  register char *yy_cp, *yy_bp;
779  register int yy_act;
780 
781 #line 38 "lex.l"
782 
783 
784  /***************************************
785  * LITERALS KEYWORDS TOKENS
786  ***************************************/
787 
788  /* following case insensitives are ugly
789  but I do not know better at this time */
790 
791 #line 792 "lex.yy.c"
792 
793  if ( !(yy_init) )
794  {
795  (yy_init) = 1;
796 
797 #ifdef YY_USER_INIT
798  YY_USER_INIT;
799 #endif
800 
801  if ( ! (yy_start) )
802  (yy_start) = 1; /* first start state */
803 
804  if ( ! yyin )
805  yyin = stdin;
806 
807  if ( ! yyout )
808  yyout = stdout;
809 
810  if ( ! YY_CURRENT_BUFFER ) {
811  yyensure_buffer_stack ();
814  }
815 
816  yy_load_buffer_state( );
817  }
818 
819  while ( 1 ) /* loops until end-of-file is reached */
820  {
821  (yy_more_len) = 0;
822  if ( (yy_more_flag) )
823  {
824  (yy_more_len) = (yy_c_buf_p) - (yytext_ptr);
825  (yy_more_flag) = 0;
826  }
827  yy_cp = (yy_c_buf_p);
828 
829  /* Support of yytext. */
830  *yy_cp = (yy_hold_char);
831 
832  /* yy_bp points to the position in yy_ch_buf of the start of
833  * the current run.
834  */
835  yy_bp = yy_cp;
836 
837  yy_current_state = (yy_start);
838 yy_match:
839  do
840  {
841  register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
842  if ( yy_accept[yy_current_state] )
843  {
844  (yy_last_accepting_state) = yy_current_state;
845  (yy_last_accepting_cpos) = yy_cp;
846  }
847  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
848  {
849  yy_current_state = (int) yy_def[yy_current_state];
850  if ( yy_current_state >= 164 )
851  yy_c = yy_meta[(unsigned int) yy_c];
852  }
853  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
854  ++yy_cp;
855  }
856  while ( yy_base[yy_current_state] != 195 );
857 
858 yy_find_action:
859  yy_act = yy_accept[yy_current_state];
860  if ( yy_act == 0 )
861  { /* have to back up */
862  yy_cp = (yy_last_accepting_cpos);
863  yy_current_state = (yy_last_accepting_state);
864  yy_act = yy_accept[yy_current_state];
865  }
866 
868 
869 do_action: /* This label is used only to access EOF actions. */
870 
871  switch ( yy_act )
872  { /* beginning of action switch */
873  case 0: /* must back up */
874  /* undo the effects of YY_DO_BEFORE_ACTION */
875  *yy_cp = (yy_hold_char);
876  yy_cp = (yy_last_accepting_cpos);
877  yy_current_state = (yy_last_accepting_state);
878  goto yy_find_action;
879 
880 case 1:
882 #line 47 "lex.l"
883 { return ADD; }
884  YY_BREAK
885 case 2:
887 #line 48 "lex.l"
888 { return ALTER; }
889  YY_BREAK
890 case 3:
892 #line 49 "lex.l"
893 { return COLUMN; }
894  YY_BREAK
895 case 4:
897 #line 50 "lex.l"
898 { return DELETE; }
899  YY_BREAK
900 case 5:
902 #line 51 "lex.l"
903 { return FROM; }
904  YY_BREAK
905 case 6:
907 #line 52 "lex.l"
908 { return INSERT; }
909  YY_BREAK
910 case 7:
912 #line 53 "lex.l"
913 { return INTO; }
914  YY_BREAK
915 case 8:
917 #line 54 "lex.l"
918 { return SELECT; }
919  YY_BREAK
920 case 9:
922 #line 55 "lex.l"
923 { return SET; }
924  YY_BREAK
925 case 10:
927 #line 56 "lex.l"
928 { return UPDATE; }
929  YY_BREAK
930 case 11:
932 #line 57 "lex.l"
933 { return VALUES; }
934  YY_BREAK
935 case 12:
937 #line 58 "lex.l"
938 { return WHERE; }
939  YY_BREAK
940 case 13:
942 #line 59 "lex.l"
943 { return AND; }
944  YY_BREAK
945 case 14:
947 #line 60 "lex.l"
948 { return CREATE; }
949  YY_BREAK
950 case 15:
952 #line 61 "lex.l"
953 { return DROP; }
954  YY_BREAK
955 case 16:
957 #line 62 "lex.l"
958 { return TABLE; }
959  YY_BREAK
960 case 17:
962 #line 63 "lex.l"
963 { return NULL_VALUE; }
964  YY_BREAK
965 case 18:
967 #line 64 "lex.l"
968 { return VARCHAR; }
969  YY_BREAK
970 case 19:
972 #line 65 "lex.l"
973 { return INT; }
974  YY_BREAK
975 case 20:
977 #line 66 "lex.l"
978 { return INTEGER; }
979  YY_BREAK
980 case 21:
982 #line 67 "lex.l"
983 { return DOUBLE; }
984  YY_BREAK
985 case 22:
987 #line 68 "lex.l"
988 { return PRECISION; }
989  YY_BREAK
990 case 23:
992 #line 69 "lex.l"
993 { return DATE; }
994  YY_BREAK
995 case 24:
997 #line 70 "lex.l"
998 { return TIME; }
999  YY_BREAK
1000 case 25:
1002 #line 71 "lex.l"
1003 { return OR; }
1004  YY_BREAK
1005 case 26:
1007 #line 72 "lex.l"
1008 { return NOT; }
1009  YY_BREAK
1010 case 27:
1012 #line 73 "lex.l"
1013 { return ORDER; }
1014  YY_BREAK
1015 case 28:
1017 #line 74 "lex.l"
1018 { return BY; }
1019  YY_BREAK
1020 case 29:
1022 #line 75 "lex.l"
1023 { return ASC; }
1024  YY_BREAK
1025 case 30:
1027 #line 76 "lex.l"
1028 { return DESC; }
1029  YY_BREAK
1030 case 31:
1032 #line 77 "lex.l"
1033 { return IS; }
1034  YY_BREAK
1035 case 32:
1037 #line 78 "lex.l"
1038 {
1039  yylval.strval = (char*)strdup("~");
1040  return COMPARISON_OPERATOR;
1041  }
1042  YY_BREAK
1043 
1044  /* [Dd][Ii][Ss][Tt][Ii][Nn][Cc][Tt] { return DISTINCT; } */
1045  /***************************************
1046  * EQUAL
1047  ***************************************/
1048 
1049 case 33:
1051 #line 88 "lex.l"
1052 {
1053  return EQUAL;
1054  }
1055  YY_BREAK
1056 
1057  /***************************************
1058  * COMPARISON OPERATOR
1059  ***************************************/
1060 
1061 case 34:
1062 #line 97 "lex.l"
1063 case 35:
1064 #line 98 "lex.l"
1065 case 36:
1066 #line 99 "lex.l"
1067 case 37:
1068 #line 100 "lex.l"
1069 case 38:
1070 #line 101 "lex.l"
1071 case 39:
1073 #line 101 "lex.l"
1074 {
1075  yylval.strval = (char*)strdup(yytext);
1076  return COMPARISON_OPERATOR;
1077  }
1078  YY_BREAK
1079 
1080  /***************************************
1081  * PUNCTUATION
1082  ***************************************/
1083 
1084 case 40:
1086 #line 110 "lex.l"
1087 {
1088  yylval.strval = (char*)strdup(yytext);
1089  return yytext[0];
1090  }
1091  YY_BREAK
1092 
1093  /***************************************
1094  * NAMES
1095  ***************************************/
1096 
1097 case 41:
1099 #line 119 "lex.l"
1100 {
1101  yylval.strval = (char*)strdup(yytext);
1102  return NAME;
1103  }
1104  YY_BREAK
1105 
1106  /***************************************
1107  * INTEGER
1108  ***************************************/
1109 
1110 case 42:
1112 #line 129 "lex.l"
1113 {
1114  yylval.intval = atoi(yytext);
1115  /* yylval.strval = (char*)strdup(yytext); */
1116  return INTNUM;
1117  }
1118  YY_BREAK
1119 
1120  /***************************************
1121  * FLOATING POINT NUM
1122  ***************************************/
1123 
1124 case 43:
1125 #line 140 "lex.l"
1126 case 44:
1127 #line 141 "lex.l"
1128 case 45:
1129 #line 142 "lex.l"
1130 case 46:
1131 #line 143 "lex.l"
1132 case 47:
1134 #line 143 "lex.l"
1135 {
1136  yylval.floatval = atof(yytext);
1137  /* yylval.strval = (char*)strdup(yytext); */
1138  return FLOATNUM;
1139  }
1140  YY_BREAK
1141 
1142  /***************************************
1143  * STRINGS (single quotes)
1144  ***************************************/
1145 
1146 case 48:
1147 /* rule 48 can match eol */
1149 #line 154 "lex.l"
1150 {
1151  char *Buffer, *ptra, *ptrb;
1152  int c = input();
1153  int len;
1154 
1155  Buffer = (char*)strdup(yytext); /* store here because we lose it when unput() */
1156  unput( c ); /* just peeking - checking for a double quote... embedded quote */
1157 
1158  if ( c != '\'' )
1159  {
1160  len = strlen (Buffer);
1161  Buffer[len-1] = '\0';
1162  /* Hopefully replace all '' by ' */
1163  ptrb = Buffer + 1;
1164  while ( (ptra = strchr(ptrb, '\'')) != NULL ) {
1165  ptra++; ptrb = ptra;
1166  while ( ptra[1] != 0 ) { ptra[0] = ptra[1]; ptra++; }
1167  ptra[0] = 0;
1168  }
1169 
1170  yylval.strval = (char*)strdup(Buffer+1);
1171  free( Buffer );
1172  return STRING;
1173  }
1174  else
1175  {
1176  free( Buffer );
1177  yymore();
1178  }
1179  }
1180  YY_BREAK
1181 
1182  /***************************************
1183  * STRINGS (unterminated)
1184  ***************************************/
1185 
1186 case 49:
1187 *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
1188 (yy_c_buf_p) = yy_cp -= 1;
1189 YY_DO_BEFORE_ACTION; /* set up yytext again */
1191 #line 189 "lex.l"
1192 { yyerror("Unterminated string"); }
1193  YY_BREAK
1194 
1195  /***************************************
1196  * NEW LINE (ignored)
1197  ***************************************/
1198 
1199 case 50:
1200 /* rule 50 can match eol */
1202 #line 195 "lex.l"
1203 ;
1204  YY_BREAK
1205 
1206  /***************************************
1207  * WHITE SPACE (ignored)
1208  ***************************************/
1209 
1210 case 51:
1212 #line 201 "lex.l"
1213 ; /* white space */
1214  YY_BREAK
1215 
1216  /***************************************
1217  * COMMENTS (ignored)
1218  ***************************************/
1219 
1220 case 52:
1221 *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
1222 (yy_c_buf_p) = yy_cp -= 1;
1223 YY_DO_BEFORE_ACTION; /* set up yytext again */
1225 #line 207 "lex.l"
1226 ; /* comment */
1227  YY_BREAK
1228 case 53:
1230 #line 209 "lex.l"
1231 ECHO;
1232  YY_BREAK
1233 #line 1234 "lex.yy.c"
1234 case YY_STATE_EOF(INITIAL):
1235  yyterminate();
1236 
1237  case YY_END_OF_BUFFER:
1238  {
1239  /* Amount of text matched not including the EOB char. */
1240  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1241 
1242  /* Undo the effects of YY_DO_BEFORE_ACTION. */
1243  *yy_cp = (yy_hold_char);
1245 
1246  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1247  {
1248  /* We're scanning a new file or input source. It's
1249  * possible that this happened because the user
1250  * just pointed yyin at a new source and called
1251  * yylex(). If so, then we have to assure
1252  * consistency between YY_CURRENT_BUFFER and our
1253  * globals. Here is the right place to do so, because
1254  * this is the first action (other than possibly a
1255  * back-up) that will match for the new input source.
1256  */
1257  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1258  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1259  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1260  }
1261 
1262  /* Note that here we test for yy_c_buf_p "<=" to the position
1263  * of the first EOB in the buffer, since yy_c_buf_p will
1264  * already have been incremented past the NUL character
1265  * (since all states make transitions on EOB to the
1266  * end-of-buffer state). Contrast this with the test
1267  * in input().
1268  */
1269  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1270  { /* This was really a NUL. */
1271  yy_state_type yy_next_state;
1272 
1273  (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1274 
1275  yy_current_state = yy_get_previous_state( );
1276 
1277  /* Okay, we're now positioned to make the NUL
1278  * transition. We couldn't have
1279  * yy_get_previous_state() go ahead and do it
1280  * for us because it doesn't know how to deal
1281  * with the possibility of jamming (and we don't
1282  * want to build jamming into it because then it
1283  * will run more slowly).
1284  */
1285 
1286  yy_next_state = yy_try_NUL_trans( yy_current_state );
1287 
1288  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1289 
1290  if ( yy_next_state )
1291  {
1292  /* Consume the NUL. */
1293  yy_cp = ++(yy_c_buf_p);
1294  yy_current_state = yy_next_state;
1295  goto yy_match;
1296  }
1297 
1298  else
1299  {
1300  yy_cp = (yy_c_buf_p);
1301  goto yy_find_action;
1302  }
1303  }
1304 
1305  else switch ( yy_get_next_buffer( ) )
1306  {
1307  case EOB_ACT_END_OF_FILE:
1308  {
1309  (yy_did_buffer_switch_on_eof) = 0;
1310 
1311  if ( yywrap( ) )
1312  {
1313  /* Note: because we've taken care in
1314  * yy_get_next_buffer() to have set up
1315  * yytext, we can now set up
1316  * yy_c_buf_p so that if some total
1317  * hoser (like flex itself) wants to
1318  * call the scanner after we return the
1319  * YY_NULL, it'll still work - another
1320  * YY_NULL will get returned.
1321  */
1322  (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1323 
1324  yy_act = YY_STATE_EOF(YY_START);
1325  goto do_action;
1326  }
1327 
1328  else
1329  {
1330  if ( ! (yy_did_buffer_switch_on_eof) )
1331  YY_NEW_FILE;
1332  }
1333  break;
1334  }
1335 
1336  case EOB_ACT_CONTINUE_SCAN:
1337  (yy_c_buf_p) =
1338  (yytext_ptr) + yy_amount_of_matched_text;
1339 
1340  yy_current_state = yy_get_previous_state( );
1341 
1342  yy_cp = (yy_c_buf_p);
1343  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1344  goto yy_match;
1345 
1346  case EOB_ACT_LAST_MATCH:
1347  (yy_c_buf_p) =
1348  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1349 
1350  yy_current_state = yy_get_previous_state( );
1351 
1352  yy_cp = (yy_c_buf_p);
1353  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1354  goto yy_find_action;
1355  }
1356  break;
1357  }
1358 
1359  default:
1361  "fatal flex scanner internal error--no action found" );
1362  } /* end of action switch */
1363  } /* end of scanning one token */
1364 } /* end of yylex */
1365 
1366 /* yy_get_next_buffer - try to read in a new buffer
1367  *
1368  * Returns a code representing an action:
1369  * EOB_ACT_LAST_MATCH -
1370  * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1371  * EOB_ACT_END_OF_FILE - end of file
1372  */
1373 static int yy_get_next_buffer (void)
1374 {
1375  register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1376  register char *source = (yytext_ptr);
1377  register int number_to_move, i;
1378  int ret_val;
1379 
1380  if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1382  "fatal flex scanner internal error--end of buffer missed" );
1383 
1384  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1385  { /* Don't try to fill the buffer, so this is an EOF. */
1386  if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1387  {
1388  /* We matched a single character, the EOB, so
1389  * treat this as a final EOF.
1390  */
1391  return EOB_ACT_END_OF_FILE;
1392  }
1393 
1394  else
1395  {
1396  /* We matched some text prior to the EOB, first
1397  * process it.
1398  */
1399  return EOB_ACT_LAST_MATCH;
1400  }
1401  }
1402 
1403  /* Try to read more data. */
1404 
1405  /* First move last chars to start of buffer. */
1406  number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1407 
1408  for ( i = 0; i < number_to_move; ++i )
1409  *(dest++) = *(source++);
1410 
1411  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1412  /* don't do the read, it's not guaranteed to return an EOF,
1413  * just force an EOF
1414  */
1415  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1416 
1417  else
1418  {
1419  int num_to_read =
1420  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1421 
1422  while ( num_to_read <= 0 )
1423  { /* Not enough room in the buffer - grow it. */
1424 
1425  /* just a shorter name for the current buffer */
1426  YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1427 
1428  int yy_c_buf_p_offset =
1429  (int) ((yy_c_buf_p) - b->yy_ch_buf);
1430 
1431  if ( b->yy_is_our_buffer )
1432  {
1433  int new_size = b->yy_buf_size * 2;
1434 
1435  if ( new_size <= 0 )
1436  b->yy_buf_size += b->yy_buf_size / 8;
1437  else
1438  b->yy_buf_size *= 2;
1439 
1440  b->yy_ch_buf = (char *)
1441  /* Include room in for 2 EOB chars. */
1442  yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1443  }
1444  else
1445  /* Can't grow it, we don't own it. */
1446  b->yy_ch_buf = 0;
1447 
1448  if ( ! b->yy_ch_buf )
1450  "fatal error - scanner input buffer overflow" );
1451 
1452  (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1453 
1454  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1455  number_to_move - 1;
1456 
1457  }
1458 
1459  if ( num_to_read > YY_READ_BUF_SIZE )
1460  num_to_read = YY_READ_BUF_SIZE;
1461 
1462  /* Read in more data. */
1463  YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1464  (yy_n_chars), (size_t) num_to_read );
1465 
1466  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1467  }
1468 
1469  if ( (yy_n_chars) == 0 )
1470  {
1471  if ( number_to_move == YY_MORE_ADJ )
1472  {
1473  ret_val = EOB_ACT_END_OF_FILE;
1474  yyrestart(yyin );
1475  }
1476 
1477  else
1478  {
1479  ret_val = EOB_ACT_LAST_MATCH;
1480  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1482  }
1483  }
1484 
1485  else
1486  ret_val = EOB_ACT_CONTINUE_SCAN;
1487 
1488  if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1489  /* Extend the array by 50%, plus the number we really need. */
1490  yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1491  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1492  if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1493  YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1494  }
1495 
1496  (yy_n_chars) += number_to_move;
1497  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1498  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1499 
1500  (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1501 
1502  return ret_val;
1503 }
1504 
1505 /* yy_get_previous_state - get the state just before the EOB char was reached */
1506 
1507  static yy_state_type yy_get_previous_state (void)
1508 {
1509  register yy_state_type yy_current_state;
1510  register char *yy_cp;
1511 
1512  yy_current_state = (yy_start);
1513 
1514  for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1515  {
1516  register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1517  if ( yy_accept[yy_current_state] )
1518  {
1519  (yy_last_accepting_state) = yy_current_state;
1520  (yy_last_accepting_cpos) = yy_cp;
1521  }
1522  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1523  {
1524  yy_current_state = (int) yy_def[yy_current_state];
1525  if ( yy_current_state >= 164 )
1526  yy_c = yy_meta[(unsigned int) yy_c];
1527  }
1528  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1529  }
1530 
1531  return yy_current_state;
1532 }
1533 
1534 /* yy_try_NUL_trans - try to make a transition on the NUL character
1535  *
1536  * synopsis
1537  * next_state = yy_try_NUL_trans( current_state );
1538  */
1539  static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1540 {
1541  register int yy_is_jam;
1542  register char *yy_cp = (yy_c_buf_p);
1543 
1544  register YY_CHAR yy_c = 1;
1545  if ( yy_accept[yy_current_state] )
1546  {
1547  (yy_last_accepting_state) = yy_current_state;
1548  (yy_last_accepting_cpos) = yy_cp;
1549  }
1550  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1551  {
1552  yy_current_state = (int) yy_def[yy_current_state];
1553  if ( yy_current_state >= 164 )
1554  yy_c = yy_meta[(unsigned int) yy_c];
1555  }
1556  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1557  yy_is_jam = (yy_current_state == 163);
1558 
1559  return yy_is_jam ? 0 : yy_current_state;
1560 }
1561 
1562  static void yyunput (int c, register char * yy_bp )
1563 {
1564  register char *yy_cp;
1565 
1566  yy_cp = (yy_c_buf_p);
1567 
1568  /* undo effects of setting up yytext */
1569  *yy_cp = (yy_hold_char);
1570 
1571  if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1572  { /* need to shift things up to make room */
1573  /* +2 for EOB chars. */
1574  register int number_to_move = (yy_n_chars) + 2;
1575  register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1576  YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1577  register char *source =
1578  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1579 
1580  while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1581  *--dest = *--source;
1582 
1583  yy_cp += (int) (dest - source);
1584  yy_bp += (int) (dest - source);
1585  YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1586  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1587 
1588  if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1589  YY_FATAL_ERROR( "flex scanner push-back overflow" );
1590  }
1591 
1592  *--yy_cp = (char) c;
1593 
1594  (yytext_ptr) = yy_bp;
1595  (yy_hold_char) = *yy_cp;
1596  (yy_c_buf_p) = yy_cp;
1597 }
1598 
1599 #ifndef YY_NO_INPUT
1600 #ifdef __cplusplus
1601  static int yyinput (void)
1602 #else
1603  static int input (void)
1604 #endif
1605 
1606 {
1607  int c;
1608 
1609  *(yy_c_buf_p) = (yy_hold_char);
1610 
1611  if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1612  {
1613  /* yy_c_buf_p now points to the character we want to return.
1614  * If this occurs *before* the EOB characters, then it's a
1615  * valid NUL; if not, then we've hit the end of the buffer.
1616  */
1617  if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1618  /* This was really a NUL. */
1619  *(yy_c_buf_p) = '\0';
1620 
1621  else
1622  { /* need more input */
1623  int offset = (yy_c_buf_p) - (yytext_ptr);
1624  ++(yy_c_buf_p);
1625 
1626  switch ( yy_get_next_buffer( ) )
1627  {
1628  case EOB_ACT_LAST_MATCH:
1629  /* This happens because yy_g_n_b()
1630  * sees that we've accumulated a
1631  * token and flags that we need to
1632  * try matching the token before
1633  * proceeding. But for input(),
1634  * there's no matching to consider.
1635  * So convert the EOB_ACT_LAST_MATCH
1636  * to EOB_ACT_END_OF_FILE.
1637  */
1638 
1639  /* Reset buffer status. */
1640  yyrestart(yyin );
1641 
1642  /*FALLTHROUGH*/
1643 
1644  case EOB_ACT_END_OF_FILE:
1645  {
1646  if ( yywrap( ) )
1647  return EOF;
1648 
1649  if ( ! (yy_did_buffer_switch_on_eof) )
1650  YY_NEW_FILE;
1651 #ifdef __cplusplus
1652  return yyinput();
1653 #else
1654  return input();
1655 #endif
1656  }
1657 
1658  case EOB_ACT_CONTINUE_SCAN:
1659  (yy_c_buf_p) = (yytext_ptr) + offset;
1660  break;
1661  }
1662  }
1663  }
1664 
1665  c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1666  *(yy_c_buf_p) = '\0'; /* preserve yytext */
1667  (yy_hold_char) = *++(yy_c_buf_p);
1668 
1669  return c;
1670 }
1671 #endif /* ifndef YY_NO_INPUT */
1672 
1678  void yyrestart (FILE * input_file )
1679 {
1680 
1681  if ( ! YY_CURRENT_BUFFER ){
1682  yyensure_buffer_stack ();
1685  }
1686 
1687  yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1688  yy_load_buffer_state( );
1689 }
1690 
1695  void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1696 {
1697 
1698  /* TODO. We should be able to replace this entire function body
1699  * with
1700  * yypop_buffer_state();
1701  * yypush_buffer_state(new_buffer);
1702  */
1703  yyensure_buffer_stack ();
1704  if ( YY_CURRENT_BUFFER == new_buffer )
1705  return;
1706 
1707  if ( YY_CURRENT_BUFFER )
1708  {
1709  /* Flush out information for old buffer. */
1710  *(yy_c_buf_p) = (yy_hold_char);
1711  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1712  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1713  }
1714 
1715  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1716  yy_load_buffer_state( );
1717 
1718  /* We don't actually know whether we did this switch during
1719  * EOF (yywrap()) processing, but the only time this flag
1720  * is looked at is after yywrap() is called, so it's safe
1721  * to go ahead and always set it.
1722  */
1723  (yy_did_buffer_switch_on_eof) = 1;
1724 }
1725 
1726 static void yy_load_buffer_state (void)
1727 {
1728  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1729  (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1730  yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1731  (yy_hold_char) = *(yy_c_buf_p);
1732 }
1733 
1740  YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1741 {
1742  YY_BUFFER_STATE b;
1743 
1744  b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1745  if ( ! b )
1746  YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1747 
1748  b->yy_buf_size = size;
1749 
1750  /* yy_ch_buf has to be 2 characters longer than the size given because
1751  * we need to put in 2 end-of-buffer characters.
1752  */
1753  b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1754  if ( ! b->yy_ch_buf )
1755  YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1756 
1757  b->yy_is_our_buffer = 1;
1758 
1759  yy_init_buffer(b,file );
1760 
1761  return b;
1762 }
1763 
1768  void yy_delete_buffer (YY_BUFFER_STATE b )
1769 {
1770 
1771  if ( ! b )
1772  return;
1773 
1774  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1776 
1777  if ( b->yy_is_our_buffer )
1778  yyfree((void *) b->yy_ch_buf );
1779 
1780  yyfree((void *) b );
1781 }
1782 
1783 #ifndef __cplusplus
1784 extern int isatty (int );
1785 #endif /* __cplusplus */
1786 
1787 /* Initializes or reinitializes a buffer.
1788  * This function is sometimes called more than once on the same buffer,
1789  * such as during a yyrestart() or at EOF.
1790  */
1791  static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1792 
1793 {
1794  int oerrno = errno;
1795 
1796  yy_flush_buffer(b );
1797 
1798  b->yy_input_file = file;
1799  b->yy_fill_buffer = 1;
1800 
1801  /* If b is the current buffer, then yy_init_buffer was _probably_
1802  * called from yyrestart() or through yy_get_next_buffer.
1803  * In that case, we don't want to reset the lineno or column.
1804  */
1805  if (b != YY_CURRENT_BUFFER){
1806  b->yy_bs_lineno = 1;
1807  b->yy_bs_column = 0;
1808  }
1809 
1810  b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1811 
1812  errno = oerrno;
1813 }
1814 
1819  void yy_flush_buffer (YY_BUFFER_STATE b )
1820 {
1821  if ( ! b )
1822  return;
1823 
1824  b->yy_n_chars = 0;
1825 
1826  /* We always need two end-of-buffer characters. The first causes
1827  * a transition to the end-of-buffer state. The second causes
1828  * a jam in that state.
1829  */
1832 
1833  b->yy_buf_pos = &b->yy_ch_buf[0];
1834 
1835  b->yy_at_bol = 1;
1837 
1838  if ( b == YY_CURRENT_BUFFER )
1839  yy_load_buffer_state( );
1840 }
1841 
1848 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1849 {
1850  if (new_buffer == NULL)
1851  return;
1852 
1853  yyensure_buffer_stack();
1854 
1855  /* This block is copied from yy_switch_to_buffer. */
1856  if ( YY_CURRENT_BUFFER )
1857  {
1858  /* Flush out information for old buffer. */
1859  *(yy_c_buf_p) = (yy_hold_char);
1860  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1861  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1862  }
1863 
1864  /* Only push if top exists. Otherwise, replace top. */
1865  if (YY_CURRENT_BUFFER)
1866  (yy_buffer_stack_top)++;
1867  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1868 
1869  /* copied from yy_switch_to_buffer. */
1870  yy_load_buffer_state( );
1871  (yy_did_buffer_switch_on_eof) = 1;
1872 }
1873 
1879 {
1880  if (!YY_CURRENT_BUFFER)
1881  return;
1882 
1885  if ((yy_buffer_stack_top) > 0)
1886  --(yy_buffer_stack_top);
1887 
1888  if (YY_CURRENT_BUFFER) {
1889  yy_load_buffer_state( );
1890  (yy_did_buffer_switch_on_eof) = 1;
1891  }
1892 }
1893 
1894 /* Allocates the stack if it does not exist.
1895  * Guarantees space for at least one push.
1896  */
1897 static void yyensure_buffer_stack (void)
1898 {
1899  int num_to_alloc;
1900 
1901  if (!(yy_buffer_stack)) {
1902 
1903  /* First allocation is just for 2 elements, since we don't know if this
1904  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1905  * immediate realloc on the next call.
1906  */
1907  num_to_alloc = 1;
1908  (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1909  (num_to_alloc * sizeof(struct yy_buffer_state*)
1910  );
1911  if ( ! (yy_buffer_stack) )
1912  YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1913 
1914  memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1915 
1916  (yy_buffer_stack_max) = num_to_alloc;
1917  (yy_buffer_stack_top) = 0;
1918  return;
1919  }
1920 
1921  if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1922 
1923  /* Increase the buffer to prepare for a possible push. */
1924  int grow_size = 8 /* arbitrary grow size */;
1925 
1926  num_to_alloc = (yy_buffer_stack_max) + grow_size;
1927  (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1928  ((yy_buffer_stack),
1929  num_to_alloc * sizeof(struct yy_buffer_state*)
1930  );
1931  if ( ! (yy_buffer_stack) )
1932  YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1933 
1934  /* zero only the new slots.*/
1935  memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1936  (yy_buffer_stack_max) = num_to_alloc;
1937  }
1938 }
1939 
1946 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1947 {
1948  YY_BUFFER_STATE b;
1949 
1950  if ( size < 2 ||
1951  base[size-2] != YY_END_OF_BUFFER_CHAR ||
1952  base[size-1] != YY_END_OF_BUFFER_CHAR )
1953  /* They forgot to leave room for the EOB's. */
1954  return 0;
1955 
1956  b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1957  if ( ! b )
1958  YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1959 
1960  b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1961  b->yy_buf_pos = b->yy_ch_buf = base;
1962  b->yy_is_our_buffer = 0;
1963  b->yy_input_file = 0;
1964  b->yy_n_chars = b->yy_buf_size;
1965  b->yy_is_interactive = 0;
1966  b->yy_at_bol = 1;
1967  b->yy_fill_buffer = 0;
1969 
1970  yy_switch_to_buffer(b );
1971 
1972  return b;
1973 }
1974 
1983 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1984 {
1985 
1986  return yy_scan_bytes(yystr,strlen(yystr) );
1987 }
1988 
1996 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1997 {
1998  YY_BUFFER_STATE b;
1999  char *buf;
2000  yy_size_t n;
2001  int i;
2002 
2003  /* Get memory for full buffer, including space for trailing EOB's. */
2004  n = _yybytes_len + 2;
2005  buf = (char *) yyalloc(n );
2006  if ( ! buf )
2007  YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2008 
2009  for ( i = 0; i < _yybytes_len; ++i )
2010  buf[i] = yybytes[i];
2011 
2012  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2013 
2014  b = yy_scan_buffer(buf,n );
2015  if ( ! b )
2016  YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2017 
2018  /* It's okay to grow etc. this buffer, and we should throw it
2019  * away when we're done.
2020  */
2021  b->yy_is_our_buffer = 1;
2022 
2023  return b;
2024 }
2025 
2026 #ifndef YY_EXIT_FAILURE
2027 #define YY_EXIT_FAILURE 2
2028 #endif
2029 
2030 static void yy_fatal_error (yyconst char* msg )
2031 {
2032  (void) fprintf( stderr, "%s\n", msg );
2033  exit( YY_EXIT_FAILURE );
2034 }
2035 
2036 /* Redefine yyless() so it works in section 3 code. */
2037 
2038 #undef yyless
2039 #define yyless(n) \
2040  do \
2041  { \
2042  /* Undo effects of setting up yytext. */ \
2043  int yyless_macro_arg = (n); \
2044  YY_LESS_LINENO(yyless_macro_arg);\
2045  yytext[yyleng] = (yy_hold_char); \
2046  (yy_c_buf_p) = yytext + yyless_macro_arg; \
2047  (yy_hold_char) = *(yy_c_buf_p); \
2048  *(yy_c_buf_p) = '\0'; \
2049  yyleng = yyless_macro_arg; \
2050  } \
2051  while ( 0 )
2052 
2053 /* Accessor methods (get/set functions) to struct members. */
2054 
2058 int yyget_lineno (void)
2059 {
2060 
2061  return yylineno;
2062 }
2063 
2067 FILE *yyget_in (void)
2068 {
2069  return yyin;
2070 }
2071 
2075 FILE *yyget_out (void)
2076 {
2077  return yyout;
2078 }
2079 
2083 int yyget_leng (void)
2084 {
2085  return yyleng;
2086 }
2087 
2092 char *yyget_text (void)
2093 {
2094  return yytext;
2095 }
2096 
2101 void yyset_lineno (int line_number )
2102 {
2103 
2104  yylineno = line_number;
2105 }
2106 
2113 void yyset_in (FILE * in_str )
2114 {
2115  yyin = in_str ;
2116 }
2117 
2118 void yyset_out (FILE * out_str )
2119 {
2120  yyout = out_str ;
2121 }
2122 
2123 int yyget_debug (void)
2124 {
2125  return yy_flex_debug;
2126 }
2127 
2128 void yyset_debug (int bdebug )
2129 {
2130  yy_flex_debug = bdebug ;
2131 }
2132 
2133 static int yy_init_globals (void)
2134 {
2135  /* Initialization is the same as for the non-reentrant scanner.
2136  * This function is called from yylex_destroy(), so don't allocate here.
2137  */
2138 
2139  (yy_buffer_stack) = 0;
2140  (yy_buffer_stack_top) = 0;
2141  (yy_buffer_stack_max) = 0;
2142  (yy_c_buf_p) = (char *) 0;
2143  (yy_init) = 0;
2144  (yy_start) = 0;
2145 
2146 /* Defined in main.c */
2147 #ifdef YY_STDINIT
2148  yyin = stdin;
2149  yyout = stdout;
2150 #else
2151  yyin = (FILE *) 0;
2152  yyout = (FILE *) 0;
2153 #endif
2154 
2155  /* For future reference: Set errno on error, since we are called by
2156  * yylex_init()
2157  */
2158  return 0;
2159 }
2160 
2161 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2162 int yylex_destroy (void)
2163 {
2164 
2165  /* Pop the buffer stack, destroying each element. */
2166  while(YY_CURRENT_BUFFER){
2170  }
2171 
2172  /* Destroy the stack itself. */
2173  yyfree((yy_buffer_stack) );
2174  (yy_buffer_stack) = NULL;
2175 
2176  /* Reset the globals. This is important in a non-reentrant scanner so the next time
2177  * yylex() is called, initialization will occur. */
2178  yy_init_globals( );
2179 
2180  return 0;
2181 }
2182 
2183 /*
2184  * Internal utility routines.
2185  */
2186 
2187 #ifndef yytext_ptr
2188 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2189 {
2190  register int i;
2191  for ( i = 0; i < n; ++i )
2192  s1[i] = s2[i];
2193 }
2194 #endif
2195 
2196 #ifdef YY_NEED_STRLEN
2197 static int yy_flex_strlen (yyconst char * s )
2198 {
2199  register int n;
2200  for ( n = 0; s[n]; ++n )
2201  ;
2202 
2203  return n;
2204 }
2205 #endif
2206 
2208 {
2209  return (void *) malloc( size );
2210 }
2211 
2212 void *yyrealloc (void * ptr, yy_size_t size )
2213 {
2214  /* The cast to (char *) in the following accommodates both
2215  * implementations that use char* generic pointers, and those
2216  * that use void* generic pointers. It works with the latter
2217  * because both ANSI C and C++ allow castless assignment from
2218  * any pointer type to void*, and deal with argument conversions
2219  * as though doing an assignment.
2220  */
2221  return (void *) realloc( (char *) ptr, size );
2222 }
2223 
2224 void yyfree (void * ptr )
2225 {
2226  free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2227 }
2228 
2229 #define YYTABLES_NAME "yytables"
2230 
2231 #line 209 "lex.l"
2232 
2233 
2234 /**********************************************************************
2235  *
2236  * C-CODE
2237  *
2238  **********************************************************************/
2239 
2240 
2241 
2242 /**********************************************************************
2243  * my_yyinput
2244  *
2245  * Lexer will ask this function for input when it requires more.
2246  *
2247  **********************************************************************/
2248 int my_yyinput(char *buf, int max_size)
2249 {
2250  int rest, n;
2251 
2252  rest = sqlpStmt->stmt + strlen( sqlpStmt->stmt) - sqlpStmt->cur;
2253  n = ( max_size < rest ? max_size : rest );
2254 
2255  if ( n > 0 )
2256  {
2257  memcpy( buf, sqlpStmt->cur, n );
2258  sqlpStmt->cur += n;
2259  }
2260 
2261  return n;
2262 }
2263 
2264 /**********************************************************************
2265  * yyerror
2266  *
2267  * This should be called just before failing. It formats a meaningfull
2268  * message and deposits it in a usefull place.
2269  *
2270  **********************************************************************/
2271 void yyerror( char *s )
2272 {
2273  snprintf( sqlpStmt->errmsg, 500, "%s processing '%s'", s, yytext );
2274 
2275 #ifdef YY_CURRENT_BUFFER
2277 #endif
2278 
2279 }
2280 
2281 /**********************************************************************
2282  * yywrap
2283  *
2284  * We are not doing any buffer switching but lets not use the Flex version of
2285  * of this func anyway so we can avoid the link dependency.
2286  *
2287  **********************************************************************/
2288 int yywrap()
2289 {
2290  return 1;
2291 }
2292 
2293 
#define NOT
Definition: y.tab.c:174
#define EOB_ACT_CONTINUE_SCAN
Definition: lex.yy.c:168
signed char flex_int8_t
Definition: lex.yy.c:50
void yyrestart(FILE *input_file)
Definition: lex.yy.c:1678
int yy_n_chars
Definition: lex.yy.c:212
float b
Definition: named_colr.c:8
void * yyrealloc(void *, yy_size_t)
Definition: lex.yy.c:2212
double floatval
Definition: y.tab.c:201
int yy_state_type
Definition: lex.yy.c:347
#define YY_BREAK
Definition: lex.yy.c:767
#define DELETE
Definition: y.tab.c:166
#define unput(c)
Definition: lex.yy.c:188
YY_EXTRA_TYPE yyget_extra(void)
#define ORDER
Definition: y.tab.c:186
#define DESC
Definition: y.tab.c:190
int
Definition: y.tab.c:1344
int yy_fill_buffer
Definition: lex.yy.c:239
struct yy_buffer_state * YY_BUFFER_STATE
Definition: lex.yy.c:161
#define PRECISION
Definition: y.tab.c:183
#define INTO
Definition: y.tab.c:168
#define YY_STATE_EOF(state)
Definition: lex.yy.c:135
#define TIME
Definition: y.tab.c:185
int intval
Definition: y.tab.c:200
#define yymore()
Definition: lex.yy.c:559
#define YY_RESTORE_YY_MORE_OFFSET
Definition: lex.yy.c:561
void yyfree(void *)
Definition: lex.yy.c:2224
YY_BUFFER_STATE yy_scan_string(yyconst char *yy_str)
Definition: lex.yy.c:1983
char * yyget_text(void)
Definition: lex.yy.c:2092
int yy_bs_lineno
Definition: lex.yy.c:233
#define YY_MORE_ADJ
Definition: lex.yy.c:560
void yyset_out(FILE *out_str)
Definition: lex.yy.c:2118
#define TABLE
Definition: y.tab.c:176
#define STRING
Definition: y.tab.c:156
#define YY_DECL
Definition: lex.yy.c:755
FILE * yyin
Definition: lex.yy.c:345
#define EQUAL
Definition: y.tab.c:162
void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer)
Definition: lex.yy.c:1695
#define EOB_ACT_LAST_MATCH
Definition: lex.yy.c:170
char * strval
Definition: y.tab.c:202
#define YY_CURRENT_BUFFER
Definition: lex.yy.c:271
char * yy_buf_pos
Definition: lex.yy.c:202
int yyget_lineno(void)
Definition: lex.yy.c:2058
int flex_int32_t
Definition: lex.yy.c:52
yy_size_t yy_buf_size
Definition: lex.yy.c:207
#define YY_DO_BEFORE_ACTION
Definition: lex.yy.c:364
void yypush_buffer_state(YY_BUFFER_STATE new_buffer)
Definition: lex.yy.c:1848
void yyset_debug(int debug_flag)
Definition: lex.yy.c:2128
#define INT
Definition: y.tab.c:180
#define INSERT
Definition: y.tab.c:167
int yylineno
Definition: lex.yy.c:351
#define UPDATE
Definition: y.tab.c:170
#define YY_INPUT(b, r, ms)
Definition: lex.yy.c:590
#define INITIAL
Definition: lex.yy.c:596
#define VALUES
Definition: y.tab.c:169
FILE * yyget_in(void)
Definition: lex.yy.c:2067
#define CREATE
Definition: y.tab.c:177
tuple size
value.Bind(wx.EVT_TEXT, self.OnVolumeIsosurfMap)
Definition: tools.py:2329
unsigned int flex_uint32_t
Definition: lex.yy.c:55
YYSTYPE yylval
#define YY_READ_BUF_SIZE
Definition: lex.yy.c:679
#define YY_BUFFER_NORMAL
Definition: lex.yy.c:244
#define YY_BUFFER_NEW
Definition: lex.yy.c:243
int yy_bs_column
Definition: lex.yy.c:234
void yyset_in(FILE *in_str)
Definition: lex.yy.c:2113
int yyget_leng(void)
Definition: lex.yy.c:2083
size_t yy_size_t
Definition: lex.yy.c:192
unsigned short int flex_uint16_t
Definition: lex.yy.c:54
#define YY_CURRENT_BUFFER_LVALUE
Definition: lex.yy.c:278
#define DOUBLE
Definition: y.tab.c:182
#define ECHO
Definition: lex.yy.c:688
YY_BUFFER_STATE yy_scan_bytes(yyconst char *bytes, int len)
Definition: lex.yy.c:1996
#define WHERE
Definition: y.tab.c:165
#define YY_END_OF_BUFFER
Definition: lex.yy.c:373
#define YY_END_OF_BUFFER_CHAR
Definition: lex.yy.c:140
#define yyconst
Definition: lex.yy.c:108
#define FLOATNUM
Definition: y.tab.c:158
int isatty(int)
int yywrap(void)
Definition: lex.yy.c:2288
#define BY
Definition: y.tab.c:187
#define YY_BUFFER_EOF_PENDING
Definition: lex.yy.c:255
void yyerror(char *s)
Definition: lex.yy.c:2271
#define EOB_ACT_END_OF_FILE
Definition: lex.yy.c:169
#define ASC
Definition: y.tab.c:189
#define COLUMN
Definition: y.tab.c:161
#define INTEGER
Definition: y.tab.c:181
#define NAME
Definition: y.tab.c:155
void * yyalloc(yy_size_t)
Definition: lex.yy.c:2207
#define YY_FATAL_ERROR(msg)
Definition: lex.yy.c:742
int yy_is_our_buffer
Definition: lex.yy.c:218
YY_BUFFER_STATE yy_scan_buffer(char *base, yy_size_t size)
Definition: lex.yy.c:1946
if(!YY_CURRENT_BUFFER)
Definition: lex.yy.c:810
short int flex_int16_t
Definition: lex.yy.c:51
int yylex(void)
char * yy_ch_buf
Definition: lex.yy.c:201
char buf[GNAME_MAX+sizeof(G3D_DIRECTORY)+2]
Definition: g3drange.c:62
FILE * yyout
Definition: lex.yy.c:345
#define YY_EXTRA_TYPE
Definition: lex.yy.c:607
#define YY_SC_TO_UI(c)
Definition: lex.yy.c:119
#define INTNUM
Definition: y.tab.c:157
#define ALTER
Definition: y.tab.c:175
return NULL
Definition: dbfopen.c:1394
#define SET
Definition: y.tab.c:171
register char * yy_bp
Definition: lex.yy.c:778
tuple msg
Definition: wxnviz.py:32
unsigned char YY_CHAR
Definition: lex.yy.c:343
flex_int32_t yy_verify
Definition: lex.yy.c:378
int yyleng
Definition: lex.yy.c:283
#define YY_RULE_SETUP
Definition: lex.yy.c:770
#define SELECT
Definition: y.tab.c:163
#define NULL_VALUE
Definition: y.tab.c:178
register int yy_act
Definition: lex.yy.c:779
#define YY_START
Definition: lex.yy.c:131
int yylex_destroy(void)
Definition: lex.yy.c:2162
#define file
void yy_flush_buffer(YY_BUFFER_STATE b)
Definition: lex.yy.c:1819
int yy_flex_debug
Definition: lex.yy.c:551
#define OR
Definition: y.tab.c:173
FILE * yy_input_file
Definition: lex.yy.c:199
unsigned char flex_uint8_t
Definition: lex.yy.c:53
#define YY_BUF_SIZE
Definition: lex.yy.c:151
flex_int32_t yy_nxt
Definition: lex.yy.c:379
void yypop_buffer_state(void)
Definition: lex.yy.c:1878
#define AND
Definition: y.tab.c:172
int yy_is_interactive
Definition: lex.yy.c:225
int errno
#define FROM
Definition: y.tab.c:164
FILE * yyget_out(void)
Definition: lex.yy.c:2075
YY_BUFFER_STATE yy_create_buffer(FILE *file, int size)
Definition: lex.yy.c:1740
#define COMPARISON_OPERATOR
Definition: y.tab.c:154
#define ADD
Definition: y.tab.c:159
void yy_delete_buffer(YY_BUFFER_STATE b)
Definition: lex.yy.c:1768
int yyget_debug(void)
Definition: lex.yy.c:2123
#define VARCHAR
Definition: y.tab.c:179
char * yytext
Definition: lex.yy.c:562
#define YY_EXIT_FAILURE
Definition: lex.yy.c:2027
#define IS
Definition: y.tab.c:188
int n
Definition: dataquad.c:291
int yy_buffer_status
Definition: lex.yy.c:241
#define DROP
Definition: y.tab.c:160
#define yytext_ptr
Definition: lex.yy.c:354
void yyset_lineno(int line_number)
Definition: lex.yy.c:2101
void yyset_extra(YY_EXTRA_TYPE user_defined)
#define DATE
Definition: y.tab.c:184
#define YY_NEW_FILE
Definition: lex.yy.c:138
register char * yy_cp
Definition: lex.yy.c:778
#define yyterminate()
Definition: lex.yy.c:732
int my_yyinput(char *buf, int max_size)
Definition: lex.yy.c:2248