PostGIS 3.7.0dev-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 27
618#define YY_END_OF_BUFFER 28
619/* This struct is not used in this scanner,
620 but its presence is necessary. */
626static const flex_int16_t yy_accept[177] =
627 { 0,
628 0, 0, 28, 26, 25, 25, 21, 22, 23, 26,
629 26, 26, 24, 26, 26, 26, 26, 20, 26, 26,
630 26, 26, 20, 25, 0, 0, 0, 1, 0, 0,
631 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
632 0, 0, 20, 0, 0, 0, 0, 0, 0, 0,
633 0, 0, 0, 0, 0, 0, 17, 0, 0, 0,
634 0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
635 0, 0, 0, 19, 0, 0, 0, 18, 0, 0,
636 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
637 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
638
639 0, 0, 0, 0, 0, 11, 0, 0, 0, 0,
640 0, 0, 0, 0, 0, 0, 0, 0, 0, 16,
641 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
642 0, 0, 0, 0, 0, 14, 7, 0, 9, 0,
643 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
644 0, 0, 10, 0, 0, 6, 5, 0, 0, 12,
645 0, 0, 0, 13, 0, 0, 0, 0, 8, 0,
646 0, 0, 0, 15, 4, 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[177] =
692 { 0,
693 0, 0, 374, 391, 51, 53, 391, 391, 391, 48,
694 362, 57, 391, 41, 41, 52, 49, 42, 59, 50,
695 49, 56, 55, 76, 361, 0, 96, 391, 106, 109,
696 54, 62, 61, 80, 86, 91, 97, 97, 101, 103,
697 101, 106, 391, 193, 126, 113, 110, 107, 111, 123,
698 132, 121, 149, 127, 122, 143, 391, 147, 132, 138,
699 147, 133, 150, 140, 151, 391, 144, 156, 189, 153,
700 156, 150, 160, 391, 160, 161, 196, 391, 169, 182,
701 192, 186, 193, 184, 187, 186, 188, 186, 196, 195,
702 191, 199, 210, 180, 76, 207, 203, 218, 217, 213,
703
704 226, 221, 227, 231, 228, 391, 229, 240, 230, 245,
705 229, 247, 239, 233, 249, 245, 238, 256, 265, 391,
706 256, 257, 269, 266, 273, 276, 267, 267, 278, 284,
707 278, 274, 275, 278, 282, 391, 391, 277, 391, 284,
708 295, 286, 298, 294, 303, 306, 304, 308, 316, 305,
709 312, 320, 391, 321, 319, 391, 391, 314, 323, 391,
710 328, 320, 328, 391, 320, 331, 340, 338, 391, 350,
711 342, 351, 347, 391, 391, 391
712 } ;
713
714static const flex_int16_t yy_def[177] =
715 { 0,
716 176, 1, 176, 176, 176, 176, 176, 176, 176, 176,
717 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
718 176, 176, 176, 176, 176, 12, 176, 176, 176, 176,
719 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
720 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
721 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
722 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
723 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
724 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
725 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
726
727 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
728 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
729 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
730 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
731 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
732 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
733 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
734 176, 176, 176, 176, 176, 0
735 } ;
736
737static const flex_int16_t yy_nxt[444] =
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, 19, 4, 20, 4, 21, 22, 4, 4,
742 4, 23, 4, 14, 4, 15, 4, 16, 4, 4,
743 17, 18, 19, 4, 20, 4, 21, 22, 4, 4,
744 4, 23, 24, 24, 24, 24, 25, 26, 28, 28,
745 31, 28, 34, 28, 32, 29, 26, 35, 36, 33,
746 37, 38, 30, 39, 40, 41, 43, 24, 24, 46,
747 31, 42, 34, 47, 32, 95, 48, 35, 36, 33,
748 37, 38, 30, 39, 40, 41, 43, 28, 28, 46,
749
750 28, 42, 28, 47, 49, 27, 48, 28, 28, 50,
751 28, 30, 28, 51, 44, 27, 44, 52, 45, 53,
752 54, 55, 56, 57, 49, 58, 59, 28, 28, 50,
753 28, 30, 28, 51, 60, 45, 61, 52, 62, 53,
754 54, 55, 56, 57, 63, 58, 59, 64, 65, 67,
755 66, 66, 68, 66, 60, 66, 61, 69, 62, 70,
756 71, 72, 73, 74, 63, 75, 76, 64, 65, 67,
757 77, 78, 68, 79, 80, 82, 83, 69, 84, 70,
758 71, 72, 73, 74, 85, 75, 76, 86, 87, 95,
759 77, 78, 92, 79, 80, 82, 83, 93, 84, 94,
760
761 81, 95, 45, 96, 85, 97, 98, 86, 87, 88,
762 99, 100, 92, 101, 102, 103, 89, 93, 104, 105,
763 90, 106, 91, 96, 107, 97, 98, 108, 109, 88,
764 99, 100, 110, 101, 102, 103, 89, 111, 104, 105,
765 90, 106, 91, 112, 107, 113, 114, 108, 109, 115,
766 116, 117, 110, 118, 119, 120, 121, 111, 122, 123,
767 124, 125, 126, 112, 127, 113, 114, 128, 129, 115,
768 116, 117, 130, 118, 119, 120, 121, 131, 122, 123,
769 124, 125, 126, 132, 127, 133, 134, 128, 129, 135,
770 136, 137, 130, 138, 139, 140, 141, 131, 142, 143,
771
772 144, 145, 146, 132, 147, 133, 134, 148, 149, 135,
773 136, 137, 150, 138, 139, 140, 141, 151, 142, 143,
774 144, 145, 146, 152, 147, 153, 154, 148, 149, 155,
775 156, 157, 150, 158, 159, 160, 161, 151, 162, 163,
776 164, 165, 166, 152, 167, 153, 154, 168, 169, 155,
777 156, 157, 170, 158, 159, 160, 161, 171, 162, 163,
778 164, 165, 166, 172, 167, 173, 174, 168, 169, 175,
779 27, 27, 170, 176, 176, 176, 176, 171, 176, 176,
780 176, 176, 176, 172, 176, 173, 174, 176, 176, 175,
781 3, 176, 176, 176, 176, 176, 176, 176, 176, 176,
782
783 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
784 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
785 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
786 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
787 176, 176, 176
788 } ;
789
790static const flex_int16_t yy_chk[444] =
791 { 0,
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, 1, 1, 1, 1, 1, 1, 1, 1,
797 1, 1, 5, 5, 6, 6, 10, 10, 12, 12,
798 14, 12, 15, 12, 14, 12, 12, 16, 17, 14,
799 18, 19, 12, 20, 21, 22, 23, 24, 24, 31,
800 14, 22, 15, 32, 14, 95, 33, 16, 17, 14,
801 18, 19, 12, 20, 21, 22, 23, 27, 27, 31,
802
803 27, 22, 27, 32, 34, 27, 33, 29, 29, 35,
804 29, 27, 29, 36, 30, 29, 30, 37, 30, 38,
805 39, 39, 40, 41, 34, 42, 46, 45, 45, 35,
806 45, 27, 45, 36, 47, 45, 48, 37, 49, 38,
807 39, 39, 40, 41, 50, 42, 46, 51, 52, 54,
808 53, 53, 55, 53, 47, 53, 48, 56, 49, 58,
809 59, 60, 61, 62, 50, 63, 64, 51, 52, 54,
810 65, 67, 55, 68, 68, 70, 71, 56, 72, 58,
811 59, 60, 61, 62, 73, 63, 64, 75, 76, 94,
812 65, 67, 79, 68, 68, 70, 71, 80, 72, 81,
813
814 69, 81, 44, 82, 73, 83, 84, 75, 76, 77,
815 85, 86, 79, 87, 88, 89, 77, 80, 90, 91,
816 77, 92, 77, 82, 93, 83, 84, 96, 97, 77,
817 85, 86, 98, 87, 88, 89, 77, 99, 90, 91,
818 77, 92, 77, 100, 93, 101, 102, 96, 97, 103,
819 104, 104, 98, 105, 107, 108, 109, 99, 110, 111,
820 112, 113, 114, 100, 115, 101, 102, 116, 117, 103,
821 104, 104, 118, 105, 107, 108, 109, 119, 110, 111,
822 112, 113, 114, 121, 115, 122, 123, 116, 117, 124,
823 125, 126, 118, 127, 128, 129, 130, 119, 131, 132,
824
825 133, 134, 135, 121, 138, 122, 123, 140, 141, 124,
826 125, 126, 142, 127, 128, 129, 130, 143, 131, 132,
827 133, 134, 135, 144, 138, 145, 146, 140, 141, 147,
828 148, 149, 142, 150, 151, 152, 154, 143, 155, 158,
829 159, 161, 162, 144, 163, 145, 146, 165, 166, 147,
830 148, 149, 167, 150, 151, 152, 154, 168, 155, 158,
831 159, 161, 162, 170, 163, 171, 172, 165, 166, 173,
832 25, 11, 167, 3, 0, 0, 0, 168, 0, 0,
833 0, 0, 0, 170, 0, 171, 172, 0, 0, 173,
834 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
835
836 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
837 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
838 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
839 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
840 176, 176, 176
841 } ;
842
845
846extern int yy_flex_debug;
848
849/* The intent behind this definition is that it'll catch
850 * any uses of REJECT which flex missed.
851 */
852#define REJECT reject_used_but_not_detected
853#define yymore() yymore_used_but_not_detected
854#define YY_MORE_ADJ 0
855#define YY_RESTORE_YY_MORE_OFFSET
856char *yytext;
857#line 1 "lwin_wkt_lex.l"
858#line 2 "lwin_wkt_lex.l"
859
860/* The lexer */
861
862#include <stdio.h>
863#include <string.h>
864#include "lwin_wkt.h"
865#include "lwin_wkt_parse.h"
866#include "lwgeom_log.h"
867
869
870/*
871* Handle errors due to unexpected junk in WKT strings.
872*/
880
881/*
882* This macro is magically run after a rule is found but before the main
883* action is run. We use it to update the parse location information
884* so we can report on where things fail. Also optionally to dump
885* debugging info.
886*/
887#define YY_USER_ACTION do { \
888 wkt_yylloc.first_line = wkt_yylloc.last_line = yylineno; \
889 wkt_yylloc.first_column = wkt_yylloc.last_column; \
890 wkt_yylloc.last_column += yyleng; \
891 LWDEBUGF(5,"lex: %s", wkt_yytext); \
892 } while (0);
893
894/*
895* Ensure we have a definition of NAN to use when encountering
896* NAN tokens.
897*/
898#ifndef _GNU_SOURCE
899#define _GNU_SOURCE
900#endif
901#include <math.h>
902#ifndef NAN
903#define NAN 0.0/0.0
904#endif
905
906#line 906 "lwin_wkt_lex.c"
907#define YY_NO_INPUT 1
908/* Suppress the default implementations. */
909#line 909 "lwin_wkt_lex.c"
910
911#define INITIAL 0
912
913#ifndef YY_NO_UNISTD_H
914/* Special case for "unistd.h", since it is non-ANSI. We include it way
915 * down here because we want the user's section 1 to have been scanned first.
916 * The user has a chance to override it with an option.
917 */
918#include <unistd.h>
919#endif
920
921#ifndef YY_EXTRA_TYPE
922#define YY_EXTRA_TYPE void *
923#endif
924
925static int yy_init_globals ( void );
926
927/* Accessor methods to globals.
928 These are made visible to non-reentrant scanners for convenience. */
929
930int yylex_destroy ( void );
931
932int yyget_debug ( void );
933
934void yyset_debug ( int debug_flag );
935
937
938void yyset_extra ( YY_EXTRA_TYPE user_defined );
939
940FILE *yyget_in ( void );
941
942void yyset_in ( FILE * _in_str );
943
944FILE *yyget_out ( void );
945
946void yyset_out ( FILE * _out_str );
947
948 int yyget_leng ( void );
949
950char *yyget_text ( void );
951
952int yyget_lineno ( void );
953
954void yyset_lineno ( int _line_number );
955
956/* Macros after this point can all be overridden by user definitions in
957 * section 1.
958 */
959
960#ifndef YY_SKIP_YYWRAP
961#ifdef __cplusplus
962extern "C" int yywrap ( void );
963#else
964extern int yywrap ( void );
965#endif
966#endif
967
968#ifndef YY_NO_UNPUT
969
970#endif
971
972#ifndef yytext_ptr
973static void yy_flex_strncpy ( char *, const char *, int );
974#endif
975
976#ifdef YY_NEED_STRLEN
977static int yy_flex_strlen ( const char * );
978#endif
979
980#ifndef YY_NO_INPUT
981#ifdef __cplusplus
982static int yyinput ( void );
983#else
984static int input ( void );
985#endif
986
987#endif
988
989/* Amount of stuff to slurp up with each read. */
990#ifndef YY_READ_BUF_SIZE
991#ifdef __ia64__
992/* On IA-64, the buffer size is 16k, not 8k */
993#define YY_READ_BUF_SIZE 16384
994#else
995#define YY_READ_BUF_SIZE 8192
996#endif /* __ia64__ */
997#endif
998
999/* Copy whatever the last rule matched to the standard output. */
1000#ifndef ECHO
1001/* This used to be an fputs(), but since the string might contain NUL's,
1002 * we now use fwrite().
1003 */
1004#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
1005#endif
1006
1007/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1008 * is returned in "result".
1009 */
1010#ifndef YY_INPUT
1011#define YY_INPUT(buf,result,max_size) \
1012 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1013 { \
1014 int c = '*'; \
1015 int n; \
1016 for ( n = 0; n < max_size && \
1017 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1018 buf[n] = (char) c; \
1019 if ( c == '\n' ) \
1020 buf[n++] = (char) c; \
1021 if ( c == EOF && ferror( yyin ) ) \
1022 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1023 result = n; \
1024 } \
1025 else \
1026 { \
1027 errno=0; \
1028 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
1029 { \
1030 if( errno != EINTR) \
1031 { \
1032 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1033 break; \
1034 } \
1035 errno=0; \
1036 clearerr(yyin); \
1037 } \
1038 }\
1039\
1040
1041#endif
1042
1043/* No semi-colon after return; correct usage is to write "yyterminate();" -
1044 * we don't want an extra ';' after the "return" because that will cause
1045 * some compilers to complain about unreachable statements.
1046 */
1047#ifndef yyterminate
1048#define yyterminate() return YY_NULL
1049#endif
1050
1051/* Number of entries by which start-condition stack grows. */
1052#ifndef YY_START_STACK_INCR
1053#define YY_START_STACK_INCR 25
1054#endif
1055
1056/* Report a fatal error. */
1057#ifndef YY_FATAL_ERROR
1058#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1059#endif
1060
1061/* end tables serialization structures and prototypes */
1062
1063/* Default declaration of generated scanner - a define so the user can
1064 * easily add parameters.
1065 */
1066#ifndef YY_DECL
1067#define YY_DECL_IS_OURS 1
1068
1069extern int yylex (void);
1070
1071#define YY_DECL int yylex (void)
1072#endif /* !YY_DECL */
1073
1074/* Code executed at the beginning of each rule, after yytext and yyleng
1075 * have been set up.
1076 */
1077#ifndef YY_USER_ACTION
1078#define YY_USER_ACTION
1079#endif
1080
1081/* Code executed at the end of each rule. */
1082#ifndef YY_BREAK
1083#define YY_BREAK /*LINTED*/break;
1084#endif
1085
1086#define YY_RULE_SETUP \
1087 YY_USER_ACTION
1088
1092{
1093 yy_state_type yy_current_state;
1094 char *yy_cp, *yy_bp;
1096
1097 if ( !(yy_init) )
1098 {
1099 (yy_init) = 1;
1100
1101#ifdef YY_USER_INIT
1102 YY_USER_INIT;
1103#endif
1104
1105 if ( ! (yy_start) )
1106 (yy_start) = 1; /* first start state */
1107
1108 if ( ! yyin )
1109 yyin = stdin;
1110
1111 if ( ! yyout )
1112 yyout = stdout;
1113
1114 if ( ! YY_CURRENT_BUFFER ) {
1118 }
1119
1121 }
1122
1123 {
1124#line 60 "lwin_wkt_lex.l"
1125
1126
1127#line 1127 "lwin_wkt_lex.c"
1128
1129 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
1130 {
1131 yy_cp = (yy_c_buf_p);
1132
1133 /* Support of yytext. */
1134 *yy_cp = (yy_hold_char);
1135
1136 /* yy_bp points to the position in yy_ch_buf of the start of
1137 * the current run.
1138 */
1139 yy_bp = yy_cp;
1140
1141 yy_current_state = (yy_start);
1142yy_match:
1143 do
1144 {
1145 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1146 if ( yy_accept[yy_current_state] )
1147 {
1148 (yy_last_accepting_state) = yy_current_state;
1150 }
1151 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1152 {
1153 yy_current_state = (int) yy_def[yy_current_state];
1154 if ( yy_current_state >= 177 )
1155 yy_c = yy_meta[yy_c];
1156 }
1157 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1158 ++yy_cp;
1159 }
1160 while ( yy_current_state != 176 );
1162 yy_current_state = (yy_last_accepting_state);
1163
1164yy_find_action:
1165 yy_act = yy_accept[yy_current_state];
1166
1168
1169do_action: /* This label is used only to access EOF actions. */
1170
1171 switch ( yy_act )
1172 { /* beginning of action switch */
1173 case 0: /* must back up */
1174 /* undo the effects of YY_DO_BEFORE_ACTION */
1175 *yy_cp = (yy_hold_char);
1177 yy_current_state = (yy_last_accepting_state);
1178 goto yy_find_action;
1179
1180case 1:
1181/* rule 1 can match eol */
1183#line 62 "lwin_wkt_lex.l"
1184{
1185 LWDEBUG(5,"DOUBLE");
1186 wkt_yylval.doublevalue = atof(wkt_yytext);
1187 yyless(wkt_yyleng-1);
1188 return DOUBLE_TOK;
1189 }
1190 YY_BREAK
1191case 2:
1192/* rule 2 can match eol */
1194#line 69 "lwin_wkt_lex.l"
1195{
1196 LWDEBUG(5,"DOUBLE NAN");
1198 yyless(wkt_yyleng-1);
1199 return DOUBLE_TOK;
1200}
1201 YY_BREAK
1202case 3:
1204#line 76 "lwin_wkt_lex.l"
1205{
1206 LWDEBUG(5,"SRID");
1208 return SRID_TOK;
1209 }
1210 YY_BREAK
1211case 4:
1213#line 82 "lwin_wkt_lex.l"
1214{ return COLLECTION_TOK; }
1215 YY_BREAK
1216case 5:
1218#line 83 "lwin_wkt_lex.l"
1219{ return MSURFACE_TOK; }
1220 YY_BREAK
1221case 6:
1223#line 84 "lwin_wkt_lex.l"
1224{ return MPOLYGON_TOK; }
1225 YY_BREAK
1226case 7:
1228#line 85 "lwin_wkt_lex.l"
1229{ return MCURVE_TOK; }
1230 YY_BREAK
1231case 8:
1233#line 86 "lwin_wkt_lex.l"
1234{ return MLINESTRING_TOK; }
1235 YY_BREAK
1236case 9:
1238#line 87 "lwin_wkt_lex.l"
1239{ return MPOINT_TOK; }
1240 YY_BREAK
1241case 10:
1243#line 88 "lwin_wkt_lex.l"
1244{ return CURVEPOLYGON_TOK; }
1245 YY_BREAK
1246case 11:
1248#line 89 "lwin_wkt_lex.l"
1249{ return POLYGON_TOK; }
1250 YY_BREAK
1251case 12:
1253#line 90 "lwin_wkt_lex.l"
1254{ return COMPOUNDCURVE_TOK; }
1255 YY_BREAK
1256case 13:
1258#line 91 "lwin_wkt_lex.l"
1259{ return CIRCULARSTRING_TOK; }
1260 YY_BREAK
1261case 14:
1263#line 92 "lwin_wkt_lex.l"
1264{ return LINESTRING_TOK; }
1265 YY_BREAK
1266case 15:
1268#line 93 "lwin_wkt_lex.l"
1269{ return POLYHEDRALSURFACE_TOK; }
1270 YY_BREAK
1271case 16:
1273#line 94 "lwin_wkt_lex.l"
1274{ return TRIANGLE_TOK; }
1275 YY_BREAK
1276case 17:
1278#line 95 "lwin_wkt_lex.l"
1279{ return TIN_TOK; }
1280 YY_BREAK
1281case 18:
1283#line 96 "lwin_wkt_lex.l"
1284{ return POINT_TOK; }
1285 YY_BREAK
1286case 19:
1288#line 97 "lwin_wkt_lex.l"
1289{ return EMPTY_TOK; }
1290 YY_BREAK
1291case 20:
1293#line 99 "lwin_wkt_lex.l"
1294{
1295 LWDEBUG(5,"DIMENSIONALITY");
1296 wkt_yylval.stringvalue = wkt_yytext;
1297 return DIMENSIONALITY_TOK;
1298 }
1299 YY_BREAK
1300case 21:
1302#line 105 "lwin_wkt_lex.l"
1303{ LWDEBUG(5,"LBRACKET"); return LBRACKET_TOK; }
1304 YY_BREAK
1305case 22:
1307#line 106 "lwin_wkt_lex.l"
1308{ LWDEBUG(5,"RBRACKET"); return RBRACKET_TOK; }
1309 YY_BREAK
1310case 23:
1312#line 107 "lwin_wkt_lex.l"
1313{ LWDEBUG(5,"COMMA"); return COMMA_TOK; }
1314 YY_BREAK
1315case 24:
1317#line 108 "lwin_wkt_lex.l"
1318{ LWDEBUG(5,"SEMICOLON"); return SEMICOLON_TOK; }
1319 YY_BREAK
1320case 25:
1321/* rule 25 can match eol */
1323#line 110 "lwin_wkt_lex.l"
1324{ /* ignore whitespace */ LWDEBUG(5,"WHITESPACE"); }
1325 YY_BREAK
1326case 26:
1328#line 112 "lwin_wkt_lex.l"
1329{ /* Error out and stop parsing on unknown/unexpected characters */
1330 LWDEBUG(5,"UNKNOWN");
1332 yyterminate();
1333 }
1334 YY_BREAK
1335case 27:
1337#line 118 "lwin_wkt_lex.l"
1338ECHO;
1339 YY_BREAK
1340#line 1340 "lwin_wkt_lex.c"
1341case YY_STATE_EOF(INITIAL):
1342 yyterminate();
1343
1344 case YY_END_OF_BUFFER:
1345 {
1346 /* Amount of text matched not including the EOB char. */
1347 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1348
1349 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1350 *yy_cp = (yy_hold_char);
1352
1353 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1354 {
1355 /* We're scanning a new file or input source. It's
1356 * possible that this happened because the user
1357 * just pointed yyin at a new source and called
1358 * yylex(). If so, then we have to assure
1359 * consistency between YY_CURRENT_BUFFER and our
1360 * globals. Here is the right place to do so, because
1361 * this is the first action (other than possibly a
1362 * back-up) that will match for the new input source.
1363 */
1364 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1365 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1366 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1367 }
1368
1369 /* Note that here we test for yy_c_buf_p "<=" to the position
1370 * of the first EOB in the buffer, since yy_c_buf_p will
1371 * already have been incremented past the NUL character
1372 * (since all states make transitions on EOB to the
1373 * end-of-buffer state). Contrast this with the test
1374 * in input().
1375 */
1376 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1377 { /* This was really a NUL. */
1378 yy_state_type yy_next_state;
1379
1380 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1381
1382 yy_current_state = yy_get_previous_state( );
1383
1384 /* Okay, we're now positioned to make the NUL
1385 * transition. We couldn't have
1386 * yy_get_previous_state() go ahead and do it
1387 * for us because it doesn't know how to deal
1388 * with the possibility of jamming (and we don't
1389 * want to build jamming into it because then it
1390 * will run more slowly).
1391 */
1392
1393 yy_next_state = yy_try_NUL_trans( yy_current_state );
1394
1396
1397 if ( yy_next_state )
1398 {
1399 /* Consume the NUL. */
1400 yy_cp = ++(yy_c_buf_p);
1401 yy_current_state = yy_next_state;
1402 goto yy_match;
1403 }
1404
1405 else
1406 {
1408 yy_current_state = (yy_last_accepting_state);
1409 goto yy_find_action;
1410 }
1411 }
1412
1413 else switch ( yy_get_next_buffer( ) )
1414 {
1416 {
1418
1419 if ( yywrap( ) )
1420 {
1421 /* Note: because we've taken care in
1422 * yy_get_next_buffer() to have set up
1423 * yytext, we can now set up
1424 * yy_c_buf_p so that if some total
1425 * hoser (like flex itself) wants to
1426 * call the scanner after we return the
1427 * YY_NULL, it'll still work - another
1428 * YY_NULL will get returned.
1429 */
1431
1433 goto do_action;
1434 }
1435
1436 else
1437 {
1440 }
1441 break;
1442 }
1443
1445 (yy_c_buf_p) =
1446 (yytext_ptr) + yy_amount_of_matched_text;
1447
1448 yy_current_state = yy_get_previous_state( );
1449
1450 yy_cp = (yy_c_buf_p);
1452 goto yy_match;
1453
1454 case EOB_ACT_LAST_MATCH:
1455 (yy_c_buf_p) =
1456 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1457
1458 yy_current_state = yy_get_previous_state( );
1459
1460 yy_cp = (yy_c_buf_p);
1462 goto yy_find_action;
1463 }
1464 break;
1465 }
1466
1467 default:
1469 "fatal flex scanner internal error--no action found" );
1470 } /* end of action switch */
1471 } /* end of scanning one token */
1472 } /* end of user's declarations */
1473} /* end of yylex */
1474
1475/* yy_get_next_buffer - try to read in a new buffer
1476 *
1477 * Returns a code representing an action:
1478 * EOB_ACT_LAST_MATCH -
1479 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1480 * EOB_ACT_END_OF_FILE - end of file
1481 */
1482static int yy_get_next_buffer (void)
1483{
1484 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1485 char *source = (yytext_ptr);
1486 int number_to_move, i;
1487 int ret_val;
1488
1489 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1491 "fatal flex scanner internal error--end of buffer missed" );
1492
1493 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1494 { /* Don't try to fill the buffer, so this is an EOF. */
1495 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1496 {
1497 /* We matched a single character, the EOB, so
1498 * treat this as a final EOF.
1499 */
1500 return EOB_ACT_END_OF_FILE;
1501 }
1502
1503 else
1504 {
1505 /* We matched some text prior to the EOB, first
1506 * process it.
1507 */
1508 return EOB_ACT_LAST_MATCH;
1509 }
1510 }
1511
1512 /* Try to read more data. */
1513
1514 /* First move last chars to start of buffer. */
1515 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1516
1517 for ( i = 0; i < number_to_move; ++i )
1518 *(dest++) = *(source++);
1519
1520 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1521 /* don't do the read, it's not guaranteed to return an EOF,
1522 * just force an EOF
1523 */
1524 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1525
1526 else
1527 {
1528 int num_to_read =
1529 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1530
1531 while ( num_to_read <= 0 )
1532 { /* Not enough room in the buffer - grow it. */
1533
1534 /* just a shorter name for the current buffer */
1536
1537 int yy_c_buf_p_offset =
1538 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1539
1540 if ( b->yy_is_our_buffer )
1541 {
1542 int new_size = b->yy_buf_size * 2;
1543
1544 if ( new_size <= 0 )
1545 b->yy_buf_size += b->yy_buf_size / 8;
1546 else
1547 b->yy_buf_size *= 2;
1548
1549 b->yy_ch_buf = (char *)
1550 /* Include room in for 2 EOB chars. */
1551 yyrealloc( (void *) b->yy_ch_buf,
1552 (yy_size_t) (b->yy_buf_size + 2) );
1553 }
1554 else
1555 /* Can't grow it, we don't own it. */
1556 b->yy_ch_buf = NULL;
1557
1558 if ( ! b->yy_ch_buf )
1560 "fatal error - scanner input buffer overflow" );
1561
1562 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1563
1564 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1565 number_to_move - 1;
1566
1567 }
1568
1569 if ( num_to_read > YY_READ_BUF_SIZE )
1570 num_to_read = YY_READ_BUF_SIZE;
1571
1572 /* Read in more data. */
1573 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1574 (yy_n_chars), num_to_read );
1575
1576 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1577 }
1578
1579 if ( (yy_n_chars) == 0 )
1580 {
1581 if ( number_to_move == YY_MORE_ADJ )
1582 {
1583 ret_val = EOB_ACT_END_OF_FILE;
1584 yyrestart( yyin );
1585 }
1586
1587 else
1588 {
1589 ret_val = EOB_ACT_LAST_MATCH;
1590 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1592 }
1593 }
1594
1595 else
1596 ret_val = EOB_ACT_CONTINUE_SCAN;
1597
1598 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1599 /* Extend the array by 50%, plus the number we really need. */
1600 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1601 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1602 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1603 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1604 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1605 /* "- 2" to take care of EOB's */
1606 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1607 }
1608
1609 (yy_n_chars) += number_to_move;
1612
1613 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1614
1615 return ret_val;
1616}
1617
1618/* yy_get_previous_state - get the state just before the EOB char was reached */
1619
1621{
1622 yy_state_type yy_current_state;
1623 char *yy_cp;
1624
1625 yy_current_state = (yy_start);
1626
1627 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1628 {
1629 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1630 if ( yy_accept[yy_current_state] )
1631 {
1632 (yy_last_accepting_state) = yy_current_state;
1634 }
1635 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1636 {
1637 yy_current_state = (int) yy_def[yy_current_state];
1638 if ( yy_current_state >= 177 )
1639 yy_c = yy_meta[yy_c];
1640 }
1641 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1642 }
1643
1644 return yy_current_state;
1645}
1646
1647/* yy_try_NUL_trans - try to make a transition on the NUL character
1648 *
1649 * synopsis
1650 * next_state = yy_try_NUL_trans( current_state );
1651 */
1652 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1653{
1654 int yy_is_jam;
1655 char *yy_cp = (yy_c_buf_p);
1656
1657 YY_CHAR yy_c = 1;
1658 if ( yy_accept[yy_current_state] )
1659 {
1660 (yy_last_accepting_state) = yy_current_state;
1662 }
1663 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1664 {
1665 yy_current_state = (int) yy_def[yy_current_state];
1666 if ( yy_current_state >= 177 )
1667 yy_c = yy_meta[yy_c];
1668 }
1669 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1670 yy_is_jam = (yy_current_state == 176);
1671
1672 return yy_is_jam ? 0 : yy_current_state;
1673}
1674
1675#ifndef YY_NO_UNPUT
1676
1677#endif
1678
1679#ifndef YY_NO_INPUT
1680#ifdef __cplusplus
1681 static int yyinput (void)
1682#else
1683 static int input (void)
1684#endif
1685
1686{
1687 int c;
1688
1689 *(yy_c_buf_p) = (yy_hold_char);
1690
1692 {
1693 /* yy_c_buf_p now points to the character we want to return.
1694 * If this occurs *before* the EOB characters, then it's a
1695 * valid NUL; if not, then we've hit the end of the buffer.
1696 */
1697 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1698 /* This was really a NUL. */
1699 *(yy_c_buf_p) = '\0';
1700
1701 else
1702 { /* need more input */
1703 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
1704 ++(yy_c_buf_p);
1705
1706 switch ( yy_get_next_buffer( ) )
1707 {
1708 case EOB_ACT_LAST_MATCH:
1709 /* This happens because yy_g_n_b()
1710 * sees that we've accumulated a
1711 * token and flags that we need to
1712 * try matching the token before
1713 * proceeding. But for input(),
1714 * there's no matching to consider.
1715 * So convert the EOB_ACT_LAST_MATCH
1716 * to EOB_ACT_END_OF_FILE.
1717 */
1718
1719 /* Reset buffer status. */
1720 yyrestart( yyin );
1721
1722 /*FALLTHROUGH*/
1723
1725 {
1726 if ( yywrap( ) )
1727 return 0;
1728
1731#ifdef __cplusplus
1732 return yyinput();
1733#else
1734 return input();
1735#endif
1736 }
1737
1739 (yy_c_buf_p) = (yytext_ptr) + offset;
1740 break;
1741 }
1742 }
1743 }
1744
1745 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1746 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1747 (yy_hold_char) = *++(yy_c_buf_p);
1748
1749 return c;
1750}
1751#endif /* ifndef YY_NO_INPUT */
1752
1758 void yyrestart (FILE * input_file )
1759{
1760
1761 if ( ! YY_CURRENT_BUFFER ){
1765 }
1766
1767 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1769}
1770
1775 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1776{
1777
1778 /* TODO. We should be able to replace this entire function body
1779 * with
1780 * yypop_buffer_state();
1781 * yypush_buffer_state(new_buffer);
1782 */
1784 if ( YY_CURRENT_BUFFER == new_buffer )
1785 return;
1786
1787 if ( YY_CURRENT_BUFFER )
1788 {
1789 /* Flush out information for old buffer. */
1790 *(yy_c_buf_p) = (yy_hold_char);
1791 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1792 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1793 }
1794
1795 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1797
1798 /* We don't actually know whether we did this switch during
1799 * EOF (yywrap()) processing, but the only time this flag
1800 * is looked at is after yywrap() is called, so it's safe
1801 * to go ahead and always set it.
1802 */
1804}
1805
1806static void yy_load_buffer_state (void)
1807{
1808 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1810 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1811 (yy_hold_char) = *(yy_c_buf_p);
1812}
1813
1820 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1821{
1823
1824 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1825 if ( ! b )
1826 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1827
1828 b->yy_buf_size = size;
1829
1830 /* yy_ch_buf has to be 2 characters longer than the size given because
1831 * we need to put in 2 end-of-buffer characters.
1832 */
1833 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
1834 if ( ! b->yy_ch_buf )
1835 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1836
1837 b->yy_is_our_buffer = 1;
1838
1839 yy_init_buffer( b, file );
1840
1841 return b;
1842}
1843
1849{
1850
1851 if ( ! b )
1852 return;
1853
1854 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1856
1857 if ( b->yy_is_our_buffer )
1858 yyfree( (void *) b->yy_ch_buf );
1859
1860 yyfree( (void *) b );
1861}
1862
1863/* Initializes or reinitializes a buffer.
1864 * This function is sometimes called more than once on the same buffer,
1865 * such as during a yyrestart() or at EOF.
1866 */
1867 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1868
1869{
1870 int oerrno = errno;
1871
1872 yy_flush_buffer( b );
1873
1874 b->yy_input_file = file;
1875 b->yy_fill_buffer = 1;
1876
1877 /* If b is the current buffer, then yy_init_buffer was _probably_
1878 * called from yyrestart() or through yy_get_next_buffer.
1879 * In that case, we don't want to reset the lineno or column.
1880 */
1881 if (b != YY_CURRENT_BUFFER){
1882 b->yy_bs_lineno = 1;
1883 b->yy_bs_column = 0;
1884 }
1885
1886 b->yy_is_interactive = 0;
1887
1888 errno = oerrno;
1889}
1890
1896{
1897 if ( ! b )
1898 return;
1899
1900 b->yy_n_chars = 0;
1901
1902 /* We always need two end-of-buffer characters. The first causes
1903 * a transition to the end-of-buffer state. The second causes
1904 * a jam in that state.
1905 */
1908
1909 b->yy_buf_pos = &b->yy_ch_buf[0];
1910
1911 b->yy_at_bol = 1;
1913
1914 if ( b == YY_CURRENT_BUFFER )
1916}
1917
1924void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1925{
1926 if (new_buffer == NULL)
1927 return;
1928
1930
1931 /* This block is copied from yy_switch_to_buffer. */
1932 if ( YY_CURRENT_BUFFER )
1933 {
1934 /* Flush out information for old buffer. */
1935 *(yy_c_buf_p) = (yy_hold_char);
1936 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1937 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1938 }
1939
1940 /* Only push if top exists. Otherwise, replace top. */
1943 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1944
1945 /* copied from yy_switch_to_buffer. */
1948}
1949
1954void yypop_buffer_state (void)
1955{
1956 if (!YY_CURRENT_BUFFER)
1957 return;
1958
1961 if ((yy_buffer_stack_top) > 0)
1963
1964 if (YY_CURRENT_BUFFER) {
1967 }
1968}
1969
1970/* Allocates the stack if it does not exist.
1971 * Guarantees space for at least one push.
1972 */
1973static void yyensure_buffer_stack (void)
1974{
1975 yy_size_t num_to_alloc;
1976
1977 if (!(yy_buffer_stack)) {
1978
1979 /* First allocation is just for 2 elements, since we don't know if this
1980 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1981 * immediate realloc on the next call.
1982 */
1983 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1985 (num_to_alloc * sizeof(struct yy_buffer_state*)
1986 );
1987 if ( ! (yy_buffer_stack) )
1988 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1989
1990 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1991
1992 (yy_buffer_stack_max) = num_to_alloc;
1993 (yy_buffer_stack_top) = 0;
1994 return;
1995 }
1996
1997 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1998
1999 /* Increase the buffer to prepare for a possible push. */
2000 yy_size_t grow_size = 8 /* arbitrary grow size */;
2001
2002 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2004 ((yy_buffer_stack),
2005 num_to_alloc * sizeof(struct yy_buffer_state*)
2006 );
2007 if ( ! (yy_buffer_stack) )
2008 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2009
2010 /* zero only the new slots.*/
2011 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2012 (yy_buffer_stack_max) = num_to_alloc;
2013 }
2014}
2015
2022YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
2023{
2025
2026 if ( size < 2 ||
2027 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2028 base[size-1] != YY_END_OF_BUFFER_CHAR )
2029 /* They forgot to leave room for the EOB's. */
2030 return NULL;
2031
2032 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
2033 if ( ! b )
2034 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2035
2036 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
2037 b->yy_buf_pos = b->yy_ch_buf = base;
2038 b->yy_is_our_buffer = 0;
2039 b->yy_input_file = NULL;
2040 b->yy_n_chars = b->yy_buf_size;
2041 b->yy_is_interactive = 0;
2042 b->yy_at_bol = 1;
2043 b->yy_fill_buffer = 0;
2045
2047
2048 return b;
2049}
2050
2059YY_BUFFER_STATE yy_scan_string (const char * yystr )
2060{
2061
2062 return yy_scan_bytes( yystr, (int) strlen(yystr) );
2063}
2064
2072YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
2073{
2075 char *buf;
2076 yy_size_t n;
2077 int i;
2078
2079 /* Get memory for full buffer, including space for trailing EOB's. */
2080 n = (yy_size_t) (_yybytes_len + 2);
2081 buf = (char *) yyalloc( n );
2082 if ( ! buf )
2083 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2084
2085 for ( i = 0; i < _yybytes_len; ++i )
2086 buf[i] = yybytes[i];
2087
2088 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2089
2090 b = yy_scan_buffer( buf, n );
2091 if ( ! b )
2092 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2093
2094 /* It's okay to grow etc. this buffer, and we should throw it
2095 * away when we're done.
2096 */
2097 b->yy_is_our_buffer = 1;
2098
2099 return b;
2100}
2101
2102#ifndef YY_EXIT_FAILURE
2103#define YY_EXIT_FAILURE 2
2104#endif
2105
2106static void yynoreturn yy_fatal_error (const char* msg )
2107{
2108 fprintf( stderr, "%s\n", msg );
2109 exit( YY_EXIT_FAILURE );
2110}
2111
2112/* Redefine yyless() so it works in section 3 code. */
2113
2114#undef yyless
2115#define yyless(n) \
2116 do \
2117 { \
2118 /* Undo effects of setting up yytext. */ \
2119 int yyless_macro_arg = (n); \
2120 YY_LESS_LINENO(yyless_macro_arg);\
2121 yytext[yyleng] = (yy_hold_char); \
2122 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2123 (yy_hold_char) = *(yy_c_buf_p); \
2124 *(yy_c_buf_p) = '\0'; \
2125 yyleng = yyless_macro_arg; \
2126 } \
2127 while ( 0 )
2128
2129/* Accessor methods (get/set functions) to struct members. */
2130
2134int yyget_lineno (void)
2135{
2136
2137 return yylineno;
2138}
2139
2143FILE *yyget_in (void)
2144{
2145 return yyin;
2146}
2147
2151FILE *yyget_out (void)
2152{
2153 return yyout;
2154}
2155
2159int yyget_leng (void)
2160{
2161 return yyleng;
2162}
2163
2168char *yyget_text (void)
2169{
2170 return yytext;
2171}
2172
2177void yyset_lineno (int _line_number )
2178{
2179
2180 yylineno = _line_number;
2181}
2182
2189void yyset_in (FILE * _in_str )
2190{
2191 yyin = _in_str ;
2192}
2193
2194void yyset_out (FILE * _out_str )
2195{
2196 yyout = _out_str ;
2197}
2198
2199int yyget_debug (void)
2200{
2201 return yy_flex_debug;
2202}
2203
2204void yyset_debug (int _bdebug )
2205{
2206 yy_flex_debug = _bdebug ;
2207}
2208
2209static int yy_init_globals (void)
2210{
2211 /* Initialization is the same as for the non-reentrant scanner.
2212 * This function is called from yylex_destroy(), so don't allocate here.
2213 */
2214
2215 (yy_buffer_stack) = NULL;
2216 (yy_buffer_stack_top) = 0;
2217 (yy_buffer_stack_max) = 0;
2218 (yy_c_buf_p) = NULL;
2219 (yy_init) = 0;
2220 (yy_start) = 0;
2221
2222/* Defined in main.c */
2223#ifdef YY_STDINIT
2224 yyin = stdin;
2225 yyout = stdout;
2226#else
2227 yyin = NULL;
2228 yyout = NULL;
2229#endif
2230
2231 /* For future reference: Set errno on error, since we are called by
2232 * yylex_init()
2233 */
2234 return 0;
2235}
2236
2237/* yylex_destroy is for both reentrant and non-reentrant scanners. */
2238int yylex_destroy (void)
2239{
2240
2241 /* Pop the buffer stack, destroying each element. */
2242 while(YY_CURRENT_BUFFER){
2246 }
2247
2248 /* Destroy the stack itself. */
2250 (yy_buffer_stack) = NULL;
2251
2252 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2253 * yylex() is called, initialization will occur. */
2254 yy_init_globals( );
2255
2256 return 0;
2257}
2258
2259/*
2260 * Internal utility routines.
2261 */
2262
2263#ifndef yytext_ptr
2264static void yy_flex_strncpy (char* s1, const char * s2, int n )
2265{
2266
2267 int i;
2268 for ( i = 0; i < n; ++i )
2269 s1[i] = s2[i];
2270}
2271#endif
2272
2273#ifdef YY_NEED_STRLEN
2274static int yy_flex_strlen (const char * s )
2275{
2276 int n;
2277 for ( n = 0; s[n]; ++n )
2278 ;
2279
2280 return n;
2281}
2282#endif
2283
2284#define YYTABLES_NAME "yytables"
2285
2286#line 118 "lwin_wkt_lex.l"
2287
2288
2289void *wkt_yyalloc (yy_size_t size )
2290{
2291 return (void *) lwalloc( size );
2292}
2293
2294void *wkt_yyrealloc (void * ptr, yy_size_t size )
2295{
2296 return (void *) lwrealloc( (char *) ptr, size );
2297}
2298
2299void wkt_yyfree (void * ptr )
2300{
2301 lwfree( (char *) ptr ); /* see wkt_yyrealloc() for (char *) cast */
2302}
2303
2304/*
2305* Set up the lexer!
2306*/
2307void wkt_lexer_init(char *src)
2308{
2310 wkt_yy_buf_state = wkt_yy_scan_string(src);
2311}
2312
2313/*
2314* Clean up the lexer!
2315*/
2316void wkt_lexer_close()
2317{
2318 wkt_yy_delete_buffer(wkt_yy_buf_state);
2319}
2320
2321
char * s
Definition cu_in_wkt.c:23
void * lwrealloc(void *mem, size_t size)
Definition lwutil.c:242
#define PARSER_ERROR_OTHER
Definition liblwgeom.h:2181
void * lwalloc(size_t size)
Definition lwutil.c:227
void lwfree(void *mem)
Definition lwutil.c:248
#define LWDEBUG(level, msg)
Definition lwgeom_log.h:101
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 const flex_int16_t yy_nxt[444]
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
static const flex_int16_t yy_def[177]
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
#define YY_BUFFER_NORMAL
char * yy_cp
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 NAN
#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
static const flex_int16_t yy_base[177]
#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)
static const flex_int16_t yy_chk[444]
#define YY_END_OF_BUFFER_CHAR
static const flex_int16_t yy_accept[177]
#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 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)
YYSTYPE wkt_yylval
@ SEMICOLON_TOK
@ COMMA_TOK
@ LINESTRING_TOK
@ COMPOUNDCURVE_TOK
@ MSURFACE_TOK
@ COLLECTION_TOK
@ POLYHEDRALSURFACE_TOK
@ RBRACKET_TOK
@ MLINESTRING_TOK
@ POINT_TOK
@ CURVEPOLYGON_TOK
@ EMPTY_TOK
@ LBRACKET_TOK
@ TRIANGLE_TOK
@ SRID_TOK
@ MPOLYGON_TOK
@ TIN_TOK
@ CIRCULARSTRING_TOK
@ MPOINT_TOK
@ DIMENSIONALITY_TOK
@ POLYGON_TOK
@ MCURVE_TOK
@ DOUBLE_TOK
YYLTYPE wkt_yylloc
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
int integervalue
double doublevalue