PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches
lwin_wkt_lex.c
Go to the documentation of this file.
1#line 1 "lwin_wkt_lex.c"
2
3#line 3 "lwin_wkt_lex.c"
4
5#define YY_INT_ALIGNED short int
6
7/* A lexical scanner generated by flex */
8
9#define yy_create_buffer wkt_yy_create_buffer
10#define yy_delete_buffer wkt_yy_delete_buffer
11#define yy_scan_buffer wkt_yy_scan_buffer
12#define yy_scan_string wkt_yy_scan_string
13#define yy_scan_bytes wkt_yy_scan_bytes
14#define yy_init_buffer wkt_yy_init_buffer
15#define yy_flush_buffer wkt_yy_flush_buffer
16#define yy_load_buffer_state wkt_yy_load_buffer_state
17#define yy_switch_to_buffer wkt_yy_switch_to_buffer
18#define yypush_buffer_state wkt_yypush_buffer_state
19#define yypop_buffer_state wkt_yypop_buffer_state
20#define yyensure_buffer_stack wkt_yyensure_buffer_stack
21#define yy_flex_debug wkt_yy_flex_debug
22#define yyin wkt_yyin
23#define yyleng wkt_yyleng
24#define yylex wkt_yylex
25#define yylineno wkt_yylineno
26#define yyout wkt_yyout
27#define yyrestart wkt_yyrestart
28#define yytext wkt_yytext
29#define yywrap wkt_yywrap
30#define yyalloc wkt_yyalloc
31#define yyrealloc wkt_yyrealloc
32#define yyfree wkt_yyfree
33
34#define FLEX_SCANNER
35#define YY_FLEX_MAJOR_VERSION 2
36#define YY_FLEX_MINOR_VERSION 6
37#define YY_FLEX_SUBMINOR_VERSION 4
38#if YY_FLEX_SUBMINOR_VERSION > 0
39#define FLEX_BETA
40#endif
41
42#ifdef yy_create_buffer
43#define wkt_yy_create_buffer_ALREADY_DEFINED
44#else
45#define yy_create_buffer wkt_yy_create_buffer
46#endif
47
48#ifdef yy_delete_buffer
49#define wkt_yy_delete_buffer_ALREADY_DEFINED
50#else
51#define yy_delete_buffer wkt_yy_delete_buffer
52#endif
53
54#ifdef yy_scan_buffer
55#define wkt_yy_scan_buffer_ALREADY_DEFINED
56#else
57#define yy_scan_buffer wkt_yy_scan_buffer
58#endif
59
60#ifdef yy_scan_string
61#define wkt_yy_scan_string_ALREADY_DEFINED
62#else
63#define yy_scan_string wkt_yy_scan_string
64#endif
65
66#ifdef yy_scan_bytes
67#define wkt_yy_scan_bytes_ALREADY_DEFINED
68#else
69#define yy_scan_bytes wkt_yy_scan_bytes
70#endif
71
72#ifdef yy_init_buffer
73#define wkt_yy_init_buffer_ALREADY_DEFINED
74#else
75#define yy_init_buffer wkt_yy_init_buffer
76#endif
77
78#ifdef yy_flush_buffer
79#define wkt_yy_flush_buffer_ALREADY_DEFINED
80#else
81#define yy_flush_buffer wkt_yy_flush_buffer
82#endif
83
84#ifdef yy_load_buffer_state
85#define wkt_yy_load_buffer_state_ALREADY_DEFINED
86#else
87#define yy_load_buffer_state wkt_yy_load_buffer_state
88#endif
89
90#ifdef yy_switch_to_buffer
91#define wkt_yy_switch_to_buffer_ALREADY_DEFINED
92#else
93#define yy_switch_to_buffer wkt_yy_switch_to_buffer
94#endif
95
96#ifdef yypush_buffer_state
97#define wkt_yypush_buffer_state_ALREADY_DEFINED
98#else
99#define yypush_buffer_state wkt_yypush_buffer_state
100#endif
101
102#ifdef yypop_buffer_state
103#define wkt_yypop_buffer_state_ALREADY_DEFINED
104#else
105#define yypop_buffer_state wkt_yypop_buffer_state
106#endif
107
108#ifdef yyensure_buffer_stack
109#define wkt_yyensure_buffer_stack_ALREADY_DEFINED
110#else
111#define yyensure_buffer_stack wkt_yyensure_buffer_stack
112#endif
113
114#ifdef yylex
115#define wkt_yylex_ALREADY_DEFINED
116#else
117#define yylex wkt_yylex
118#endif
119
120#ifdef yyrestart
121#define wkt_yyrestart_ALREADY_DEFINED
122#else
123#define yyrestart wkt_yyrestart
124#endif
125
126#ifdef yylex_init
127#define wkt_yylex_init_ALREADY_DEFINED
128#else
129#define yylex_init wkt_yylex_init
130#endif
131
132#ifdef yylex_init_extra
133#define wkt_yylex_init_extra_ALREADY_DEFINED
134#else
135#define yylex_init_extra wkt_yylex_init_extra
136#endif
137
138#ifdef yylex_destroy
139#define wkt_yylex_destroy_ALREADY_DEFINED
140#else
141#define yylex_destroy wkt_yylex_destroy
142#endif
143
144#ifdef yyget_debug
145#define wkt_yyget_debug_ALREADY_DEFINED
146#else
147#define yyget_debug wkt_yyget_debug
148#endif
149
150#ifdef yyset_debug
151#define wkt_yyset_debug_ALREADY_DEFINED
152#else
153#define yyset_debug wkt_yyset_debug
154#endif
155
156#ifdef yyget_extra
157#define wkt_yyget_extra_ALREADY_DEFINED
158#else
159#define yyget_extra wkt_yyget_extra
160#endif
161
162#ifdef yyset_extra
163#define wkt_yyset_extra_ALREADY_DEFINED
164#else
165#define yyset_extra wkt_yyset_extra
166#endif
167
168#ifdef yyget_in
169#define wkt_yyget_in_ALREADY_DEFINED
170#else
171#define yyget_in wkt_yyget_in
172#endif
173
174#ifdef yyset_in
175#define wkt_yyset_in_ALREADY_DEFINED
176#else
177#define yyset_in wkt_yyset_in
178#endif
179
180#ifdef yyget_out
181#define wkt_yyget_out_ALREADY_DEFINED
182#else
183#define yyget_out wkt_yyget_out
184#endif
185
186#ifdef yyset_out
187#define wkt_yyset_out_ALREADY_DEFINED
188#else
189#define yyset_out wkt_yyset_out
190#endif
191
192#ifdef yyget_leng
193#define wkt_yyget_leng_ALREADY_DEFINED
194#else
195#define yyget_leng wkt_yyget_leng
196#endif
197
198#ifdef yyget_text
199#define wkt_yyget_text_ALREADY_DEFINED
200#else
201#define yyget_text wkt_yyget_text
202#endif
203
204#ifdef yyget_lineno
205#define wkt_yyget_lineno_ALREADY_DEFINED
206#else
207#define yyget_lineno wkt_yyget_lineno
208#endif
209
210#ifdef yyset_lineno
211#define wkt_yyset_lineno_ALREADY_DEFINED
212#else
213#define yyset_lineno wkt_yyset_lineno
214#endif
215
216#ifdef yywrap
217#define wkt_yywrap_ALREADY_DEFINED
218#else
219#define yywrap wkt_yywrap
220#endif
221
222#ifdef yyalloc
223#define wkt_yyalloc_ALREADY_DEFINED
224#else
225#define yyalloc wkt_yyalloc
226#endif
227
228#ifdef yyrealloc
229#define wkt_yyrealloc_ALREADY_DEFINED
230#else
231#define yyrealloc wkt_yyrealloc
232#endif
233
234#ifdef yyfree
235#define wkt_yyfree_ALREADY_DEFINED
236#else
237#define yyfree wkt_yyfree
238#endif
239
240#ifdef yytext
241#define wkt_yytext_ALREADY_DEFINED
242#else
243#define yytext wkt_yytext
244#endif
245
246#ifdef yyleng
247#define wkt_yyleng_ALREADY_DEFINED
248#else
249#define yyleng wkt_yyleng
250#endif
251
252#ifdef yyin
253#define wkt_yyin_ALREADY_DEFINED
254#else
255#define yyin wkt_yyin
256#endif
257
258#ifdef yyout
259#define wkt_yyout_ALREADY_DEFINED
260#else
261#define yyout wkt_yyout
262#endif
263
264#ifdef yy_flex_debug
265#define wkt_yy_flex_debug_ALREADY_DEFINED
266#else
267#define yy_flex_debug wkt_yy_flex_debug
268#endif
269
270#ifdef yylineno
271#define wkt_yylineno_ALREADY_DEFINED
272#else
273#define yylineno wkt_yylineno
274#endif
275
276/* First, we deal with platform-specific or compiler-specific issues. */
277
278/* begin standard C headers. */
279#include <stdio.h>
280#include <string.h>
281#include <errno.h>
282#include <stdlib.h>
283
284/* end standard C headers. */
285
286/* flex integer type definitions */
287
288#ifndef FLEXINT_H
289#define FLEXINT_H
290
291/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
292
293#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
294
295/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
296 * if you want the limit (max/min) macros for int types.
297 */
298#ifndef __STDC_LIMIT_MACROS
299#define __STDC_LIMIT_MACROS 1
300#endif
301
302#include <inttypes.h>
303typedef int8_t flex_int8_t;
304typedef uint8_t flex_uint8_t;
305typedef int16_t flex_int16_t;
306typedef uint16_t flex_uint16_t;
307typedef int32_t flex_int32_t;
308typedef uint32_t flex_uint32_t;
309#else
310typedef signed char flex_int8_t;
311typedef short int flex_int16_t;
312typedef int flex_int32_t;
313typedef unsigned char flex_uint8_t;
314typedef unsigned short int flex_uint16_t;
315typedef unsigned int flex_uint32_t;
316
317/* Limits of integral types. */
318#ifndef INT8_MIN
319#define INT8_MIN (-128)
320#endif
321#ifndef INT16_MIN
322#define INT16_MIN (-32767-1)
323#endif
324#ifndef INT32_MIN
325#define INT32_MIN (-2147483647-1)
326#endif
327#ifndef INT8_MAX
328#define INT8_MAX (127)
329#endif
330#ifndef INT16_MAX
331#define INT16_MAX (32767)
332#endif
333#ifndef INT32_MAX
334#define INT32_MAX (2147483647)
335#endif
336#ifndef UINT8_MAX
337#define UINT8_MAX (255U)
338#endif
339#ifndef UINT16_MAX
340#define UINT16_MAX (65535U)
341#endif
342#ifndef UINT32_MAX
343#define UINT32_MAX (4294967295U)
344#endif
345
346#ifndef SIZE_MAX
347#define SIZE_MAX (~(size_t)0)
348#endif
349
350#endif /* ! C99 */
351
352#endif /* ! FLEXINT_H */
353
354/* begin standard C++ headers. */
355
356/* TODO: this is always defined, so inline it */
357#define yyconst const
358
359#if defined(__GNUC__) && __GNUC__ >= 3
360#define yynoreturn __attribute__((__noreturn__))
361#else
362#define yynoreturn
363#endif
364
365/* Returned upon end-of-file. */
366#define YY_NULL 0
367
368/* Promotes a possibly negative, possibly signed char to an
369 * integer in range [0..255] for use as an array index.
370 */
371#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
372
373/* Enter a start condition. This macro really ought to take a parameter,
374 * but we do it the disgusting crufty way forced on us by the ()-less
375 * definition of BEGIN.
376 */
377#define BEGIN (yy_start) = 1 + 2 *
378/* Translate the current start state into a value that can be later handed
379 * to BEGIN to return to the state. The YYSTATE alias is for lex
380 * compatibility.
381 */
382#define YY_START (((yy_start) - 1) / 2)
383#define YYSTATE YY_START
384/* Action number for EOF rule of a given start state. */
385#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
386/* Special action meaning "start processing a new file". */
387#define YY_NEW_FILE yyrestart( yyin )
388#define YY_END_OF_BUFFER_CHAR 0
389
390/* Size of default input buffer. */
391#ifndef YY_BUF_SIZE
392#ifdef __ia64__
393/* On IA-64, the buffer size is 16k, not 8k.
394 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
395 * Ditto for the __ia64__ case accordingly.
396 */
397#define YY_BUF_SIZE 32768
398#else
399#define YY_BUF_SIZE 16384
400#endif /* __ia64__ */
401#endif
402
403/* The state buf must be large enough to hold one state per character in the main buffer.
404 */
405#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
406
407#ifndef YY_TYPEDEF_YY_BUFFER_STATE
408#define YY_TYPEDEF_YY_BUFFER_STATE
410#endif
411
412#ifndef YY_TYPEDEF_YY_SIZE_T
413#define YY_TYPEDEF_YY_SIZE_T
414typedef size_t yy_size_t;
415#endif
416
417extern int yyleng;
418
419extern FILE *yyin, *yyout;
420
421#define EOB_ACT_CONTINUE_SCAN 0
422#define EOB_ACT_END_OF_FILE 1
423#define EOB_ACT_LAST_MATCH 2
424
425 #define YY_LESS_LINENO(n)
426 #define YY_LINENO_REWIND_TO(ptr)
427
428/* Return all but the first "n" matched characters back to the input stream. */
429#define yyless(n) \
430 do \
431 { \
432 /* Undo effects of setting up yytext. */ \
433 int yyless_macro_arg = (n); \
434 YY_LESS_LINENO(yyless_macro_arg);\
435 *yy_cp = (yy_hold_char); \
436 YY_RESTORE_YY_MORE_OFFSET \
437 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
438 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
439 } \
440 while ( 0 )
441#define unput(c) yyunput( c, (yytext_ptr) )
442
443#ifndef YY_STRUCT_YY_BUFFER_STATE
444#define YY_STRUCT_YY_BUFFER_STATE
446 {
448
449 char *yy_ch_buf; /* input buffer */
450 char *yy_buf_pos; /* current position in input buffer */
451
452 /* Size of input buffer in bytes, not including room for EOB
453 * characters.
454 */
456
457 /* Number of characters read into yy_ch_buf, not including EOB
458 * characters.
459 */
461
462 /* Whether we "own" the buffer - i.e., we know we created it,
463 * and can realloc() it to grow it, and should free() it to
464 * delete it.
465 */
467
468 /* Whether this is an "interactive" input source; if so, and
469 * if we're using stdio for input, then we want to use getc()
470 * instead of fread(), to make sure we stop fetching input after
471 * each newline.
472 */
474
475 /* Whether we're considered to be at the beginning of a line.
476 * If so, '^' rules will be active on the next match, otherwise
477 * not.
478 */
480
484 /* Whether to try to fill the input buffer when we reach the
485 * end of it.
486 */
488
490
491#define YY_BUFFER_NEW 0
492#define YY_BUFFER_NORMAL 1
493 /* When an EOF's been seen but there's still some text to process
494 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
495 * shouldn't try reading from the input source any more. We might
496 * still have a bunch of tokens to match, though, because of
497 * possible backing-up.
498 *
499 * When we actually see the EOF, we change the status to "new"
500 * (via yyrestart()), so that the user can continue scanning by
501 * just pointing yyin at a new input file.
502 */
503#define YY_BUFFER_EOF_PENDING 2
504
505 };
506#endif /* !YY_STRUCT_YY_BUFFER_STATE */
507
508/* Stack of input buffers. */
509static size_t yy_buffer_stack_top = 0;
510static size_t yy_buffer_stack_max = 0;
513/* We provide macros for accessing buffer states in case in the
514 * future we want to put the buffer states in a more general
515 * "scanner state".
516 *
517 * Returns the top of the stack, or NULL.
518 */
519#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
520 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
521 : NULL)
522/* Same as previous macro, but useful when we know that the buffer stack is not
523 * NULL or when we need an lvalue. For internal use only.
524 */
525#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
526
527/* yy_hold_char holds the character lost when yytext is formed. */
528static char yy_hold_char;
529static int yy_n_chars; /* number of characters read into yy_ch_buf */
531
532/* Points to current character in buffer. */
533static char *yy_c_buf_p = NULL;
534static int yy_init = 0; /* whether we need to initialize */
535static int yy_start = 0; /* start state number */
536
537/* Flag which is used to allow yywrap()'s to do buffer switches
538 * instead of setting up a fresh yyin. A bit of a hack ...
539 */
541
542void yyrestart ( FILE *input_file );
544YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
548void yypop_buffer_state ( void );
549
550static void yyensure_buffer_stack ( void );
551static void yy_load_buffer_state ( void );
552static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
553#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
554
556YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
557YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
558
560void *yyrealloc ( void *, yy_size_t );
561void yyfree ( void * );
562
563#define yy_new_buffer yy_create_buffer
564#define yy_set_interactive(is_interactive) \
565 { \
566 if ( ! YY_CURRENT_BUFFER ){ \
567 yyensure_buffer_stack (); \
568 YY_CURRENT_BUFFER_LVALUE = \
569 yy_create_buffer( yyin, YY_BUF_SIZE ); \
570 } \
571 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
572 }
573#define yy_set_bol(at_bol) \
574 { \
575 if ( ! YY_CURRENT_BUFFER ){\
576 yyensure_buffer_stack (); \
577 YY_CURRENT_BUFFER_LVALUE = \
578 yy_create_buffer( yyin, YY_BUF_SIZE ); \
579 } \
580 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
581 }
582#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
583
584/* Begin user sect3 */
585
586#define wkt_yywrap() (/*CONSTCOND*/1)
587#define YY_SKIP_YYWRAP
589
590FILE *yyin = NULL, *yyout = NULL;
591
592typedef int yy_state_type;
593
594extern int yylineno;
595int yylineno = 1;
596
597extern char *yytext;
598#ifdef yytext_ptr
599#undef yytext_ptr
600#endif
601#define yytext_ptr yytext
602
605static int yy_get_next_buffer ( void );
606static void yynoreturn yy_fatal_error ( const char* msg );
607
608/* Done after the current pattern has been matched and before the
609 * corresponding action - sets up yytext.
610 */
611#define YY_DO_BEFORE_ACTION \
612 (yytext_ptr) = yy_bp; \
613 yyleng = (int) (yy_cp - yy_bp); \
614 (yy_hold_char) = *yy_cp; \
615 *yy_cp = '\0'; \
616 (yy_c_buf_p) = yy_cp;
617#define YY_NUM_RULES 26
618#define YY_END_OF_BUFFER 27
619/* This struct is not used in this scanner,
620 but its presence is necessary. */
626static const flex_int16_t yy_accept[173] =
627 { 0,
628 0, 0, 27, 25, 24, 24, 20, 21, 22, 25,
629 25, 25, 23, 25, 25, 25, 25, 19, 25, 25,
630 25, 19, 24, 0, 0, 0, 1, 0, 0, 0,
631 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
632 19, 0, 0, 0, 0, 0, 0, 0, 0, 0,
633 0, 0, 0, 16, 0, 0, 0, 0, 0, 0,
634 0, 0, 0, 0, 0, 0, 0, 0, 0, 18,
635 0, 0, 0, 17, 0, 0, 0, 0, 0, 0,
636 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
637 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
638
639 0, 10, 0, 0, 0, 0, 0, 0, 0, 0,
640 0, 0, 0, 0, 0, 15, 0, 0, 0, 0,
641 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
642 0, 13, 6, 0, 8, 0, 0, 0, 0, 0,
643 0, 0, 0, 0, 0, 0, 0, 0, 9, 0,
644 0, 5, 4, 0, 0, 11, 0, 0, 0, 12,
645 0, 0, 0, 0, 7, 0, 0, 0, 0, 14,
646 3, 0
647 } ;
648
649static const YY_CHAR yy_ec[256] =
650 { 0,
651 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
652 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
653 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
654 1, 2, 1, 1, 1, 1, 1, 1, 1, 4,
655 5, 1, 6, 7, 8, 9, 1, 10, 10, 10,
656 10, 10, 10, 10, 10, 10, 10, 1, 11, 1,
657 12, 1, 1, 1, 13, 1, 14, 15, 16, 17,
658 18, 19, 20, 1, 1, 21, 22, 23, 24, 25,
659 1, 26, 27, 28, 29, 30, 1, 1, 31, 32,
660 1, 1, 1, 1, 1, 1, 33, 1, 34, 35,
661
662 36, 37, 38, 39, 40, 1, 1, 41, 42, 43,
663 44, 45, 1, 46, 47, 48, 49, 50, 1, 1,
664 51, 52, 1, 1, 1, 1, 1, 1, 1, 1,
665 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
666 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
667 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
668 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
669 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
670 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
671 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
672
673 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
674 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
675 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
676 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
677 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
678 1, 1, 1, 1, 1
679 } ;
680
681static const YY_CHAR yy_meta[53] =
682 { 0,
683 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
684 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
685 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
686 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
687 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
688 1, 1
689 } ;
690
691static const flex_int16_t yy_base[173] =
692 { 0,
693 0, 0, 202, 384, 51, 53, 384, 384, 384, 48,
694 190, 57, 384, 41, 41, 52, 49, 42, 48, 48,
695 56, 53, 75, 186, 0, 96, 384, 106, 109, 54,
696 62, 61, 80, 86, 91, 97, 100, 102, 100, 104,
697 384, 179, 126, 112, 102, 105, 109, 117, 129, 120,
698 126, 119, 136, 384, 139, 124, 130, 140, 127, 144,
699 134, 142, 135, 148, 85, 141, 154, 148, 154, 384,
700 157, 160, 195, 384, 166, 175, 184, 175, 185, 178,
701 179, 178, 180, 178, 192, 190, 186, 194, 204, 76,
702 69, 204, 202, 215, 210, 202, 218, 215, 220, 226,
703
704 218, 384, 223, 236, 227, 241, 225, 243, 236, 230,
705 246, 242, 237, 253, 258, 384, 245, 249, 263, 259,
706 266, 270, 260, 261, 274, 281, 274, 270, 271, 275,
707 279, 384, 384, 274, 384, 281, 294, 283, 291, 283,
708 295, 300, 297, 301, 310, 298, 306, 316, 384, 318,
709 315, 384, 384, 310, 319, 384, 325, 317, 325, 384,
710 317, 330, 337, 331, 384, 339, 334, 345, 340, 384,
711 384, 384
712 } ;
713
714static const flex_int16_t yy_def[173] =
715 { 0,
716 172, 1, 172, 172, 172, 172, 172, 172, 172, 172,
717 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
718 172, 172, 172, 172, 12, 172, 172, 172, 172, 172,
719 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
720 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
721 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
722 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
723 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
724 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
725 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
726
727 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
728 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
729 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
730 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
731 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
732 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
733 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
734 172, 0
735 } ;
736
737static const flex_int16_t yy_nxt[437] =
738 { 0,
739 4, 5, 6, 7, 8, 4, 9, 10, 11, 12,
740 13, 4, 4, 14, 4, 15, 4, 16, 4, 4,
741 17, 18, 4, 4, 19, 4, 20, 21, 4, 4,
742 4, 22, 4, 14, 4, 15, 4, 16, 4, 4,
743 17, 18, 4, 4, 19, 4, 20, 21, 4, 4,
744 4, 22, 23, 23, 23, 23, 24, 25, 27, 27,
745 30, 27, 33, 27, 31, 28, 25, 34, 35, 32,
746 36, 37, 29, 38, 41, 39, 23, 23, 91, 44,
747 30, 40, 33, 45, 31, 91, 46, 34, 35, 32,
748 36, 37, 29, 38, 41, 39, 77, 27, 27, 44,
749
750 27, 40, 27, 45, 47, 26, 46, 27, 27, 48,
751 27, 29, 27, 49, 42, 26, 42, 50, 43, 51,
752 52, 53, 54, 55, 47, 56, 57, 27, 27, 48,
753 27, 29, 27, 49, 58, 43, 59, 50, 60, 51,
754 52, 53, 54, 55, 61, 56, 57, 62, 63, 64,
755 65, 66, 67, 68, 58, 69, 59, 70, 60, 71,
756 72, 73, 74, 78, 61, 75, 76, 62, 63, 64,
757 65, 66, 67, 68, 79, 69, 80, 70, 81, 71,
758 72, 73, 74, 78, 82, 75, 76, 83, 43, 88,
759 89, 90, 92, 91, 79, 26, 80, 93, 81, 26,
760
761 94, 172, 95, 96, 82, 97, 98, 83, 84, 88,
762 89, 99, 92, 100, 101, 85, 102, 93, 103, 86,
763 94, 87, 95, 96, 104, 97, 98, 105, 84, 106,
764 107, 99, 108, 100, 101, 85, 102, 109, 103, 86,
765 110, 87, 111, 114, 104, 112, 113, 105, 115, 106,
766 107, 116, 108, 117, 118, 119, 120, 109, 121, 122,
767 110, 123, 111, 114, 124, 112, 113, 125, 115, 126,
768 127, 116, 128, 117, 118, 119, 120, 129, 121, 122,
769 130, 123, 131, 132, 124, 133, 134, 125, 135, 126,
770 127, 136, 128, 137, 138, 139, 140, 129, 141, 142,
771
772 130, 143, 131, 132, 144, 133, 134, 145, 135, 146,
773 147, 136, 148, 137, 138, 139, 140, 149, 141, 142,
774 150, 143, 151, 152, 144, 153, 154, 145, 155, 146,
775 147, 156, 148, 157, 158, 159, 160, 149, 161, 162,
776 150, 163, 151, 152, 164, 153, 154, 165, 155, 166,
777 167, 156, 168, 157, 158, 159, 160, 169, 161, 162,
778 170, 163, 171, 172, 164, 172, 172, 165, 172, 166,
779 167, 172, 168, 172, 172, 172, 172, 169, 172, 172,
780 170, 172, 171, 3, 172, 172, 172, 172, 172, 172,
781 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
782
783 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
784 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
785 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
786 172, 172, 172, 172, 172, 172
787 } ;
788
789static const flex_int16_t yy_chk[437] =
790 { 0,
791 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
792 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
793 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
794 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
795 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
796 1, 1, 5, 5, 6, 6, 10, 10, 12, 12,
797 14, 12, 15, 12, 14, 12, 12, 16, 17, 14,
798 18, 19, 12, 20, 22, 21, 23, 23, 91, 30,
799 14, 21, 15, 31, 14, 90, 32, 16, 17, 14,
800 18, 19, 12, 20, 22, 21, 65, 26, 26, 30,
801
802 26, 21, 26, 31, 33, 26, 32, 28, 28, 34,
803 28, 26, 28, 35, 29, 28, 29, 36, 29, 37,
804 37, 38, 39, 40, 33, 44, 45, 43, 43, 34,
805 43, 26, 43, 35, 46, 43, 47, 36, 48, 37,
806 37, 38, 39, 40, 49, 44, 45, 50, 51, 52,
807 53, 55, 56, 57, 46, 58, 47, 59, 48, 60,
808 61, 62, 63, 66, 49, 64, 64, 50, 51, 52,
809 53, 55, 56, 57, 67, 58, 68, 59, 69, 60,
810 61, 62, 63, 66, 71, 64, 64, 72, 42, 75,
811 76, 77, 78, 77, 67, 24, 68, 79, 69, 11,
812
813 80, 3, 81, 82, 71, 83, 84, 72, 73, 75,
814 76, 85, 78, 86, 87, 73, 88, 79, 89, 73,
815 80, 73, 81, 82, 92, 83, 84, 93, 73, 94,
816 95, 85, 96, 86, 87, 73, 88, 97, 89, 73,
817 98, 73, 99, 101, 92, 100, 100, 93, 103, 94,
818 95, 104, 96, 105, 106, 107, 108, 97, 109, 110,
819 98, 111, 99, 101, 112, 100, 100, 113, 103, 114,
820 115, 104, 117, 105, 106, 107, 108, 118, 109, 110,
821 119, 111, 120, 121, 112, 122, 123, 113, 124, 114,
822 115, 125, 117, 126, 127, 128, 129, 118, 130, 131,
823
824 119, 134, 120, 121, 136, 122, 123, 137, 124, 138,
825 139, 125, 140, 126, 127, 128, 129, 141, 130, 131,
826 142, 134, 143, 144, 136, 145, 146, 137, 147, 138,
827 139, 148, 140, 150, 151, 154, 155, 141, 157, 158,
828 142, 159, 143, 144, 161, 145, 146, 162, 147, 163,
829 164, 148, 166, 150, 151, 154, 155, 167, 157, 158,
830 168, 159, 169, 0, 161, 0, 0, 162, 0, 163,
831 164, 0, 166, 0, 0, 0, 0, 167, 0, 0,
832 168, 0, 169, 172, 172, 172, 172, 172, 172, 172,
833 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
834
835 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
836 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
837 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
838 172, 172, 172, 172, 172, 172
839 } ;
840
843
844extern int yy_flex_debug;
846
847/* The intent behind this definition is that it'll catch
848 * any uses of REJECT which flex missed.
849 */
850#define REJECT reject_used_but_not_detected
851#define yymore() yymore_used_but_not_detected
852#define YY_MORE_ADJ 0
853#define YY_RESTORE_YY_MORE_OFFSET
854char *yytext;
855#line 1 "lwin_wkt_lex.l"
856#line 2 "lwin_wkt_lex.l"
857
858/* The lexer */
859
860#include <stdio.h>
861#include <string.h>
862#include "lwin_wkt.h"
863#include "lwin_wkt_parse.h"
864#include "lwgeom_log.h"
865
867
868/*
869* Handle errors due to unexpected junk in WKT strings.
870*/
878
879/*
880* This macro is magically run after a rule is found but before the main
881* action is run. We use it to update the parse location information
882* so we can report on where things fail. Also optionally to dump
883* debugging info.
884*/
885#define YY_USER_ACTION do { \
886 wkt_yylloc.first_line = wkt_yylloc.last_line = yylineno; \
887 wkt_yylloc.first_column = wkt_yylloc.last_column; \
888 wkt_yylloc.last_column += yyleng; \
889 LWDEBUGF(5,"lex: %s", wkt_yytext); \
890 } while (0);
891
892
893#line 893 "lwin_wkt_lex.c"
894#define YY_NO_INPUT 1
895/* Suppress the default implementations. */
896#line 896 "lwin_wkt_lex.c"
897
898#define INITIAL 0
899
900#ifndef YY_NO_UNISTD_H
901/* Special case for "unistd.h", since it is non-ANSI. We include it way
902 * down here because we want the user's section 1 to have been scanned first.
903 * The user has a chance to override it with an option.
904 */
905#include <unistd.h>
906#endif
907
908#ifndef YY_EXTRA_TYPE
909#define YY_EXTRA_TYPE void *
910#endif
911
912static int yy_init_globals ( void );
913
914/* Accessor methods to globals.
915 These are made visible to non-reentrant scanners for convenience. */
916
917int yylex_destroy ( void );
918
919int yyget_debug ( void );
920
921void yyset_debug ( int debug_flag );
922
924
925void yyset_extra ( YY_EXTRA_TYPE user_defined );
926
927FILE *yyget_in ( void );
928
929void yyset_in ( FILE * _in_str );
930
931FILE *yyget_out ( void );
932
933void yyset_out ( FILE * _out_str );
934
935 int yyget_leng ( void );
936
937char *yyget_text ( void );
938
939int yyget_lineno ( void );
940
941void yyset_lineno ( int _line_number );
942
943/* Macros after this point can all be overridden by user definitions in
944 * section 1.
945 */
946
947#ifndef YY_SKIP_YYWRAP
948#ifdef __cplusplus
949extern "C" int yywrap ( void );
950#else
951extern int yywrap ( void );
952#endif
953#endif
954
955#ifndef YY_NO_UNPUT
956
957#endif
958
959#ifndef yytext_ptr
960static void yy_flex_strncpy ( char *, const char *, int );
961#endif
962
963#ifdef YY_NEED_STRLEN
964static int yy_flex_strlen ( const char * );
965#endif
966
967#ifndef YY_NO_INPUT
968#ifdef __cplusplus
969static int yyinput ( void );
970#else
971static int input ( void );
972#endif
973
974#endif
975
976/* Amount of stuff to slurp up with each read. */
977#ifndef YY_READ_BUF_SIZE
978#ifdef __ia64__
979/* On IA-64, the buffer size is 16k, not 8k */
980#define YY_READ_BUF_SIZE 16384
981#else
982#define YY_READ_BUF_SIZE 8192
983#endif /* __ia64__ */
984#endif
985
986/* Copy whatever the last rule matched to the standard output. */
987#ifndef ECHO
988/* This used to be an fputs(), but since the string might contain NUL's,
989 * we now use fwrite().
990 */
991#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
992#endif
993
994/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
995 * is returned in "result".
996 */
997#ifndef YY_INPUT
998#define YY_INPUT(buf,result,max_size) \
999 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1000 { \
1001 int c = '*'; \
1002 int n; \
1003 for ( n = 0; n < max_size && \
1004 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1005 buf[n] = (char) c; \
1006 if ( c == '\n' ) \
1007 buf[n++] = (char) c; \
1008 if ( c == EOF && ferror( yyin ) ) \
1009 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1010 result = n; \
1011 } \
1012 else \
1013 { \
1014 errno=0; \
1015 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
1016 { \
1017 if( errno != EINTR) \
1018 { \
1019 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1020 break; \
1021 } \
1022 errno=0; \
1023 clearerr(yyin); \
1024 } \
1025 }\
1026\
1027
1028#endif
1029
1030/* No semi-colon after return; correct usage is to write "yyterminate();" -
1031 * we don't want an extra ';' after the "return" because that will cause
1032 * some compilers to complain about unreachable statements.
1033 */
1034#ifndef yyterminate
1035#define yyterminate() return YY_NULL
1036#endif
1037
1038/* Number of entries by which start-condition stack grows. */
1039#ifndef YY_START_STACK_INCR
1040#define YY_START_STACK_INCR 25
1041#endif
1042
1043/* Report a fatal error. */
1044#ifndef YY_FATAL_ERROR
1045#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1046#endif
1047
1048/* end tables serialization structures and prototypes */
1049
1050/* Default declaration of generated scanner - a define so the user can
1051 * easily add parameters.
1052 */
1053#ifndef YY_DECL
1054#define YY_DECL_IS_OURS 1
1055
1056extern int yylex (void);
1057
1058#define YY_DECL int yylex (void)
1059#endif /* !YY_DECL */
1060
1061/* Code executed at the beginning of each rule, after yytext and yyleng
1062 * have been set up.
1063 */
1064#ifndef YY_USER_ACTION
1065#define YY_USER_ACTION
1066#endif
1067
1068/* Code executed at the end of each rule. */
1069#ifndef YY_BREAK
1070#define YY_BREAK /*LINTED*/break;
1071#endif
1072
1073#define YY_RULE_SETUP \
1074 YY_USER_ACTION
1075
1079{
1080 yy_state_type yy_current_state;
1081 char *yy_cp, *yy_bp;
1083
1084 if ( !(yy_init) )
1085 {
1086 (yy_init) = 1;
1087
1088#ifdef YY_USER_INIT
1089 YY_USER_INIT;
1090#endif
1091
1092 if ( ! (yy_start) )
1093 (yy_start) = 1; /* first start state */
1094
1095 if ( ! yyin )
1096 yyin = stdin;
1097
1098 if ( ! yyout )
1099 yyout = stdout;
1100
1101 if ( ! YY_CURRENT_BUFFER ) {
1105 }
1106
1108 }
1109
1110 {
1111#line 49 "lwin_wkt_lex.l"
1112
1113
1114#line 1114 "lwin_wkt_lex.c"
1115
1116 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
1117 {
1118 yy_cp = (yy_c_buf_p);
1119
1120 /* Support of yytext. */
1121 *yy_cp = (yy_hold_char);
1122
1123 /* yy_bp points to the position in yy_ch_buf of the start of
1124 * the current run.
1125 */
1126 yy_bp = yy_cp;
1127
1128 yy_current_state = (yy_start);
1129yy_match:
1130 do
1131 {
1132 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1133 if ( yy_accept[yy_current_state] )
1134 {
1135 (yy_last_accepting_state) = yy_current_state;
1137 }
1138 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1139 {
1140 yy_current_state = (int) yy_def[yy_current_state];
1141 if ( yy_current_state >= 173 )
1142 yy_c = yy_meta[yy_c];
1143 }
1144 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1145 ++yy_cp;
1146 }
1147 while ( yy_current_state != 172 );
1149 yy_current_state = (yy_last_accepting_state);
1150
1151yy_find_action:
1152 yy_act = yy_accept[yy_current_state];
1153
1155
1156do_action: /* This label is used only to access EOF actions. */
1157
1158 switch ( yy_act )
1159 { /* beginning of action switch */
1160 case 0: /* must back up */
1161 /* undo the effects of YY_DO_BEFORE_ACTION */
1162 *yy_cp = (yy_hold_char);
1164 yy_current_state = (yy_last_accepting_state);
1165 goto yy_find_action;
1166
1167case 1:
1168/* rule 1 can match eol */
1170#line 51 "lwin_wkt_lex.l"
1171{
1172 LWDEBUG(5,"DOUBLE");
1173 wkt_yylval.doublevalue = atof(wkt_yytext);
1174 yyless(wkt_yyleng-1);
1175 return DOUBLE_TOK;
1176 }
1177 YY_BREAK
1178case 2:
1180#line 58 "lwin_wkt_lex.l"
1181{
1182 LWDEBUG(5,"SRID");
1184 return SRID_TOK;
1185 }
1186 YY_BREAK
1187case 3:
1189#line 64 "lwin_wkt_lex.l"
1190{ return COLLECTION_TOK; }
1191 YY_BREAK
1192case 4:
1194#line 65 "lwin_wkt_lex.l"
1195{ return MSURFACE_TOK; }
1196 YY_BREAK
1197case 5:
1199#line 66 "lwin_wkt_lex.l"
1200{ return MPOLYGON_TOK; }
1201 YY_BREAK
1202case 6:
1204#line 67 "lwin_wkt_lex.l"
1205{ return MCURVE_TOK; }
1206 YY_BREAK
1207case 7:
1209#line 68 "lwin_wkt_lex.l"
1210{ return MLINESTRING_TOK; }
1211 YY_BREAK
1212case 8:
1214#line 69 "lwin_wkt_lex.l"
1215{ return MPOINT_TOK; }
1216 YY_BREAK
1217case 9:
1219#line 70 "lwin_wkt_lex.l"
1220{ return CURVEPOLYGON_TOK; }
1221 YY_BREAK
1222case 10:
1224#line 71 "lwin_wkt_lex.l"
1225{ return POLYGON_TOK; }
1226 YY_BREAK
1227case 11:
1229#line 72 "lwin_wkt_lex.l"
1230{ return COMPOUNDCURVE_TOK; }
1231 YY_BREAK
1232case 12:
1234#line 73 "lwin_wkt_lex.l"
1235{ return CIRCULARSTRING_TOK; }
1236 YY_BREAK
1237case 13:
1239#line 74 "lwin_wkt_lex.l"
1240{ return LINESTRING_TOK; }
1241 YY_BREAK
1242case 14:
1244#line 75 "lwin_wkt_lex.l"
1245{ return POLYHEDRALSURFACE_TOK; }
1246 YY_BREAK
1247case 15:
1249#line 76 "lwin_wkt_lex.l"
1250{ return TRIANGLE_TOK; }
1251 YY_BREAK
1252case 16:
1254#line 77 "lwin_wkt_lex.l"
1255{ return TIN_TOK; }
1256 YY_BREAK
1257case 17:
1259#line 78 "lwin_wkt_lex.l"
1260{ return POINT_TOK; }
1261 YY_BREAK
1262case 18:
1264#line 79 "lwin_wkt_lex.l"
1265{ return EMPTY_TOK; }
1266 YY_BREAK
1267case 19:
1269#line 81 "lwin_wkt_lex.l"
1270{
1271 LWDEBUG(5,"DIMENSIONALITY");
1272 wkt_yylval.stringvalue = wkt_yytext;
1273 return DIMENSIONALITY_TOK;
1274 }
1275 YY_BREAK
1276case 20:
1278#line 87 "lwin_wkt_lex.l"
1279{ LWDEBUG(5,"LBRACKET"); return LBRACKET_TOK; }
1280 YY_BREAK
1281case 21:
1283#line 88 "lwin_wkt_lex.l"
1284{ LWDEBUG(5,"RBRACKET"); return RBRACKET_TOK; }
1285 YY_BREAK
1286case 22:
1288#line 89 "lwin_wkt_lex.l"
1289{ LWDEBUG(5,"COMMA"); return COMMA_TOK; }
1290 YY_BREAK
1291case 23:
1293#line 90 "lwin_wkt_lex.l"
1294{ LWDEBUG(5,"SEMICOLON"); return SEMICOLON_TOK; }
1295 YY_BREAK
1296case 24:
1297/* rule 24 can match eol */
1299#line 92 "lwin_wkt_lex.l"
1300{ /* ignore whitespace */ LWDEBUG(5,"WHITESPACE"); }
1301 YY_BREAK
1302case 25:
1304#line 94 "lwin_wkt_lex.l"
1305{ /* Error out and stop parsing on unknown/unexpected characters */
1306 LWDEBUG(5,"UNKNOWN");
1308 yyterminate();
1309 }
1310 YY_BREAK
1311case 26:
1313#line 100 "lwin_wkt_lex.l"
1314ECHO;
1315 YY_BREAK
1316#line 1316 "lwin_wkt_lex.c"
1317case YY_STATE_EOF(INITIAL):
1318 yyterminate();
1319
1320 case YY_END_OF_BUFFER:
1321 {
1322 /* Amount of text matched not including the EOB char. */
1323 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1324
1325 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1326 *yy_cp = (yy_hold_char);
1328
1329 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1330 {
1331 /* We're scanning a new file or input source. It's
1332 * possible that this happened because the user
1333 * just pointed yyin at a new source and called
1334 * yylex(). If so, then we have to assure
1335 * consistency between YY_CURRENT_BUFFER and our
1336 * globals. Here is the right place to do so, because
1337 * this is the first action (other than possibly a
1338 * back-up) that will match for the new input source.
1339 */
1340 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1341 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1342 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1343 }
1344
1345 /* Note that here we test for yy_c_buf_p "<=" to the position
1346 * of the first EOB in the buffer, since yy_c_buf_p will
1347 * already have been incremented past the NUL character
1348 * (since all states make transitions on EOB to the
1349 * end-of-buffer state). Contrast this with the test
1350 * in input().
1351 */
1352 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1353 { /* This was really a NUL. */
1354 yy_state_type yy_next_state;
1355
1356 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1357
1358 yy_current_state = yy_get_previous_state( );
1359
1360 /* Okay, we're now positioned to make the NUL
1361 * transition. We couldn't have
1362 * yy_get_previous_state() go ahead and do it
1363 * for us because it doesn't know how to deal
1364 * with the possibility of jamming (and we don't
1365 * want to build jamming into it because then it
1366 * will run more slowly).
1367 */
1368
1369 yy_next_state = yy_try_NUL_trans( yy_current_state );
1370
1372
1373 if ( yy_next_state )
1374 {
1375 /* Consume the NUL. */
1376 yy_cp = ++(yy_c_buf_p);
1377 yy_current_state = yy_next_state;
1378 goto yy_match;
1379 }
1380
1381 else
1382 {
1384 yy_current_state = (yy_last_accepting_state);
1385 goto yy_find_action;
1386 }
1387 }
1388
1389 else switch ( yy_get_next_buffer( ) )
1390 {
1392 {
1394
1395 if ( yywrap( ) )
1396 {
1397 /* Note: because we've taken care in
1398 * yy_get_next_buffer() to have set up
1399 * yytext, we can now set up
1400 * yy_c_buf_p so that if some total
1401 * hoser (like flex itself) wants to
1402 * call the scanner after we return the
1403 * YY_NULL, it'll still work - another
1404 * YY_NULL will get returned.
1405 */
1407
1409 goto do_action;
1410 }
1411
1412 else
1413 {
1416 }
1417 break;
1418 }
1419
1421 (yy_c_buf_p) =
1422 (yytext_ptr) + yy_amount_of_matched_text;
1423
1424 yy_current_state = yy_get_previous_state( );
1425
1426 yy_cp = (yy_c_buf_p);
1428 goto yy_match;
1429
1430 case EOB_ACT_LAST_MATCH:
1431 (yy_c_buf_p) =
1432 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1433
1434 yy_current_state = yy_get_previous_state( );
1435
1436 yy_cp = (yy_c_buf_p);
1438 goto yy_find_action;
1439 }
1440 break;
1441 }
1442
1443 default:
1445 "fatal flex scanner internal error--no action found" );
1446 } /* end of action switch */
1447 } /* end of scanning one token */
1448 } /* end of user's declarations */
1449} /* end of yylex */
1450
1451/* yy_get_next_buffer - try to read in a new buffer
1452 *
1453 * Returns a code representing an action:
1454 * EOB_ACT_LAST_MATCH -
1455 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1456 * EOB_ACT_END_OF_FILE - end of file
1457 */
1458static int yy_get_next_buffer (void)
1459{
1460 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1461 char *source = (yytext_ptr);
1462 int number_to_move, i;
1463 int ret_val;
1464
1465 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1467 "fatal flex scanner internal error--end of buffer missed" );
1468
1469 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1470 { /* Don't try to fill the buffer, so this is an EOF. */
1471 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1472 {
1473 /* We matched a single character, the EOB, so
1474 * treat this as a final EOF.
1475 */
1476 return EOB_ACT_END_OF_FILE;
1477 }
1478
1479 else
1480 {
1481 /* We matched some text prior to the EOB, first
1482 * process it.
1483 */
1484 return EOB_ACT_LAST_MATCH;
1485 }
1486 }
1487
1488 /* Try to read more data. */
1489
1490 /* First move last chars to start of buffer. */
1491 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1492
1493 for ( i = 0; i < number_to_move; ++i )
1494 *(dest++) = *(source++);
1495
1496 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1497 /* don't do the read, it's not guaranteed to return an EOF,
1498 * just force an EOF
1499 */
1500 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1501
1502 else
1503 {
1504 int num_to_read =
1505 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1506
1507 while ( num_to_read <= 0 )
1508 { /* Not enough room in the buffer - grow it. */
1509
1510 /* just a shorter name for the current buffer */
1512
1513 int yy_c_buf_p_offset =
1514 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1515
1516 if ( b->yy_is_our_buffer )
1517 {
1518 int new_size = b->yy_buf_size * 2;
1519
1520 if ( new_size <= 0 )
1521 b->yy_buf_size += b->yy_buf_size / 8;
1522 else
1523 b->yy_buf_size *= 2;
1524
1525 b->yy_ch_buf = (char *)
1526 /* Include room in for 2 EOB chars. */
1527 yyrealloc( (void *) b->yy_ch_buf,
1528 (yy_size_t) (b->yy_buf_size + 2) );
1529 }
1530 else
1531 /* Can't grow it, we don't own it. */
1532 b->yy_ch_buf = NULL;
1533
1534 if ( ! b->yy_ch_buf )
1536 "fatal error - scanner input buffer overflow" );
1537
1538 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1539
1540 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1541 number_to_move - 1;
1542
1543 }
1544
1545 if ( num_to_read > YY_READ_BUF_SIZE )
1546 num_to_read = YY_READ_BUF_SIZE;
1547
1548 /* Read in more data. */
1549 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1550 (yy_n_chars), num_to_read );
1551
1552 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1553 }
1554
1555 if ( (yy_n_chars) == 0 )
1556 {
1557 if ( number_to_move == YY_MORE_ADJ )
1558 {
1559 ret_val = EOB_ACT_END_OF_FILE;
1560 yyrestart( yyin );
1561 }
1562
1563 else
1564 {
1565 ret_val = EOB_ACT_LAST_MATCH;
1566 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1568 }
1569 }
1570
1571 else
1572 ret_val = EOB_ACT_CONTINUE_SCAN;
1573
1574 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1575 /* Extend the array by 50%, plus the number we really need. */
1576 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1577 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1578 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1579 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1580 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1581 /* "- 2" to take care of EOB's */
1582 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1583 }
1584
1585 (yy_n_chars) += number_to_move;
1588
1589 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1590
1591 return ret_val;
1592}
1593
1594/* yy_get_previous_state - get the state just before the EOB char was reached */
1595
1597{
1598 yy_state_type yy_current_state;
1599 char *yy_cp;
1600
1601 yy_current_state = (yy_start);
1602
1603 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1604 {
1605 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1606 if ( yy_accept[yy_current_state] )
1607 {
1608 (yy_last_accepting_state) = yy_current_state;
1610 }
1611 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1612 {
1613 yy_current_state = (int) yy_def[yy_current_state];
1614 if ( yy_current_state >= 173 )
1615 yy_c = yy_meta[yy_c];
1616 }
1617 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1618 }
1619
1620 return yy_current_state;
1621}
1622
1623/* yy_try_NUL_trans - try to make a transition on the NUL character
1624 *
1625 * synopsis
1626 * next_state = yy_try_NUL_trans( current_state );
1627 */
1628 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1629{
1630 int yy_is_jam;
1631 char *yy_cp = (yy_c_buf_p);
1632
1633 YY_CHAR yy_c = 1;
1634 if ( yy_accept[yy_current_state] )
1635 {
1636 (yy_last_accepting_state) = yy_current_state;
1638 }
1639 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1640 {
1641 yy_current_state = (int) yy_def[yy_current_state];
1642 if ( yy_current_state >= 173 )
1643 yy_c = yy_meta[yy_c];
1644 }
1645 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1646 yy_is_jam = (yy_current_state == 172);
1647
1648 return yy_is_jam ? 0 : yy_current_state;
1649}
1650
1651#ifndef YY_NO_UNPUT
1652
1653#endif
1654
1655#ifndef YY_NO_INPUT
1656#ifdef __cplusplus
1657 static int yyinput (void)
1658#else
1659 static int input (void)
1660#endif
1661
1662{
1663 int c;
1664
1665 *(yy_c_buf_p) = (yy_hold_char);
1666
1668 {
1669 /* yy_c_buf_p now points to the character we want to return.
1670 * If this occurs *before* the EOB characters, then it's a
1671 * valid NUL; if not, then we've hit the end of the buffer.
1672 */
1673 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1674 /* This was really a NUL. */
1675 *(yy_c_buf_p) = '\0';
1676
1677 else
1678 { /* need more input */
1679 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
1680 ++(yy_c_buf_p);
1681
1682 switch ( yy_get_next_buffer( ) )
1683 {
1684 case EOB_ACT_LAST_MATCH:
1685 /* This happens because yy_g_n_b()
1686 * sees that we've accumulated a
1687 * token and flags that we need to
1688 * try matching the token before
1689 * proceeding. But for input(),
1690 * there's no matching to consider.
1691 * So convert the EOB_ACT_LAST_MATCH
1692 * to EOB_ACT_END_OF_FILE.
1693 */
1694
1695 /* Reset buffer status. */
1696 yyrestart( yyin );
1697
1698 /*FALLTHROUGH*/
1699
1701 {
1702 if ( yywrap( ) )
1703 return 0;
1704
1707#ifdef __cplusplus
1708 return yyinput();
1709#else
1710 return input();
1711#endif
1712 }
1713
1715 (yy_c_buf_p) = (yytext_ptr) + offset;
1716 break;
1717 }
1718 }
1719 }
1720
1721 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1722 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1723 (yy_hold_char) = *++(yy_c_buf_p);
1724
1725 return c;
1726}
1727#endif /* ifndef YY_NO_INPUT */
1728
1734 void yyrestart (FILE * input_file )
1735{
1736
1737 if ( ! YY_CURRENT_BUFFER ){
1741 }
1742
1743 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1745}
1746
1751 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1752{
1753
1754 /* TODO. We should be able to replace this entire function body
1755 * with
1756 * yypop_buffer_state();
1757 * yypush_buffer_state(new_buffer);
1758 */
1760 if ( YY_CURRENT_BUFFER == new_buffer )
1761 return;
1762
1763 if ( YY_CURRENT_BUFFER )
1764 {
1765 /* Flush out information for old buffer. */
1766 *(yy_c_buf_p) = (yy_hold_char);
1767 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1768 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1769 }
1770
1771 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1773
1774 /* We don't actually know whether we did this switch during
1775 * EOF (yywrap()) processing, but the only time this flag
1776 * is looked at is after yywrap() is called, so it's safe
1777 * to go ahead and always set it.
1778 */
1780}
1781
1782static void yy_load_buffer_state (void)
1783{
1784 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1786 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1787 (yy_hold_char) = *(yy_c_buf_p);
1788}
1789
1796 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1797{
1799
1800 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1801 if ( ! b )
1802 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1803
1804 b->yy_buf_size = size;
1805
1806 /* yy_ch_buf has to be 2 characters longer than the size given because
1807 * we need to put in 2 end-of-buffer characters.
1808 */
1809 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
1810 if ( ! b->yy_ch_buf )
1811 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1812
1813 b->yy_is_our_buffer = 1;
1814
1815 yy_init_buffer( b, file );
1816
1817 return b;
1818}
1819
1825{
1826
1827 if ( ! b )
1828 return;
1829
1830 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1832
1833 if ( b->yy_is_our_buffer )
1834 yyfree( (void *) b->yy_ch_buf );
1835
1836 yyfree( (void *) b );
1837}
1838
1839/* Initializes or reinitializes a buffer.
1840 * This function is sometimes called more than once on the same buffer,
1841 * such as during a yyrestart() or at EOF.
1842 */
1843 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1844
1845{
1846 int oerrno = errno;
1847
1848 yy_flush_buffer( b );
1849
1850 b->yy_input_file = file;
1851 b->yy_fill_buffer = 1;
1852
1853 /* If b is the current buffer, then yy_init_buffer was _probably_
1854 * called from yyrestart() or through yy_get_next_buffer.
1855 * In that case, we don't want to reset the lineno or column.
1856 */
1857 if (b != YY_CURRENT_BUFFER){
1858 b->yy_bs_lineno = 1;
1859 b->yy_bs_column = 0;
1860 }
1861
1862 b->yy_is_interactive = 0;
1863
1864 errno = oerrno;
1865}
1866
1872{
1873 if ( ! b )
1874 return;
1875
1876 b->yy_n_chars = 0;
1877
1878 /* We always need two end-of-buffer characters. The first causes
1879 * a transition to the end-of-buffer state. The second causes
1880 * a jam in that state.
1881 */
1884
1885 b->yy_buf_pos = &b->yy_ch_buf[0];
1886
1887 b->yy_at_bol = 1;
1889
1890 if ( b == YY_CURRENT_BUFFER )
1892}
1893
1900void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1901{
1902 if (new_buffer == NULL)
1903 return;
1904
1906
1907 /* This block is copied from yy_switch_to_buffer. */
1908 if ( YY_CURRENT_BUFFER )
1909 {
1910 /* Flush out information for old buffer. */
1911 *(yy_c_buf_p) = (yy_hold_char);
1912 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1913 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1914 }
1915
1916 /* Only push if top exists. Otherwise, replace top. */
1919 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1920
1921 /* copied from yy_switch_to_buffer. */
1924}
1925
1930void yypop_buffer_state (void)
1931{
1932 if (!YY_CURRENT_BUFFER)
1933 return;
1934
1937 if ((yy_buffer_stack_top) > 0)
1939
1940 if (YY_CURRENT_BUFFER) {
1943 }
1944}
1945
1946/* Allocates the stack if it does not exist.
1947 * Guarantees space for at least one push.
1948 */
1949static void yyensure_buffer_stack (void)
1950{
1951 yy_size_t num_to_alloc;
1952
1953 if (!(yy_buffer_stack)) {
1954
1955 /* First allocation is just for 2 elements, since we don't know if this
1956 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1957 * immediate realloc on the next call.
1958 */
1959 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1961 (num_to_alloc * sizeof(struct yy_buffer_state*)
1962 );
1963 if ( ! (yy_buffer_stack) )
1964 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1965
1966 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1967
1968 (yy_buffer_stack_max) = num_to_alloc;
1969 (yy_buffer_stack_top) = 0;
1970 return;
1971 }
1972
1973 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1974
1975 /* Increase the buffer to prepare for a possible push. */
1976 yy_size_t grow_size = 8 /* arbitrary grow size */;
1977
1978 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1980 ((yy_buffer_stack),
1981 num_to_alloc * sizeof(struct yy_buffer_state*)
1982 );
1983 if ( ! (yy_buffer_stack) )
1984 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1985
1986 /* zero only the new slots.*/
1987 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1988 (yy_buffer_stack_max) = num_to_alloc;
1989 }
1990}
1991
1998YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1999{
2001
2002 if ( size < 2 ||
2003 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2004 base[size-1] != YY_END_OF_BUFFER_CHAR )
2005 /* They forgot to leave room for the EOB's. */
2006 return NULL;
2007
2008 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
2009 if ( ! b )
2010 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2011
2012 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
2013 b->yy_buf_pos = b->yy_ch_buf = base;
2014 b->yy_is_our_buffer = 0;
2015 b->yy_input_file = NULL;
2016 b->yy_n_chars = b->yy_buf_size;
2017 b->yy_is_interactive = 0;
2018 b->yy_at_bol = 1;
2019 b->yy_fill_buffer = 0;
2021
2023
2024 return b;
2025}
2026
2035YY_BUFFER_STATE yy_scan_string (const char * yystr )
2036{
2037
2038 return yy_scan_bytes( yystr, (int) strlen(yystr) );
2039}
2040
2048YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
2049{
2051 char *buf;
2052 yy_size_t n;
2053 int i;
2054
2055 /* Get memory for full buffer, including space for trailing EOB's. */
2056 n = (yy_size_t) (_yybytes_len + 2);
2057 buf = (char *) yyalloc( n );
2058 if ( ! buf )
2059 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2060
2061 for ( i = 0; i < _yybytes_len; ++i )
2062 buf[i] = yybytes[i];
2063
2064 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2065
2066 b = yy_scan_buffer( buf, n );
2067 if ( ! b )
2068 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2069
2070 /* It's okay to grow etc. this buffer, and we should throw it
2071 * away when we're done.
2072 */
2073 b->yy_is_our_buffer = 1;
2074
2075 return b;
2076}
2077
2078#ifndef YY_EXIT_FAILURE
2079#define YY_EXIT_FAILURE 2
2080#endif
2081
2082static void yynoreturn yy_fatal_error (const char* msg )
2083{
2084 fprintf( stderr, "%s\n", msg );
2085 exit( YY_EXIT_FAILURE );
2086}
2087
2088/* Redefine yyless() so it works in section 3 code. */
2089
2090#undef yyless
2091#define yyless(n) \
2092 do \
2093 { \
2094 /* Undo effects of setting up yytext. */ \
2095 int yyless_macro_arg = (n); \
2096 YY_LESS_LINENO(yyless_macro_arg);\
2097 yytext[yyleng] = (yy_hold_char); \
2098 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2099 (yy_hold_char) = *(yy_c_buf_p); \
2100 *(yy_c_buf_p) = '\0'; \
2101 yyleng = yyless_macro_arg; \
2102 } \
2103 while ( 0 )
2104
2105/* Accessor methods (get/set functions) to struct members. */
2106
2110int yyget_lineno (void)
2111{
2112
2113 return yylineno;
2114}
2115
2119FILE *yyget_in (void)
2120{
2121 return yyin;
2122}
2123
2127FILE *yyget_out (void)
2128{
2129 return yyout;
2130}
2131
2135int yyget_leng (void)
2136{
2137 return yyleng;
2138}
2139
2144char *yyget_text (void)
2145{
2146 return yytext;
2147}
2148
2153void yyset_lineno (int _line_number )
2154{
2155
2156 yylineno = _line_number;
2157}
2158
2165void yyset_in (FILE * _in_str )
2166{
2167 yyin = _in_str ;
2168}
2169
2170void yyset_out (FILE * _out_str )
2171{
2172 yyout = _out_str ;
2173}
2174
2175int yyget_debug (void)
2176{
2177 return yy_flex_debug;
2178}
2179
2180void yyset_debug (int _bdebug )
2181{
2182 yy_flex_debug = _bdebug ;
2183}
2184
2185static int yy_init_globals (void)
2186{
2187 /* Initialization is the same as for the non-reentrant scanner.
2188 * This function is called from yylex_destroy(), so don't allocate here.
2189 */
2190
2191 (yy_buffer_stack) = NULL;
2192 (yy_buffer_stack_top) = 0;
2193 (yy_buffer_stack_max) = 0;
2194 (yy_c_buf_p) = NULL;
2195 (yy_init) = 0;
2196 (yy_start) = 0;
2197
2198/* Defined in main.c */
2199#ifdef YY_STDINIT
2200 yyin = stdin;
2201 yyout = stdout;
2202#else
2203 yyin = NULL;
2204 yyout = NULL;
2205#endif
2206
2207 /* For future reference: Set errno on error, since we are called by
2208 * yylex_init()
2209 */
2210 return 0;
2211}
2212
2213/* yylex_destroy is for both reentrant and non-reentrant scanners. */
2214int yylex_destroy (void)
2215{
2216
2217 /* Pop the buffer stack, destroying each element. */
2218 while(YY_CURRENT_BUFFER){
2222 }
2223
2224 /* Destroy the stack itself. */
2226 (yy_buffer_stack) = NULL;
2227
2228 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2229 * yylex() is called, initialization will occur. */
2230 yy_init_globals( );
2231
2232 return 0;
2233}
2234
2235/*
2236 * Internal utility routines.
2237 */
2238
2239#ifndef yytext_ptr
2240static void yy_flex_strncpy (char* s1, const char * s2, int n )
2241{
2242
2243 int i;
2244 for ( i = 0; i < n; ++i )
2245 s1[i] = s2[i];
2246}
2247#endif
2248
2249#ifdef YY_NEED_STRLEN
2250static int yy_flex_strlen (const char * s )
2251{
2252 int n;
2253 for ( n = 0; s[n]; ++n )
2254 ;
2255
2256 return n;
2257}
2258#endif
2259
2260#define YYTABLES_NAME "yytables"
2261
2262#line 100 "lwin_wkt_lex.l"
2263
2264
2265void *wkt_yyalloc (yy_size_t size )
2266{
2267 return (void *) lwalloc( size );
2268}
2269
2270void *wkt_yyrealloc (void * ptr, yy_size_t size )
2271{
2272 return (void *) lwrealloc( (char *) ptr, size );
2273}
2274
2275void wkt_yyfree (void * ptr )
2276{
2277 lwfree( (char *) ptr ); /* see wkt_yyrealloc() for (char *) cast */
2278}
2279
2280/*
2281* Set up the lexer!
2282*/
2283void wkt_lexer_init(char *src)
2284{
2286 wkt_yy_buf_state = wkt_yy_scan_string(src);
2287}
2288
2289/*
2290* Clean up the lexer!
2291*/
2292void wkt_lexer_close()
2293{
2294 wkt_yy_delete_buffer(wkt_yy_buf_state);
2295}
2296
2297
char * s
Definition cu_in_wkt.c:23
void * lwrealloc(void *mem, size_t size)
Definition lwutil.c:235
#define PARSER_ERROR_OTHER
Definition liblwgeom.h:2092
void * lwalloc(size_t size)
Definition lwutil.c:227
void lwfree(void *mem)
Definition lwutil.c:242
#define LWDEBUG(level, msg)
Definition lwgeom_log.h:83
const char * parser_error_messages[]
Definition lwin_wkt.c:37
int wkt_lexer_read_srid(char *str)
Read the SRID number from an SRID=<> string.
Definition lwin_wkt.c:61
void wkt_lexer_close(void)
void wkt_lexer_init(char *str)
LWGEOM_PARSER_RESULT global_parser_result
#define yylex_destroy
#define YY_NEW_FILE
#define yyget_extra
#define yyset_extra
#define yyget_leng
unsigned char flex_uint8_t
#define yyset_lineno
static char yy_hold_char
#define yyleng
static yy_state_type yy_last_accepting_state
#define yyrestart
#define yyset_debug
static void yynoreturn yy_fatal_error(const char *msg)
#define YY_EXTRA_TYPE
#define yyout
static int yy_start
short int flex_int16_t
static YY_BUFFER_STATE * yy_buffer_stack
Stack as an array.
#define yytext
unsigned int flex_uint32_t
static int yy_get_next_buffer(void)
#define yy_scan_bytes
#define yylex
#define YY_BREAK
static size_t yy_buffer_stack_max
capacity of stack.
#define yynoreturn
#define yyget_text
static yy_state_type yy_try_NUL_trans(yy_state_type current_state)
int yy_act
#define yypush_buffer_state
struct yy_buffer_state * YY_BUFFER_STATE
#define yyfree
#define YY_BUFFER_NEW
#define YY_RESTORE_YY_MORE_OFFSET
static int yy_did_buffer_switch_on_eof
static int yy_init_globals(void)
#define yyget_lineno
#define yywrap
#define yylineno
static const flex_int16_t yy_accept[173]
#define YY_BUFFER_NORMAL
char * yy_cp
static const flex_int16_t yy_chk[437]
static void wkt_lexer_unknown()
#define yy_scan_buffer
#define YY_MORE_ADJ
#define YY_RULE_SETUP
#define yy_scan_string
#define yy_flex_debug
#define yytext_ptr
signed char flex_int8_t
#define EOB_ACT_END_OF_FILE
#define yyalloc
#define YY_CURRENT_BUFFER_LVALUE
#define yyget_debug
int flex_int32_t
#define yyin
#define YY_START
#define yyensure_buffer_stack
#define yy_switch_to_buffer
int yy_state_type
#define YY_CURRENT_BUFFER
#define yy_init_buffer
#define INITIAL
#define yypop_buffer_state
#define yyget_in
char * yy_bp
static int yy_n_chars
#define YY_READ_BUF_SIZE
#define YY_INPUT(buf, result, max_size)
#define ECHO
#define yy_flush_buffer
#define yyrealloc
#define YY_END_OF_BUFFER
#define YY_STATE_EOF(state)
#define YY_END_OF_BUFFER_CHAR
static const flex_int16_t yy_base[173]
static const flex_int16_t yy_nxt[437]
#define YY_FATAL_ERROR(msg)
#define yyget_out
#define yyterminate()
unsigned short int flex_uint16_t
static YY_BUFFER_STATE wkt_yy_buf_state
#define yy_create_buffer
Definition lwin_wkt_lex.c:9
flex_uint8_t YY_CHAR
#define YY_DO_BEFORE_ACTION
#define yy_delete_buffer
#define EOB_ACT_LAST_MATCH
size_t yy_size_t
#define YY_BUFFER_EOF_PENDING
static yy_state_type yy_get_previous_state(void)
static const YY_CHAR yy_ec[256]
#define yyset_out
static char * yy_c_buf_p
#define EOB_ACT_CONTINUE_SCAN
static size_t yy_buffer_stack_top
index of top of stack.
#define YY_DECL
#define yyless(n)
#define YY_BUF_SIZE
#define YY_EXIT_FAILURE
static int yy_init
static const flex_int16_t yy_def[173]
static const YY_CHAR yy_meta[53]
#define YY_SC_TO_UI(c)
#define yy_load_buffer_state
static char * yy_last_accepting_cpos
#define yyset_in
void * wkt_yyrealloc(void *ptr, yy_size_t size)
void * wkt_yyalloc(yy_size_t size)
void wkt_yyfree(void *ptr)
#define MPOLYGON_TOK
#define SRID_TOK
YYSTYPE wkt_yylval
#define SEMICOLON_TOK
#define POINT_TOK
#define LINESTRING_TOK
YYLTYPE wkt_yylloc
#define COLLECTION_TOK
#define TIN_TOK
#define POLYGON_TOK
#define DIMENSIONALITY_TOK
#define COMPOUNDCURVE_TOK
#define LBRACKET_TOK
#define COMMA_TOK
#define MCURVE_TOK
#define MSURFACE_TOK
#define CIRCULARSTRING_TOK
#define MPOINT_TOK
#define MLINESTRING_TOK
#define TRIANGLE_TOK
#define POLYHEDRALSURFACE_TOK
#define EMPTY_TOK
#define RBRACKET_TOK
#define DOUBLE_TOK
#define CURVEPOLYGON_TOK
int yy_bs_column
The column count.
int yy_bs_lineno
The line count.
flex_int32_t yy_verify
flex_int32_t yy_nxt
char * stringvalue
double doublevalue