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