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