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