PostGIS  2.3.7dev-r@@SVN_REVISION@@
lwin_wkt_lex.c
Go to the documentation of this file.
1 /**********************************************************************
2  *
3  * PostGIS - Spatial Types for PostgreSQL
4  * http://postgis.net
5  *
6  * PostGIS is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * PostGIS is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with PostGIS. If not, see <http://www.gnu.org/licenses/>.
18  *
19  **********************************************************************
20  *
21  * Copyright (C) 2010-2015 Paul Ramsey <pramsey@cleverelephant.ca>
22  * Copyright (C) 2011-2014 Sandro Santilli <strk@kbt.io>
23  *
24  **********************************************************************/
25 
26 #line 2 "lwin_wkt_lex.c"
27 
28 #line 4 "lwin_wkt_lex.c"
29 
30 #define YY_INT_ALIGNED short int
31 
32 /* A lexical scanner generated by flex */
33 
34 #define yy_create_buffer wkt_yy_create_buffer
35 #define yy_delete_buffer wkt_yy_delete_buffer
36 #define yy_flex_debug wkt_yy_flex_debug
37 #define yy_init_buffer wkt_yy_init_buffer
38 #define yy_flush_buffer wkt_yy_flush_buffer
39 #define yy_load_buffer_state wkt_yy_load_buffer_state
40 #define yy_switch_to_buffer wkt_yy_switch_to_buffer
41 #define yyin wkt_yyin
42 #define yyleng wkt_yyleng
43 #define yylex wkt_yylex
44 #define yylineno wkt_yylineno
45 #define yyout wkt_yyout
46 #define yyrestart wkt_yyrestart
47 #define yytext wkt_yytext
48 #define yywrap wkt_yywrap
49 #define yyalloc wkt_yyalloc
50 #define yyrealloc wkt_yyrealloc
51 #define yyfree wkt_yyfree
52 
53 #define FLEX_SCANNER
54 #define YY_FLEX_MAJOR_VERSION 2
55 #define YY_FLEX_MINOR_VERSION 5
56 #define YY_FLEX_SUBMINOR_VERSION 37
57 #if YY_FLEX_SUBMINOR_VERSION > 0
58 #define FLEX_BETA
59 #endif
60 
61 /* First, we deal with platform-specific or compiler-specific issues. */
62 
63 /* begin standard C headers. */
64 #include <stdio.h>
65 #include <string.h>
66 #include <errno.h>
67 #include <stdlib.h>
68 
69 /* end standard C headers. */
70 
71 /* flex integer type definitions */
72 
73 #ifndef FLEXINT_H
74 #define FLEXINT_H
75 
76 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
77 
78 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
79 
80 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
81  * if you want the limit (max/min) macros for int types.
82  */
83 #ifndef __STDC_LIMIT_MACROS
84 #define __STDC_LIMIT_MACROS 1
85 #endif
86 
87 #include <inttypes.h>
88 typedef int8_t flex_int8_t;
89 typedef uint8_t flex_uint8_t;
90 typedef int16_t flex_int16_t;
91 typedef uint16_t flex_uint16_t;
92 typedef int32_t flex_int32_t;
93 typedef uint32_t flex_uint32_t;
94 #else
95 typedef signed char flex_int8_t;
96 typedef short int flex_int16_t;
97 typedef int flex_int32_t;
98 typedef unsigned char flex_uint8_t;
99 typedef unsigned short int flex_uint16_t;
100 typedef unsigned int flex_uint32_t;
101 
102 /* Limits of integral types. */
103 #ifndef INT8_MIN
104 #define INT8_MIN (-128)
105 #endif
106 #ifndef INT16_MIN
107 #define INT16_MIN (-32767-1)
108 #endif
109 #ifndef INT32_MIN
110 #define INT32_MIN (-2147483647-1)
111 #endif
112 #ifndef INT8_MAX
113 #define INT8_MAX (127)
114 #endif
115 #ifndef INT16_MAX
116 #define INT16_MAX (32767)
117 #endif
118 #ifndef INT32_MAX
119 #define INT32_MAX (2147483647)
120 #endif
121 #ifndef UINT8_MAX
122 #define UINT8_MAX (255U)
123 #endif
124 #ifndef UINT16_MAX
125 #define UINT16_MAX (65535U)
126 #endif
127 #ifndef UINT32_MAX
128 #define UINT32_MAX (4294967295U)
129 #endif
130 
131 #endif /* ! C99 */
132 
133 #endif /* ! FLEXINT_H */
134 
135 #ifdef __cplusplus
136 
137 /* The "const" storage-class-modifier is valid. */
138 #define YY_USE_CONST
139 
140 #else /* ! __cplusplus */
141 
142 /* C99 requires __STDC__ to be defined as 1. */
143 #if defined (__STDC__)
144 
145 #define YY_USE_CONST
146 
147 #endif /* defined (__STDC__) */
148 #endif /* ! __cplusplus */
149 
150 #ifdef YY_USE_CONST
151 #define yyconst const
152 #else
153 #define yyconst
154 #endif
155 
156 /* Returned upon end-of-file. */
157 #define YY_NULL 0
158 
159 /* Promotes a possibly negative, possibly signed char to an unsigned
160  * integer for use as an array index. If the signed char is negative,
161  * we want to instead treat it as an 8-bit unsigned char, hence the
162  * double cast.
163  */
164 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
165 
166 /* Enter a start condition. This macro really ought to take a parameter,
167  * but we do it the disgusting crufty way forced on us by the ()-less
168  * definition of BEGIN.
169  */
170 #define BEGIN (yy_start) = 1 + 2 *
171 
172 /* Translate the current start state into a value that can be later handed
173  * to BEGIN to return to the state. The YYSTATE alias is for lex
174  * compatibility.
175  */
176 #define YY_START (((yy_start) - 1) / 2)
177 #define YYSTATE YY_START
178 
179 /* Action number for EOF rule of a given start state. */
180 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
181 
182 /* Special action meaning "start processing a new file". */
183 #define YY_NEW_FILE wkt_yyrestart(wkt_yyin )
184 
185 #define YY_END_OF_BUFFER_CHAR 0
186 
187 /* Size of default input buffer. */
188 #ifndef YY_BUF_SIZE
189 #define YY_BUF_SIZE 16384
190 #endif
191 
192 /* The state buf must be large enough to hold one state per character in the main buffer.
193  */
194 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
195 
196 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
197 #define YY_TYPEDEF_YY_BUFFER_STATE
199 #endif
200 
201 #ifndef YY_TYPEDEF_YY_SIZE_T
202 #define YY_TYPEDEF_YY_SIZE_T
203 typedef size_t yy_size_t;
204 #endif
205 
206 extern yy_size_t wkt_yyleng;
207 
208 extern FILE *wkt_yyin, *wkt_yyout;
209 
210 #define EOB_ACT_CONTINUE_SCAN 0
211 #define EOB_ACT_END_OF_FILE 1
212 #define EOB_ACT_LAST_MATCH 2
213 
214  #define YY_LESS_LINENO(n)
215 
216 /* Return all but the first "n" matched characters back to the input stream. */
217 #define yyless(n) \
218  do \
219  { \
220  /* Undo effects of setting up wkt_yytext. */ \
221  int yyless_macro_arg = (n); \
222  YY_LESS_LINENO(yyless_macro_arg);\
223  *yy_cp = (yy_hold_char); \
224  YY_RESTORE_YY_MORE_OFFSET \
225  (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
226  YY_DO_BEFORE_ACTION; /* set up wkt_yytext again */ \
227  } \
228  while ( 0 )
229 
230 #define unput(c) yyunput( c, (yytext_ptr) )
231 
232 #ifndef YY_STRUCT_YY_BUFFER_STATE
233 #define YY_STRUCT_YY_BUFFER_STATE
235  {
237 
238  char *yy_ch_buf; /* input buffer */
239  char *yy_buf_pos; /* current position in input buffer */
240 
241  /* Size of input buffer in bytes, not including room for EOB
242  * characters.
243  */
245 
246  /* Number of characters read into yy_ch_buf, not including EOB
247  * characters.
248  */
250 
251  /* Whether we "own" the buffer - i.e., we know we created it,
252  * and can realloc() it to grow it, and should free() it to
253  * delete it.
254  */
256 
257  /* Whether this is an "interactive" input source; if so, and
258  * if we're using stdio for input, then we want to use getc()
259  * instead of fread(), to make sure we stop fetching input after
260  * each newline.
261  */
263 
264  /* Whether we're considered to be at the beginning of a line.
265  * If so, '^' rules will be active on the next match, otherwise
266  * not.
267  */
269 
273  /* Whether to try to fill the input buffer when we reach the
274  * end of it.
275  */
277 
279 
280 #define YY_BUFFER_NEW 0
281 #define YY_BUFFER_NORMAL 1
282  /* When an EOF's been seen but there's still some text to process
283  * then we mark the buffer as YY_EOF_PENDING, to indicate that we
284  * shouldn't try reading from the input source any more. We might
285  * still have a bunch of tokens to match, though, because of
286  * possible backing-up.
287  *
288  * When we actually see the EOF, we change the status to "new"
289  * (via wkt_yyrestart()), so that the user can continue scanning by
290  * just pointing wkt_yyin at a new input file.
291  */
292 #define YY_BUFFER_EOF_PENDING 2
293 
294  };
295 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
296 
297 /* Stack of input buffers. */
298 static size_t yy_buffer_stack_top = 0;
299 static size_t yy_buffer_stack_max = 0;
300 static YY_BUFFER_STATE * yy_buffer_stack = 0;
302 /* We provide macros for accessing buffer states in case in the
303  * future we want to put the buffer states in a more general
304  * "scanner state".
305  *
306  * Returns the top of the stack, or NULL.
307  */
308 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
309  ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
310  : NULL)
311 
312 /* Same as previous macro, but useful when we know that the buffer stack is not
313  * NULL or when we need an lvalue. For internal use only.
314  */
315 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
316 
317 /* yy_hold_char holds the character lost when wkt_yytext is formed. */
318 static char yy_hold_char;
319 static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
321 
322 /* Points to current character in buffer. */
323 static char *yy_c_buf_p = (char *) 0;
324 static int yy_init = 0; /* whether we need to initialize */
325 static int yy_start = 0; /* start state number */
326 
327 /* Flag which is used to allow wkt_yywrap()'s to do buffer switches
328  * instead of setting up a fresh wkt_yyin. A bit of a hack ...
329  */
331 
332 void wkt_yyrestart (FILE *input_file );
333 void wkt_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
334 YY_BUFFER_STATE wkt_yy_create_buffer (FILE *file,int size );
335 void wkt_yy_delete_buffer (YY_BUFFER_STATE b );
336 void wkt_yy_flush_buffer (YY_BUFFER_STATE b );
337 void wkt_yypush_buffer_state (YY_BUFFER_STATE new_buffer );
338 void wkt_yypop_buffer_state (void );
339 
340 static void wkt_yyensure_buffer_stack (void );
341 static void wkt_yy_load_buffer_state (void );
342 static void wkt_yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
343 
344 #define YY_FLUSH_BUFFER wkt_yy_flush_buffer(YY_CURRENT_BUFFER )
345 
346 YY_BUFFER_STATE wkt_yy_scan_buffer (char *base,yy_size_t size );
347 YY_BUFFER_STATE wkt_yy_scan_string (yyconst char *yy_str );
348 YY_BUFFER_STATE wkt_yy_scan_bytes (yyconst char *bytes,yy_size_t len );
349 
350 void *wkt_yyalloc (yy_size_t );
351 void *wkt_yyrealloc (void *,yy_size_t );
352 void wkt_yyfree (void * );
353 
354 #define yy_new_buffer wkt_yy_create_buffer
355 
356 #define yy_set_interactive(is_interactive) \
357  { \
358  if ( ! YY_CURRENT_BUFFER ){ \
359  wkt_yyensure_buffer_stack (); \
360  YY_CURRENT_BUFFER_LVALUE = \
361  wkt_yy_create_buffer(wkt_yyin,YY_BUF_SIZE ); \
362  } \
363  YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
364  }
365 
366 #define yy_set_bol(at_bol) \
367  { \
368  if ( ! YY_CURRENT_BUFFER ){\
369  wkt_yyensure_buffer_stack (); \
370  YY_CURRENT_BUFFER_LVALUE = \
371  wkt_yy_create_buffer(wkt_yyin,YY_BUF_SIZE ); \
372  } \
373  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
374  }
375 
376 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
377 
378 /* Begin user sect3 */
379 
380 #define wkt_yywrap() 1
381 #define YY_SKIP_YYWRAP
382 
383 typedef unsigned char YY_CHAR;
384 
385 FILE *wkt_yyin = (FILE *) 0, *wkt_yyout = (FILE *) 0;
386 
387 typedef int yy_state_type;
388 
389 extern int wkt_yylineno;
390 
391 int wkt_yylineno = 1;
392 
393 extern char *wkt_yytext;
394 #define yytext_ptr wkt_yytext
395 
396 static yy_state_type yy_get_previous_state (void );
397 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
398 static int yy_get_next_buffer (void );
399 static void yy_fatal_error (yyconst char msg[] );
400 
401 /* Done after the current pattern has been matched and before the
402  * corresponding action - sets up wkt_yytext.
403  */
404 #define YY_DO_BEFORE_ACTION \
405  (yytext_ptr) = yy_bp; \
406  wkt_yyleng = (size_t) (yy_cp - yy_bp); \
407  (yy_hold_char) = *yy_cp; \
408  *yy_cp = '\0'; \
409  (yy_c_buf_p) = yy_cp;
410 
411 #define YY_NUM_RULES 26
412 #define YY_END_OF_BUFFER 27
413 /* This struct is not used in this scanner,
414  but its presence is necessary. */
416  {
419  };
421  { 0,
422  0, 0, 27, 25, 24, 24, 20, 21, 22, 25,
423  25, 1, 23, 25, 25, 25, 25, 19, 25, 25,
424  25, 19, 24, 0, 1, 1, 1, 0, 0, 0,
425  0, 0, 0, 0, 0, 0, 0, 0, 0, 19,
426  0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
427  0, 0, 16, 0, 0, 0, 0, 0, 0, 0,
428  0, 0, 0, 0, 0, 0, 0, 0, 18, 0,
429  0, 0, 17, 0, 0, 0, 0, 0, 0, 0,
430  0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
431  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
432 
433  10, 0, 0, 0, 0, 0, 0, 0, 0, 0,
434  0, 0, 0, 0, 15, 0, 0, 0, 0, 0,
435  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
436  13, 6, 0, 8, 0, 0, 0, 0, 0, 0,
437  0, 0, 0, 0, 0, 0, 0, 9, 0, 0,
438  5, 4, 0, 0, 11, 0, 0, 0, 12, 0,
439  0, 0, 0, 7, 0, 0, 0, 0, 14, 3,
440  0
441  } ;
442 
444  { 0,
445  1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
446  1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
447  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
448  1, 2, 1, 1, 1, 1, 1, 1, 1, 4,
449  5, 1, 6, 7, 8, 9, 1, 10, 10, 10,
450  10, 10, 10, 10, 10, 10, 10, 1, 11, 1,
451  12, 1, 1, 1, 13, 1, 14, 15, 16, 17,
452  18, 19, 20, 1, 1, 21, 22, 23, 24, 25,
453  1, 26, 27, 28, 29, 30, 1, 1, 31, 32,
454  1, 1, 1, 1, 1, 1, 33, 1, 34, 35,
455 
456  36, 37, 38, 39, 40, 1, 1, 41, 42, 43,
457  44, 45, 1, 46, 47, 48, 49, 50, 1, 1,
458  51, 52, 1, 1, 1, 1, 1, 1, 1, 1,
459  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
460  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
461  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
462  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
463  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
464  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
465  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
466 
467  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
468  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
469  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
470  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
471  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
472  1, 1, 1, 1, 1
473  } ;
474 
476  { 0,
477  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
478  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
479  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
480  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
481  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
482  1, 1
483  } ;
484 
486  { 0,
487  0, 0, 353, 366, 51, 53, 366, 366, 366, 48,
488  342, 50, 366, 41, 40, 47, 44, 38, 44, 43,
489  51, 50, 71, 341, 84, 85, 340, 70, 53, 74,
490  72, 77, 79, 81, 84, 86, 88, 86, 90, 366,
491  339, 338, 97, 87, 83, 86, 93, 101, 91, 113,
492  107, 125, 366, 128, 113, 119, 128, 114, 130, 120,
493  128, 121, 132, 335, 129, 132, 125, 130, 366, 129,
494  131, 166, 366, 152, 162, 173, 164, 171, 162, 162,
495  162, 163, 161, 172, 170, 166, 174, 184, 336, 65,
496  180, 177, 201, 197, 189, 202, 198, 202, 206, 202,
497 
498  366, 203, 214, 204, 218, 202, 220, 212, 207, 223,
499  218, 212, 239, 245, 366, 232, 233, 246, 241, 248,
500  251, 241, 241, 252, 258, 251, 247, 248, 251, 256,
501  366, 366, 251, 366, 257, 269, 269, 278, 270, 279,
502  283, 279, 283, 291, 279, 286, 294, 366, 295, 292,
503  366, 366, 287, 296, 366, 301, 294, 302, 366, 293,
504  305, 323, 318, 366, 326, 318, 328, 322, 366, 366,
505  366
506  } ;
507 
509  { 0,
510  171, 1, 171, 171, 171, 171, 171, 171, 171, 171,
511  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
512  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
513  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
514  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
515  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
516  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
517  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
518  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
519  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
520 
521  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
522  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
523  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
524  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
525  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
526  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
527  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
528  0
529  } ;
530 
532  { 0,
533  4, 5, 6, 7, 8, 4, 9, 10, 11, 12,
534  13, 4, 4, 14, 4, 15, 4, 16, 4, 4,
535  17, 18, 4, 4, 19, 4, 20, 21, 4, 4,
536  4, 22, 4, 14, 4, 15, 4, 16, 4, 4,
537  17, 18, 4, 4, 19, 4, 20, 21, 4, 4,
538  4, 22, 23, 23, 23, 23, 24, 25, 27, 25,
539  29, 32, 33, 34, 30, 28, 35, 36, 37, 31,
540  38, 40, 23, 23, 90, 41, 39, 41, 43, 42,
541  29, 32, 33, 34, 30, 28, 35, 36, 37, 31,
542  38, 40, 27, 25, 26, 44, 39, 45, 43, 28,
543 
544  28, 46, 47, 48, 49, 50, 51, 52, 53, 54,
545  55, 56, 57, 58, 59, 44, 60, 45, 61, 28,
546  28, 46, 47, 48, 49, 50, 51, 52, 53, 54,
547  55, 56, 57, 58, 59, 62, 60, 63, 61, 64,
548  65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
549  75, 77, 78, 79, 80, 62, 81, 63, 82, 64,
550  65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
551  75, 77, 78, 79, 80, 87, 81, 88, 82, 83,
552  89, 91, 90, 92, 93, 94, 84, 95, 96, 97,
553  85, 98, 86, 99, 100, 87, 101, 88, 102, 83,
554 
555  103, 91, 104, 92, 93, 94, 84, 95, 96, 97,
556  85, 98, 86, 99, 100, 105, 101, 106, 102, 107,
557  103, 108, 104, 109, 110, 111, 112, 113, 114, 115,
558  116, 117, 118, 119, 120, 105, 121, 106, 122, 107,
559  123, 108, 124, 109, 110, 111, 112, 113, 114, 115,
560  116, 117, 118, 119, 120, 125, 121, 126, 122, 127,
561  123, 128, 124, 129, 130, 131, 132, 133, 134, 135,
562  136, 137, 138, 139, 140, 125, 141, 126, 142, 127,
563  143, 128, 144, 129, 130, 131, 132, 133, 134, 135,
564  136, 137, 138, 139, 140, 145, 141, 146, 142, 147,
565 
566  143, 148, 144, 149, 150, 151, 152, 153, 154, 155,
567  156, 157, 158, 159, 160, 145, 161, 146, 162, 147,
568  163, 148, 164, 149, 150, 151, 152, 153, 154, 155,
569  156, 157, 158, 159, 160, 165, 161, 166, 162, 167,
570  163, 168, 164, 169, 170, 90, 76, 42, 42, 26,
571  26, 26, 171, 171, 171, 165, 171, 166, 171, 167,
572  171, 168, 171, 169, 170, 3, 171, 171, 171, 171,
573  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
574  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
575  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
576 
577  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
578  171, 171, 171, 171, 171, 171, 171, 171
579  } ;
580 
582  { 0,
583  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
584  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
585  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
586  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
587  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
588  1, 1, 5, 5, 6, 6, 10, 10, 12, 12,
589  14, 15, 16, 17, 14, 12, 18, 19, 20, 14,
590  21, 22, 23, 23, 90, 28, 21, 28, 29, 28,
591  14, 15, 16, 17, 14, 12, 18, 19, 20, 14,
592  21, 22, 25, 25, 26, 30, 21, 31, 29, 25,
593 
594  26, 32, 33, 34, 35, 36, 36, 37, 38, 39,
595  43, 44, 45, 46, 47, 30, 48, 31, 49, 25,
596  26, 32, 33, 34, 35, 36, 36, 37, 38, 39,
597  43, 44, 45, 46, 47, 50, 48, 51, 49, 52,
598  54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
599  63, 65, 66, 67, 68, 50, 70, 51, 71, 52,
600  54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
601  63, 65, 66, 67, 68, 74, 70, 75, 71, 72,
602  76, 77, 76, 78, 79, 80, 72, 81, 82, 83,
603  72, 84, 72, 85, 86, 74, 87, 75, 88, 72,
604 
605  91, 77, 92, 78, 79, 80, 72, 81, 82, 83,
606  72, 84, 72, 85, 86, 93, 87, 94, 88, 95,
607  91, 96, 92, 97, 98, 99, 99, 100, 102, 103,
608  104, 105, 106, 107, 108, 93, 109, 94, 110, 95,
609  111, 96, 112, 97, 98, 99, 99, 100, 102, 103,
610  104, 105, 106, 107, 108, 113, 109, 114, 110, 116,
611  111, 117, 112, 118, 119, 120, 121, 122, 123, 124,
612  125, 126, 127, 128, 129, 113, 130, 114, 133, 116,
613  135, 117, 136, 118, 119, 120, 121, 122, 123, 124,
614  125, 126, 127, 128, 129, 137, 130, 138, 133, 139,
615 
616  135, 140, 136, 141, 142, 143, 144, 145, 146, 147,
617  149, 150, 153, 154, 156, 137, 157, 138, 158, 139,
618  160, 140, 161, 141, 142, 143, 144, 145, 146, 147,
619  149, 150, 153, 154, 156, 162, 157, 163, 158, 165,
620  160, 166, 161, 167, 168, 89, 64, 42, 41, 27,
621  24, 11, 3, 0, 0, 162, 0, 163, 0, 165,
622  0, 166, 0, 167, 168, 171, 171, 171, 171, 171,
623  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
624  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
625  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
626 
627  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
628  171, 171, 171, 171, 171, 171, 171, 171
629  } ;
630 
631 static yy_state_type yy_last_accepting_state;
633 
634 extern int wkt_yy_flex_debug;
635 int wkt_yy_flex_debug = 0;
636 
637 /* The intent behind this definition is that it'll catch
638  * any uses of REJECT which flex missed.
639  */
640 #define REJECT reject_used_but_not_detected
641 #define yymore() yymore_used_but_not_detected
642 #define YY_MORE_ADJ 0
643 #define YY_RESTORE_YY_MORE_OFFSET
645 #line 1 "lwin_wkt_lex.l"
646 #line 2 "lwin_wkt_lex.l"
647 
648 /* The lexer */
649 
650 #include <stdio.h>
651 #include <string.h>
652 #include "lwin_wkt.h"
653 #include "lwin_wkt_parse.h"
654 #include "lwgeom_log.h"
655 
656 static YY_BUFFER_STATE wkt_yy_buf_state;
657 
658 
659 /*
660 * Set up the lexer!
661 */
662 void wkt_lexer_init(char *src)
663 {
664  wkt_yy_buf_state = wkt_yy_scan_string(src);
665 }
666 
667 /*
668 * Clean up the lexer!
669 */
671 {
672  wkt_yy_delete_buffer(wkt_yy_buf_state);
673 }
674 
675 /*
676 * Handle errors due to unexpected junk in WKT strings.
677 */
678 static void wkt_lexer_unknown()
679 {
680  /* Set the global error state */
684 }
685 
686 
687 /*
688 * This macro is magically run after a rule is found but before the main
689 * action is run. We use it to update the parse location information
690 * so we can report on where things fail. Also optionally to dump
691 * debugging info.
692 */
693 #define YY_USER_ACTION do { \
694  wkt_yylloc.first_line = wkt_yylloc.last_line = wkt_yylineno; \
695  wkt_yylloc.first_column = wkt_yylloc.last_column; \
696  wkt_yylloc.last_column += wkt_yyleng; \
697  LWDEBUGF(5,"lex: %s", wkt_yytext); \
698  } while (0);
699 
700 
701 #define YY_NO_INPUT 1
702 /* Suppress the default implementations. */
703 #line 679 "lwin_wkt_lex.c"
704 
705 #define INITIAL 0
706 
707 #ifndef YY_NO_UNISTD_H
708 /* Special case for "unistd.h", since it is non-ANSI. We include it way
709  * down here because we want the user's section 1 to have been scanned first.
710  * The user has a chance to override it with an option.
711  */
712 #include <unistd.h>
713 #endif
714 
715 #ifndef YY_EXTRA_TYPE
716 #define YY_EXTRA_TYPE void *
717 #endif
718 
719 static int yy_init_globals (void );
720 
721 /* Accessor methods to globals.
722  These are made visible to non-reentrant scanners for convenience. */
723 
724 int wkt_yylex_destroy (void );
725 
726 int wkt_yyget_debug (void );
727 
728 void wkt_yyset_debug (int debug_flag );
729 
731 
732 void wkt_yyset_extra (YY_EXTRA_TYPE user_defined );
733 
734 FILE *wkt_yyget_in (void );
735 
736 void wkt_yyset_in (FILE * in_str );
737 
738 FILE *wkt_yyget_out (void );
739 
740 void wkt_yyset_out (FILE * out_str );
741 
742 yy_size_t wkt_yyget_leng (void );
743 
744 char *wkt_yyget_text (void );
745 
746 int wkt_yyget_lineno (void );
747 
748 void wkt_yyset_lineno (int line_number );
749 
750 /* Macros after this point can all be overridden by user definitions in
751  * section 1.
752  */
753 
754 #ifndef YY_SKIP_YYWRAP
755 #ifdef __cplusplus
756 extern "C" int wkt_yywrap (void );
757 #else
758 extern int wkt_yywrap (void );
759 #endif
760 #endif
761 
762 #ifndef yytext_ptr
763 static void yy_flex_strncpy (char *,yyconst char *,int );
764 #endif
765 
766 #ifdef YY_NEED_STRLEN
767 static int yy_flex_strlen (yyconst char * );
768 #endif
769 
770 #ifndef YY_NO_INPUT
771 
772 #ifdef __cplusplus
773 static int yyinput (void );
774 #else
775 static int input (void );
776 #endif
777 
778 #endif
779 
780 /* Amount of stuff to slurp up with each read. */
781 #ifndef YY_READ_BUF_SIZE
782 #define YY_READ_BUF_SIZE 8192
783 #endif
784 
785 /* Copy whatever the last rule matched to the standard output. */
786 #ifndef ECHO
787 /* This used to be an fputs(), but since the string might contain NUL's,
788  * we now use fwrite().
789  */
790 #define ECHO do { if (fwrite( wkt_yytext, wkt_yyleng, 1, wkt_yyout )) {} } while (0)
791 #endif
792 
793 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
794  * is returned in "result".
795  */
796 #ifndef YY_INPUT
797 #define YY_INPUT(buf,result,max_size) \
798  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
799  { \
800  int c = '*'; \
801  size_t n; \
802  for ( n = 0; n < max_size && \
803  (c = getc( wkt_yyin )) != EOF && c != '\n'; ++n ) \
804  buf[n] = (char) c; \
805  if ( c == '\n' ) \
806  buf[n++] = (char) c; \
807  if ( c == EOF && ferror( wkt_yyin ) ) \
808  YY_FATAL_ERROR( "input in flex scanner failed" ); \
809  result = n; \
810  } \
811  else \
812  { \
813  errno=0; \
814  while ( (result = fread(buf, 1, max_size, wkt_yyin))==0 && ferror(wkt_yyin)) \
815  { \
816  if( errno != EINTR) \
817  { \
818  YY_FATAL_ERROR( "input in flex scanner failed" ); \
819  break; \
820  } \
821  errno=0; \
822  clearerr(wkt_yyin); \
823  } \
824  }\
825 \
826 
827 #endif
828 
829 /* No semi-colon after return; correct usage is to write "yyterminate();" -
830  * we don't want an extra ';' after the "return" because that will cause
831  * some compilers to complain about unreachable statements.
832  */
833 #ifndef yyterminate
834 #define yyterminate() return YY_NULL
835 #endif
836 
837 /* Number of entries by which start-condition stack grows. */
838 #ifndef YY_START_STACK_INCR
839 #define YY_START_STACK_INCR 25
840 #endif
841 
842 /* Report a fatal error. */
843 #ifndef YY_FATAL_ERROR
844 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
845 #endif
846 
847 /* end tables serialization structures and prototypes */
848 
849 /* Default declaration of generated scanner - a define so the user can
850  * easily add parameters.
851  */
852 #ifndef YY_DECL
853 #define YY_DECL_IS_OURS 1
854 
855 extern int wkt_yylex (void);
856 
857 #define YY_DECL int wkt_yylex (void)
858 #endif /* !YY_DECL */
859 
860 /* Code executed at the beginning of each rule, after wkt_yytext and wkt_yyleng
861  * have been set up.
862  */
863 #ifndef YY_USER_ACTION
864 #define YY_USER_ACTION
865 #endif
866 
867 /* Code executed at the end of each rule. */
868 #ifndef YY_BREAK
869 #define YY_BREAK break;
870 #endif
871 
872 #define YY_RULE_SETUP \
873  YY_USER_ACTION
874 
877 YY_DECL
878 {
879  register yy_state_type yy_current_state;
880  register char *yy_cp, *yy_bp;
881  register int yy_act;
882 
883 #line 67 "lwin_wkt_lex.l"
884 
885 
886 #line 862 "lwin_wkt_lex.c"
887 
888  if ( !(yy_init) )
889  {
890  (yy_init) = 1;
891 
892 #ifdef YY_USER_INIT
893  YY_USER_INIT;
894 #endif
895 
896  if ( ! (yy_start) )
897  (yy_start) = 1; /* first start state */
898 
899  if ( ! wkt_yyin )
900  wkt_yyin = stdin;
901 
902  if ( ! wkt_yyout )
903  wkt_yyout = stdout;
904 
905  if ( ! YY_CURRENT_BUFFER ) {
909  }
910 
912  }
913 
914  while ( 1 ) /* loops until end-of-file is reached */
915  {
916  yy_cp = (yy_c_buf_p);
917 
918  /* Support of wkt_yytext. */
919  *yy_cp = (yy_hold_char);
920 
921  /* yy_bp points to the position in yy_ch_buf of the start of
922  * the current run.
923  */
924  yy_bp = yy_cp;
925 
926  yy_current_state = (yy_start);
927 yy_match:
928  do
929  {
930  register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
931  if ( yy_accept[yy_current_state] )
932  {
933  (yy_last_accepting_state) = yy_current_state;
934  (yy_last_accepting_cpos) = yy_cp;
935  }
936  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
937  {
938  yy_current_state = (int) yy_def[yy_current_state];
939  if ( yy_current_state >= 172 )
940  yy_c = yy_meta[(unsigned int) yy_c];
941  }
942  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
943  ++yy_cp;
944  }
945  while ( yy_current_state != 171 );
946  yy_cp = (yy_last_accepting_cpos);
947  yy_current_state = (yy_last_accepting_state);
948 
949 yy_find_action:
950  yy_act = yy_accept[yy_current_state];
951 
953 
954 do_action: /* This label is used only to access EOF actions. */
955 
956  switch ( yy_act )
957  { /* beginning of action switch */
958  case 0: /* must back up */
959  /* undo the effects of YY_DO_BEFORE_ACTION */
960  *yy_cp = (yy_hold_char);
961  yy_cp = (yy_last_accepting_cpos);
962  yy_current_state = (yy_last_accepting_state);
963  goto yy_find_action;
964 
965 case 1:
967 #line 69 "lwin_wkt_lex.l"
968 {
969  LWDEBUG(5,"DOUBLE");
970  wkt_yylval.doublevalue = atof(wkt_yytext);
971  return DOUBLE_TOK;
972  }
973  YY_BREAK
974 case 2:
976 #line 75 "lwin_wkt_lex.l"
977 {
978  LWDEBUG(5,"SRID");
980  return SRID_TOK;
981  }
982  YY_BREAK
983 case 3:
985 #line 81 "lwin_wkt_lex.l"
986 { return COLLECTION_TOK; }
987  YY_BREAK
988 case 4:
990 #line 82 "lwin_wkt_lex.l"
991 { return MSURFACE_TOK; }
992  YY_BREAK
993 case 5:
995 #line 83 "lwin_wkt_lex.l"
996 { return MPOLYGON_TOK; }
997  YY_BREAK
998 case 6:
1000 #line 84 "lwin_wkt_lex.l"
1001 { return MCURVE_TOK; }
1002  YY_BREAK
1003 case 7:
1005 #line 85 "lwin_wkt_lex.l"
1006 { return MLINESTRING_TOK; }
1007  YY_BREAK
1008 case 8:
1010 #line 86 "lwin_wkt_lex.l"
1011 { return MPOINT_TOK; }
1012  YY_BREAK
1013 case 9:
1015 #line 87 "lwin_wkt_lex.l"
1016 { return CURVEPOLYGON_TOK; }
1017  YY_BREAK
1018 case 10:
1020 #line 88 "lwin_wkt_lex.l"
1021 { return POLYGON_TOK; }
1022  YY_BREAK
1023 case 11:
1025 #line 89 "lwin_wkt_lex.l"
1026 { return COMPOUNDCURVE_TOK; }
1027  YY_BREAK
1028 case 12:
1030 #line 90 "lwin_wkt_lex.l"
1031 { return CIRCULARSTRING_TOK; }
1032  YY_BREAK
1033 case 13:
1035 #line 91 "lwin_wkt_lex.l"
1036 { return LINESTRING_TOK; }
1037  YY_BREAK
1038 case 14:
1040 #line 92 "lwin_wkt_lex.l"
1041 { return POLYHEDRALSURFACE_TOK; }
1042  YY_BREAK
1043 case 15:
1045 #line 93 "lwin_wkt_lex.l"
1046 { return TRIANGLE_TOK; }
1047  YY_BREAK
1048 case 16:
1050 #line 94 "lwin_wkt_lex.l"
1051 { return TIN_TOK; }
1052  YY_BREAK
1053 case 17:
1055 #line 95 "lwin_wkt_lex.l"
1056 { return POINT_TOK; }
1057  YY_BREAK
1058 case 18:
1060 #line 96 "lwin_wkt_lex.l"
1061 { return EMPTY_TOK; }
1062  YY_BREAK
1063 case 19:
1065 #line 98 "lwin_wkt_lex.l"
1066 {
1067  LWDEBUG(5,"DIMENSIONALITY");
1069  return DIMENSIONALITY_TOK;
1070  }
1071  YY_BREAK
1072 case 20:
1074 #line 104 "lwin_wkt_lex.l"
1075 { LWDEBUG(5,"LBRACKET"); return LBRACKET_TOK; }
1076  YY_BREAK
1077 case 21:
1079 #line 105 "lwin_wkt_lex.l"
1080 { LWDEBUG(5,"RBRACKET"); return RBRACKET_TOK; }
1081  YY_BREAK
1082 case 22:
1084 #line 106 "lwin_wkt_lex.l"
1085 { LWDEBUG(5,"COMMA"); return COMMA_TOK; }
1086  YY_BREAK
1087 case 23:
1089 #line 107 "lwin_wkt_lex.l"
1090 { LWDEBUG(5,"SEMICOLON"); return SEMICOLON_TOK; }
1091  YY_BREAK
1092 case 24:
1093 /* rule 24 can match eol */
1095 #line 109 "lwin_wkt_lex.l"
1096 { /* ignore whitespace */ LWDEBUG(5,"WHITESPACE"); }
1097  YY_BREAK
1098 case 25:
1100 #line 111 "lwin_wkt_lex.l"
1101 { /* Error out and stop parsing on unknown/unexpected characters */
1102  LWDEBUG(5,"UNKNOWN");
1104  yyterminate();
1105  }
1106  YY_BREAK
1107 case 26:
1109 #line 117 "lwin_wkt_lex.l"
1110 ECHO;
1111  YY_BREAK
1112 #line 1088 "lwin_wkt_lex.c"
1113 case YY_STATE_EOF(INITIAL):
1114  yyterminate();
1115 
1116  case YY_END_OF_BUFFER:
1117  {
1118  /* Amount of text matched not including the EOB char. */
1119  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1120 
1121  /* Undo the effects of YY_DO_BEFORE_ACTION. */
1122  *yy_cp = (yy_hold_char);
1124 
1125  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1126  {
1127  /* We're scanning a new file or input source. It's
1128  * possible that this happened because the user
1129  * just pointed wkt_yyin at a new source and called
1130  * wkt_yylex(). If so, then we have to assure
1131  * consistency between YY_CURRENT_BUFFER and our
1132  * globals. Here is the right place to do so, because
1133  * this is the first action (other than possibly a
1134  * back-up) that will match for the new input source.
1135  */
1136  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1137  YY_CURRENT_BUFFER_LVALUE->yy_input_file = wkt_yyin;
1138  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1139  }
1140 
1141  /* Note that here we test for yy_c_buf_p "<=" to the position
1142  * of the first EOB in the buffer, since yy_c_buf_p will
1143  * already have been incremented past the NUL character
1144  * (since all states make transitions on EOB to the
1145  * end-of-buffer state). Contrast this with the test
1146  * in input().
1147  */
1148  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1149  { /* This was really a NUL. */
1150  yy_state_type yy_next_state;
1151 
1152  (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1153 
1154  yy_current_state = yy_get_previous_state( );
1155 
1156  /* Okay, we're now positioned to make the NUL
1157  * transition. We couldn't have
1158  * yy_get_previous_state() go ahead and do it
1159  * for us because it doesn't know how to deal
1160  * with the possibility of jamming (and we don't
1161  * want to build jamming into it because then it
1162  * will run more slowly).
1163  */
1164 
1165  yy_next_state = yy_try_NUL_trans( yy_current_state );
1166 
1167  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1168 
1169  if ( yy_next_state )
1170  {
1171  /* Consume the NUL. */
1172  yy_cp = ++(yy_c_buf_p);
1173  yy_current_state = yy_next_state;
1174  goto yy_match;
1175  }
1176 
1177  else
1178  {
1179  yy_cp = (yy_last_accepting_cpos);
1180  yy_current_state = (yy_last_accepting_state);
1181  goto yy_find_action;
1182  }
1183  }
1184 
1185  else switch ( yy_get_next_buffer( ) )
1186  {
1187  case EOB_ACT_END_OF_FILE:
1188  {
1190 
1191  if ( wkt_yywrap( ) )
1192  {
1193  /* Note: because we've taken care in
1194  * yy_get_next_buffer() to have set up
1195  * wkt_yytext, we can now set up
1196  * yy_c_buf_p so that if some total
1197  * hoser (like flex itself) wants to
1198  * call the scanner after we return the
1199  * YY_NULL, it'll still work - another
1200  * YY_NULL will get returned.
1201  */
1203 
1204  yy_act = YY_STATE_EOF(YY_START);
1205  goto do_action;
1206  }
1207 
1208  else
1209  {
1210  if ( ! (yy_did_buffer_switch_on_eof) )
1211  YY_NEW_FILE;
1212  }
1213  break;
1214  }
1215 
1216  case EOB_ACT_CONTINUE_SCAN:
1217  (yy_c_buf_p) =
1218  (yytext_ptr) + yy_amount_of_matched_text;
1219 
1220  yy_current_state = yy_get_previous_state( );
1221 
1222  yy_cp = (yy_c_buf_p);
1223  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1224  goto yy_match;
1225 
1226  case EOB_ACT_LAST_MATCH:
1227  (yy_c_buf_p) =
1228  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1229 
1230  yy_current_state = yy_get_previous_state( );
1231 
1232  yy_cp = (yy_c_buf_p);
1233  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1234  goto yy_find_action;
1235  }
1236  break;
1237  }
1238 
1239  default:
1241  "fatal flex scanner internal error--no action found" );
1242  } /* end of action switch */
1243  } /* end of scanning one token */
1244 } /* end of wkt_yylex */
1245 
1246 /* yy_get_next_buffer - try to read in a new buffer
1247  *
1248  * Returns a code representing an action:
1249  * EOB_ACT_LAST_MATCH -
1250  * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1251  * EOB_ACT_END_OF_FILE - end of file
1252  */
1253 static int yy_get_next_buffer (void)
1254 {
1255  register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1256  register char *source = (yytext_ptr);
1257  register int number_to_move, i;
1258  int ret_val;
1259 
1260  if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1262  "fatal flex scanner internal error--end of buffer missed" );
1263 
1264  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1265  { /* Don't try to fill the buffer, so this is an EOF. */
1266  if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1267  {
1268  /* We matched a single character, the EOB, so
1269  * treat this as a final EOF.
1270  */
1271  return EOB_ACT_END_OF_FILE;
1272  }
1273 
1274  else
1275  {
1276  /* We matched some text prior to the EOB, first
1277  * process it.
1278  */
1279  return EOB_ACT_LAST_MATCH;
1280  }
1281  }
1282 
1283  /* Try to read more data. */
1284 
1285  /* First move last chars to start of buffer. */
1286  number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1287 
1288  for ( i = 0; i < number_to_move; ++i )
1289  *(dest++) = *(source++);
1290 
1291  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1292  /* don't do the read, it's not guaranteed to return an EOF,
1293  * just force an EOF
1294  */
1295  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1296 
1297  else
1298  {
1299  yy_size_t num_to_read =
1300  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1301 
1302  while ( num_to_read <= 0 )
1303  { /* Not enough room in the buffer - grow it. */
1304 
1305  /* just a shorter name for the current buffer */
1306  YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1307 
1308  int yy_c_buf_p_offset =
1309  (int) ((yy_c_buf_p) - b->yy_ch_buf);
1310 
1311  if ( b->yy_is_our_buffer )
1312  {
1313  yy_size_t new_size = b->yy_buf_size * 2;
1314 
1315  if ( new_size <= 0 )
1316  b->yy_buf_size += b->yy_buf_size / 8;
1317  else
1318  b->yy_buf_size *= 2;
1319 
1320  b->yy_ch_buf = (char *)
1321  /* Include room in for 2 EOB chars. */
1322  wkt_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1323  }
1324  else
1325  /* Can't grow it, we don't own it. */
1326  b->yy_ch_buf = 0;
1327 
1328  if ( ! b->yy_ch_buf )
1330  "fatal error - scanner input buffer overflow" );
1331 
1332  (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1333 
1334  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1335  number_to_move - 1;
1336 
1337  }
1338 
1339  if ( num_to_read > YY_READ_BUF_SIZE )
1340  num_to_read = YY_READ_BUF_SIZE;
1341 
1342  /* Read in more data. */
1343  YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1344  (yy_n_chars), num_to_read );
1345 
1346  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1347  }
1348 
1349  if ( (yy_n_chars) == 0 )
1350  {
1351  if ( number_to_move == YY_MORE_ADJ )
1352  {
1353  ret_val = EOB_ACT_END_OF_FILE;
1355  }
1356 
1357  else
1358  {
1359  ret_val = EOB_ACT_LAST_MATCH;
1360  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1362  }
1363  }
1364 
1365  else
1366  ret_val = EOB_ACT_CONTINUE_SCAN;
1367 
1368  if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1369  /* Extend the array by 50%, plus the number we really need. */
1370  yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1371  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) wkt_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1372  if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1373  YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1374  }
1375 
1376  (yy_n_chars) += number_to_move;
1379 
1380  (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1381 
1382  return ret_val;
1383 }
1384 
1385 /* yy_get_previous_state - get the state just before the EOB char was reached */
1386 
1387  static yy_state_type yy_get_previous_state (void)
1388 {
1389  register yy_state_type yy_current_state;
1390  register char *yy_cp;
1391 
1392  yy_current_state = (yy_start);
1393 
1394  for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1395  {
1396  register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1397  if ( yy_accept[yy_current_state] )
1398  {
1399  (yy_last_accepting_state) = yy_current_state;
1400  (yy_last_accepting_cpos) = yy_cp;
1401  }
1402  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1403  {
1404  yy_current_state = (int) yy_def[yy_current_state];
1405  if ( yy_current_state >= 172 )
1406  yy_c = yy_meta[(unsigned int) yy_c];
1407  }
1408  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1409  }
1410 
1411  return yy_current_state;
1412 }
1413 
1414 /* yy_try_NUL_trans - try to make a transition on the NUL character
1415  *
1416  * synopsis
1417  * next_state = yy_try_NUL_trans( current_state );
1418  */
1419  static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1420 {
1421  register int yy_is_jam;
1422  register char *yy_cp = (yy_c_buf_p);
1423 
1424  register YY_CHAR yy_c = 1;
1425  if ( yy_accept[yy_current_state] )
1426  {
1427  (yy_last_accepting_state) = yy_current_state;
1428  (yy_last_accepting_cpos) = yy_cp;
1429  }
1430  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1431  {
1432  yy_current_state = (int) yy_def[yy_current_state];
1433  if ( yy_current_state >= 172 )
1434  yy_c = yy_meta[(unsigned int) yy_c];
1435  }
1436  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1437  yy_is_jam = (yy_current_state == 171);
1438 
1439  return yy_is_jam ? 0 : yy_current_state;
1440 }
1441 
1442 #ifndef YY_NO_INPUT
1443 #ifdef __cplusplus
1444  static int yyinput (void)
1445 #else
1446  static int input (void)
1447 #endif
1448 
1449 {
1450  int c;
1451 
1452  *(yy_c_buf_p) = (yy_hold_char);
1453 
1454  if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1455  {
1456  /* yy_c_buf_p now points to the character we want to return.
1457  * If this occurs *before* the EOB characters, then it's a
1458  * valid NUL; if not, then we've hit the end of the buffer.
1459  */
1460  if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1461  /* This was really a NUL. */
1462  *(yy_c_buf_p) = '\0';
1463 
1464  else
1465  { /* need more input */
1466  yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1467  ++(yy_c_buf_p);
1468 
1469  switch ( yy_get_next_buffer( ) )
1470  {
1471  case EOB_ACT_LAST_MATCH:
1472  /* This happens because yy_g_n_b()
1473  * sees that we've accumulated a
1474  * token and flags that we need to
1475  * try matching the token before
1476  * proceeding. But for input(),
1477  * there's no matching to consider.
1478  * So convert the EOB_ACT_LAST_MATCH
1479  * to EOB_ACT_END_OF_FILE.
1480  */
1481 
1482  /* Reset buffer status. */
1484 
1485  /*FALLTHROUGH*/
1486 
1487  case EOB_ACT_END_OF_FILE:
1488  {
1489  if ( wkt_yywrap( ) )
1490  return EOF;
1491 
1492  if ( ! (yy_did_buffer_switch_on_eof) )
1493  YY_NEW_FILE;
1494 #ifdef __cplusplus
1495  return yyinput();
1496 #else
1497  return input();
1498 #endif
1499  }
1500 
1501  case EOB_ACT_CONTINUE_SCAN:
1502  (yy_c_buf_p) = (yytext_ptr) + offset;
1503  break;
1504  }
1505  }
1506  }
1507 
1508  c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1509  *(yy_c_buf_p) = '\0'; /* preserve wkt_yytext */
1510  (yy_hold_char) = *++(yy_c_buf_p);
1511 
1512  return c;
1513 }
1514 #endif /* ifndef YY_NO_INPUT */
1515 
1521  void wkt_yyrestart (FILE * input_file )
1522 {
1523 
1524  if ( ! YY_CURRENT_BUFFER ){
1528  }
1529 
1532 }
1533 
1538  void wkt_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1539 {
1540 
1541  /* TODO. We should be able to replace this entire function body
1542  * with
1543  * wkt_yypop_buffer_state();
1544  * wkt_yypush_buffer_state(new_buffer);
1545  */
1547  if ( YY_CURRENT_BUFFER == new_buffer )
1548  return;
1549 
1550  if ( YY_CURRENT_BUFFER )
1551  {
1552  /* Flush out information for old buffer. */
1553  *(yy_c_buf_p) = (yy_hold_char);
1554  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1555  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1556  }
1557 
1558  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1560 
1561  /* We don't actually know whether we did this switch during
1562  * EOF (wkt_yywrap()) processing, but the only time this flag
1563  * is looked at is after wkt_yywrap() is called, so it's safe
1564  * to go ahead and always set it.
1565  */
1567 }
1568 
1569 static void wkt_yy_load_buffer_state (void)
1570 {
1571  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1572  (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1573  wkt_yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1574  (yy_hold_char) = *(yy_c_buf_p);
1575 }
1576 
1583  YY_BUFFER_STATE wkt_yy_create_buffer (FILE * file, int size )
1584 {
1585  YY_BUFFER_STATE b;
1586 
1587  b = (YY_BUFFER_STATE) wkt_yyalloc(sizeof( struct yy_buffer_state ) );
1588  if ( ! b )
1589  YY_FATAL_ERROR( "out of dynamic memory in wkt_yy_create_buffer()" );
1590 
1591  b->yy_buf_size = size;
1592 
1593  /* yy_ch_buf has to be 2 characters longer than the size given because
1594  * we need to put in 2 end-of-buffer characters.
1595  */
1596  b->yy_ch_buf = (char *) wkt_yyalloc(b->yy_buf_size + 2 );
1597  if ( ! b->yy_ch_buf )
1598  YY_FATAL_ERROR( "out of dynamic memory in wkt_yy_create_buffer()" );
1599 
1600  b->yy_is_our_buffer = 1;
1601 
1602  wkt_yy_init_buffer(b,file );
1603 
1604  return b;
1605 }
1606 
1611  void wkt_yy_delete_buffer (YY_BUFFER_STATE b )
1612 {
1613 
1614  if ( ! b )
1615  return;
1616 
1617  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1619 
1620  if ( b->yy_is_our_buffer )
1621  wkt_yyfree((void *) b->yy_ch_buf );
1622 
1623  wkt_yyfree((void *) b );
1624 }
1625 
1626 /* Initializes or reinitializes a buffer.
1627  * This function is sometimes called more than once on the same buffer,
1628  * such as during a wkt_yyrestart() or at EOF.
1629  */
1630  static void wkt_yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1631 
1632 {
1633  int oerrno = errno;
1634 
1635  wkt_yy_flush_buffer(b );
1636 
1637  b->yy_input_file = file;
1638  b->yy_fill_buffer = 1;
1639 
1640  /* If b is the current buffer, then wkt_yy_init_buffer was _probably_
1641  * called from wkt_yyrestart() or through yy_get_next_buffer.
1642  * In that case, we don't want to reset the lineno or column.
1643  */
1644  if (b != YY_CURRENT_BUFFER){
1645  b->yy_bs_lineno = 1;
1646  b->yy_bs_column = 0;
1647  }
1648 
1649  b->yy_is_interactive = 0;
1650 
1651  errno = oerrno;
1652 }
1653 
1658  void wkt_yy_flush_buffer (YY_BUFFER_STATE b )
1659 {
1660  if ( ! b )
1661  return;
1662 
1663  b->yy_n_chars = 0;
1664 
1665  /* We always need two end-of-buffer characters. The first causes
1666  * a transition to the end-of-buffer state. The second causes
1667  * a jam in that state.
1668  */
1671 
1672  b->yy_buf_pos = &b->yy_ch_buf[0];
1673 
1674  b->yy_at_bol = 1;
1676 
1677  if ( b == YY_CURRENT_BUFFER )
1679 }
1680 
1687 void wkt_yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1688 {
1689  if (new_buffer == NULL)
1690  return;
1691 
1693 
1694  /* This block is copied from wkt_yy_switch_to_buffer. */
1695  if ( YY_CURRENT_BUFFER )
1696  {
1697  /* Flush out information for old buffer. */
1698  *(yy_c_buf_p) = (yy_hold_char);
1699  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1700  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1701  }
1702 
1703  /* Only push if top exists. Otherwise, replace top. */
1704  if (YY_CURRENT_BUFFER)
1705  (yy_buffer_stack_top)++;
1706  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1707 
1708  /* copied from wkt_yy_switch_to_buffer. */
1711 }
1712 
1718 {
1719  if (!YY_CURRENT_BUFFER)
1720  return;
1721 
1723  YY_CURRENT_BUFFER_LVALUE = NULL;
1724  if ((yy_buffer_stack_top) > 0)
1725  --(yy_buffer_stack_top);
1726 
1727  if (YY_CURRENT_BUFFER) {
1730  }
1731 }
1732 
1733 /* Allocates the stack if it does not exist.
1734  * Guarantees space for at least one push.
1735  */
1736 static void wkt_yyensure_buffer_stack (void)
1737 {
1738  yy_size_t num_to_alloc;
1739 
1740  if (!(yy_buffer_stack)) {
1741 
1742  /* First allocation is just for 2 elements, since we don't know if this
1743  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1744  * immediate realloc on the next call.
1745  */
1746  num_to_alloc = 1;
1748  (num_to_alloc * sizeof(struct yy_buffer_state*)
1749  );
1750  if ( ! (yy_buffer_stack) )
1751  YY_FATAL_ERROR( "out of dynamic memory in wkt_yyensure_buffer_stack()" );
1752 
1753  memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1754 
1755  (yy_buffer_stack_max) = num_to_alloc;
1756  (yy_buffer_stack_top) = 0;
1757  return;
1758  }
1759 
1760  if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1761 
1762  /* Increase the buffer to prepare for a possible push. */
1763  int grow_size = 8 /* arbitrary grow size */;
1764 
1765  num_to_alloc = (yy_buffer_stack_max) + grow_size;
1767  ((yy_buffer_stack),
1768  num_to_alloc * sizeof(struct yy_buffer_state*)
1769  );
1770  if ( ! (yy_buffer_stack) )
1771  YY_FATAL_ERROR( "out of dynamic memory in wkt_yyensure_buffer_stack()" );
1772 
1773  /* zero only the new slots.*/
1774  memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1775  (yy_buffer_stack_max) = num_to_alloc;
1776  }
1777 }
1778 
1785 YY_BUFFER_STATE wkt_yy_scan_buffer (char * base, yy_size_t size )
1786 {
1787  YY_BUFFER_STATE b;
1788 
1789  if ( size < 2 ||
1790  base[size-2] != YY_END_OF_BUFFER_CHAR ||
1791  base[size-1] != YY_END_OF_BUFFER_CHAR )
1792  /* They forgot to leave room for the EOB's. */
1793  return 0;
1794 
1795  b = (YY_BUFFER_STATE) wkt_yyalloc(sizeof( struct yy_buffer_state ) );
1796  if ( ! b )
1797  YY_FATAL_ERROR( "out of dynamic memory in wkt_yy_scan_buffer()" );
1798 
1799  b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1800  b->yy_buf_pos = b->yy_ch_buf = base;
1801  b->yy_is_our_buffer = 0;
1802  b->yy_input_file = 0;
1803  b->yy_n_chars = b->yy_buf_size;
1804  b->yy_is_interactive = 0;
1805  b->yy_at_bol = 1;
1806  b->yy_fill_buffer = 0;
1808 
1810 
1811  return b;
1812 }
1813 
1822 YY_BUFFER_STATE wkt_yy_scan_string (yyconst char * yystr )
1823 {
1824 
1825  return wkt_yy_scan_bytes(yystr,strlen(yystr) );
1826 }
1827 
1835 YY_BUFFER_STATE wkt_yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
1836 {
1837  YY_BUFFER_STATE b;
1838  char *buf;
1839  yy_size_t n;
1840  int i;
1841 
1842  /* Get memory for full buffer, including space for trailing EOB's. */
1843  n = _yybytes_len + 2;
1844  buf = (char *) wkt_yyalloc(n );
1845  if ( ! buf )
1846  YY_FATAL_ERROR( "out of dynamic memory in wkt_yy_scan_bytes()" );
1847 
1848  for ( i = 0; i < _yybytes_len; ++i )
1849  buf[i] = yybytes[i];
1850 
1851  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1852 
1853  b = wkt_yy_scan_buffer(buf,n );
1854  if ( ! b )
1855  YY_FATAL_ERROR( "bad buffer in wkt_yy_scan_bytes()" );
1856 
1857  /* It's okay to grow etc. this buffer, and we should throw it
1858  * away when we're done.
1859  */
1860  b->yy_is_our_buffer = 1;
1861 
1862  return b;
1863 }
1864 
1865 #ifndef YY_EXIT_FAILURE
1866 #define YY_EXIT_FAILURE 2
1867 #endif
1868 
1869 static void yy_fatal_error (yyconst char* msg )
1870 {
1871  (void) fprintf( stderr, "%s\n", msg );
1872  exit( YY_EXIT_FAILURE );
1873 }
1874 
1875 /* Redefine yyless() so it works in section 3 code. */
1876 
1877 #undef yyless
1878 #define yyless(n) \
1879  do \
1880  { \
1881  /* Undo effects of setting up wkt_yytext. */ \
1882  int yyless_macro_arg = (n); \
1883  YY_LESS_LINENO(yyless_macro_arg);\
1884  wkt_yytext[wkt_yyleng] = (yy_hold_char); \
1885  (yy_c_buf_p) = wkt_yytext + yyless_macro_arg; \
1886  (yy_hold_char) = *(yy_c_buf_p); \
1887  *(yy_c_buf_p) = '\0'; \
1888  wkt_yyleng = yyless_macro_arg; \
1889  } \
1890  while ( 0 )
1891 
1892 /* Accessor methods (get/set functions) to struct members. */
1893 
1898 {
1899 
1900  return wkt_yylineno;
1901 }
1902 
1906 FILE *wkt_yyget_in (void)
1907 {
1908  return wkt_yyin;
1909 }
1910 
1914 FILE *wkt_yyget_out (void)
1915 {
1916  return wkt_yyout;
1917 }
1918 
1923 {
1924  return wkt_yyleng;
1925 }
1926 
1931 char *wkt_yyget_text (void)
1932 {
1933  return wkt_yytext;
1934 }
1935 
1940 void wkt_yyset_lineno (int line_number )
1941 {
1942 
1943  wkt_yylineno = line_number;
1944 }
1945 
1952 void wkt_yyset_in (FILE * in_str )
1953 {
1954  wkt_yyin = in_str ;
1955 }
1956 
1957 void wkt_yyset_out (FILE * out_str )
1958 {
1959  wkt_yyout = out_str ;
1960 }
1961 
1963 {
1964  return wkt_yy_flex_debug;
1965 }
1966 
1967 void wkt_yyset_debug (int bdebug )
1968 {
1969  wkt_yy_flex_debug = bdebug ;
1970 }
1971 
1972 static int yy_init_globals (void)
1973 {
1974  /* Initialization is the same as for the non-reentrant scanner.
1975  * This function is called from wkt_yylex_destroy(), so don't allocate here.
1976  */
1977 
1978  (yy_buffer_stack) = 0;
1979  (yy_buffer_stack_top) = 0;
1980  (yy_buffer_stack_max) = 0;
1981  (yy_c_buf_p) = (char *) 0;
1982  (yy_init) = 0;
1983  (yy_start) = 0;
1984 
1985 /* Defined in main.c */
1986 #ifdef YY_STDINIT
1987  wkt_yyin = stdin;
1988  wkt_yyout = stdout;
1989 #else
1990  wkt_yyin = (FILE *) 0;
1991  wkt_yyout = (FILE *) 0;
1992 #endif
1993 
1994  /* For future reference: Set errno on error, since we are called by
1995  * wkt_yylex_init()
1996  */
1997  return 0;
1998 }
1999 
2000 /* wkt_yylex_destroy is for both reentrant and non-reentrant scanners. */
2002 {
2003 
2004  /* Pop the buffer stack, destroying each element. */
2005  while(YY_CURRENT_BUFFER){
2007  YY_CURRENT_BUFFER_LVALUE = NULL;
2009  }
2010 
2011  /* Destroy the stack itself. */
2012  wkt_yyfree((yy_buffer_stack) );
2013  (yy_buffer_stack) = NULL;
2014 
2015  /* Reset the globals. This is important in a non-reentrant scanner so the next time
2016  * wkt_yylex() is called, initialization will occur. */
2017  yy_init_globals( );
2018 
2019  return 0;
2020 }
2021 
2022 /*
2023  * Internal utility routines.
2024  */
2025 
2026 #ifndef yytext_ptr
2027 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2028 {
2029  register int i;
2030  for ( i = 0; i < n; ++i )
2031  s1[i] = s2[i];
2032 }
2033 #endif
2034 
2035 #ifdef YY_NEED_STRLEN
2036 static int yy_flex_strlen (yyconst char * s )
2037 {
2038  register int n;
2039  for ( n = 0; s[n]; ++n )
2040  ;
2041 
2042  return n;
2043 }
2044 #endif
2045 
2046 #define YYTABLES_NAME "yytables"
2047 
2048 #line 117 "lwin_wkt_lex.l"
2049 
2050 
2051 
2052 void *wkt_yyalloc (yy_size_t size )
2053 {
2054  return (void *) lwalloc( size );
2055 }
2056 
2057 void *wkt_yyrealloc (void * ptr, yy_size_t size )
2058 {
2059  return (void *) lwrealloc( (char *) ptr, size );
2060 }
2061 
2062 void wkt_yyfree (void * ptr )
2063 {
2064  lwfree( (char *) ptr ); /* see wkt_yyrealloc() for (char *) cast */
2065 }
FILE * wkt_yyget_in(void)
Get the input stream.
int flex_int32_t
Definition: lwin_wkt_lex.c:97
void wkt_yyset_lineno(int line_number)
Set the current line number.
static yy_state_type yy_get_previous_state(void)
int yy_bs_column
The column count.
Definition: lwin_wkt_lex.c:271
short int flex_int16_t
Definition: lwin_wkt_lex.c:96
static int yy_did_buffer_switch_on_eof
Definition: lwin_wkt_lex.c:330
void wkt_lexer_close()
Definition: lwin_wkt_lex.c:670
#define EOB_ACT_LAST_MATCH
Definition: lwin_wkt_lex.c:212
void wkt_yyset_in(FILE *in_str)
Set the input stream.
static yyconst flex_int16_t yy_nxt[419]
Definition: lwin_wkt_lex.c:531
struct yy_buffer_state * YY_BUFFER_STATE
Definition: lwin_wkt_lex.c:198
#define YY_BUF_SIZE
Definition: lwin_wkt_lex.c:189
unsigned short int flex_uint16_t
Definition: lwin_wkt_lex.c:99
YY_BUFFER_STATE wkt_yy_scan_bytes(yyconst char *bytes, yy_size_t len)
Setup the input buffer state to scan the given bytes.
yy_size_t wkt_yyget_leng(void)
Get the length of the current token.
yy_size_t yy_n_chars
Definition: lwin_wkt_lex.c:249
void lwfree(void *mem)
Definition: lwutil.c:242
void * wkt_yyrealloc(void *, yy_size_t)
char * stringvalue
#define YY_INPUT(buf, result, max_size)
Definition: lwin_wkt_lex.c:797
static void wkt_yy_load_buffer_state(void)
int wkt_lexer_read_srid(char *str)
Read the SRID number from an SRID=<> string.
Definition: lwin_wkt.c:61
static yyconst flex_int32_t yy_meta[53]
Definition: lwin_wkt_lex.c:475
#define yyconst
Definition: lwin_wkt_lex.c:153
#define YY_STATE_EOF(state)
Definition: lwin_wkt_lex.c:180
#define YY_BUFFER_NORMAL
Definition: lwin_wkt_lex.c:281
static int yy_get_next_buffer(void)
FILE * wkt_yyin
Definition: lwin_wkt_lex.c:385
#define YY_RULE_SETUP
Definition: lwin_wkt_lex.c:872
size_t yy_size_t
Definition: lwin_wkt_lex.c:203
#define YY_EXTRA_TYPE
Definition: lwin_wkt_lex.c:716
register char * yy_cp
Definition: lwin_wkt_lex.c:880
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
#define YY_CURRENT_BUFFER
Definition: lwin_wkt_lex.c:308
register char * yy_bp
Definition: lwin_wkt_lex.c:880
void wkt_yyfree(void *)
static yyconst flex_int16_t yy_chk[419]
Definition: lwin_wkt_lex.c:581
LWGEOM_PARSER_RESULT global_parser_result
int wkt_yylex_destroy(void)
#define YY_BREAK
Definition: lwin_wkt_lex.c:869
#define yyterminate()
Definition: lwin_wkt_lex.c:834
YY_BUFFER_STATE wkt_yy_create_buffer(FILE *file, int size)
Allocate and initialize an input buffer state.
static yy_state_type yy_try_NUL_trans(yy_state_type current_state)
#define YY_SC_TO_UI(c)
Definition: lwin_wkt_lex.c:164
flex_int32_t yy_verify
Definition: lwin_wkt_lex.c:417
FILE * wkt_yyget_out(void)
Get the output stream.
static yyconst flex_int16_t yy_accept[172]
Definition: lwin_wkt_lex.c:420
void wkt_yyrestart(FILE *input_file)
Immediately switch to a different input stream.
#define EOB_ACT_END_OF_FILE
Definition: lwin_wkt_lex.c:211
yy_size_t wkt_yyleng
Definition: lwin_wkt_lex.c:320
#define YY_END_OF_BUFFER
Definition: lwin_wkt_lex.c:412
#define YY_BUFFER_NEW
Definition: lwin_wkt_lex.c:280
void wkt_yy_delete_buffer(YY_BUFFER_STATE b)
Destroy the buffer.
#define YY_READ_BUF_SIZE
Definition: lwin_wkt_lex.c:782
signed char flex_int8_t
Definition: lwin_wkt_lex.c:95
int wkt_yy_flex_debug
Definition: lwin_wkt_lex.c:635
char * wkt_yytext
Definition: lwin_wkt_lex.c:644
#define YY_END_OF_BUFFER_CHAR
Definition: lwin_wkt_lex.c:185
static yy_size_t yy_n_chars
Definition: lwin_wkt_lex.c:319
unsigned char YY_CHAR
Definition: lwin_wkt_lex.c:383
#define INITIAL
Definition: lwin_wkt_lex.c:705
#define YY_EXIT_FAILURE
YY_EXTRA_TYPE wkt_yyget_extra(void)
int last_column
YYLTYPE wkt_yylloc
void wkt_yypop_buffer_state(void)
Removes and deletes the top of the stack, if present.
#define ECHO
Definition: lwin_wkt_lex.c:790
int wkt_yyget_lineno(void)
Get the current line number.
#define YY_FATAL_ERROR(msg)
Definition: lwin_wkt_lex.c:844
static YY_BUFFER_STATE wkt_yy_buf_state
Definition: lwin_wkt_lex.c:656
#define YY_CURRENT_BUFFER_LVALUE
Definition: lwin_wkt_lex.c:315
register int yy_act
Definition: lwin_wkt_lex.c:881
static void wkt_lexer_unknown()
Definition: lwin_wkt_lex.c:678
void wkt_yypush_buffer_state(YY_BUFFER_STATE new_buffer)
Pushes the new state onto the stack.
void wkt_yyset_debug(int debug_flag)
static void wkt_yy_init_buffer(YY_BUFFER_STATE b, FILE *file)
#define wkt_yywrap()
Definition: lwin_wkt_lex.c:380
int integervalue
double doublevalue
char * s
Definition: cu_in_wkt.c:23
FILE * yy_input_file
Definition: lwin_wkt_lex.c:236
#define YY_MORE_ADJ
Definition: lwin_wkt_lex.c:642
int yy_bs_lineno
The line count.
Definition: lwin_wkt_lex.c:270
unsigned char flex_uint8_t
Definition: lwin_wkt_lex.c:98
yy_size_t yy_buf_size
Definition: lwin_wkt_lex.c:244
YY_BUFFER_STATE wkt_yy_scan_string(yyconst char *yy_str)
Setup the input buffer state to scan a string.
static char * yy_c_buf_p
Definition: lwin_wkt_lex.c:323
int yy_state_type
Definition: lwin_wkt_lex.c:387
static void yy_fatal_error(yyconst char msg[])
#define YY_RESTORE_YY_MORE_OFFSET
Definition: lwin_wkt_lex.c:643
const char * parser_error_messages[]
Definition: lwin_wkt.c:37
int wkt_yyget_debug(void)
#define YY_DECL
Definition: lwin_wkt_lex.c:857
void wkt_yy_switch_to_buffer(YY_BUFFER_STATE new_buffer)
Switch to a different input buffer.
#define YY_BUFFER_EOF_PENDING
Definition: lwin_wkt_lex.c:292
static yy_state_type yy_last_accepting_state
Definition: lwin_wkt_lex.c:631
void wkt_lexer_init(char *src)
Definition: lwin_wkt_lex.c:662
static size_t yy_buffer_stack_top
index of top of stack.
Definition: lwin_wkt_lex.c:298
#define EOB_ACT_CONTINUE_SCAN
Definition: lwin_wkt_lex.c:210
void * lwrealloc(void *mem, size_t size)
Definition: lwutil.c:235
#define YY_NEW_FILE
Definition: lwin_wkt_lex.c:183
static int yy_init
Definition: lwin_wkt_lex.c:324
#define YY_DO_BEFORE_ACTION
Definition: lwin_wkt_lex.c:404
static size_t yy_buffer_stack_max
capacity of stack.
Definition: lwin_wkt_lex.c:299
static yyconst flex_int16_t yy_def[172]
Definition: lwin_wkt_lex.c:508
#define YY_START
Definition: lwin_wkt_lex.c:176
flex_int32_t yy_nxt
Definition: lwin_wkt_lex.c:418
static int yy_init_globals(void)
static yyconst flex_int16_t yy_base[172]
Definition: lwin_wkt_lex.c:485
static char * yy_last_accepting_cpos
Definition: lwin_wkt_lex.c:632
char * wkt_yyget_text(void)
Get the current token.
static YY_BUFFER_STATE * yy_buffer_stack
Stack as an array.
Definition: lwin_wkt_lex.c:300
void * lwalloc(size_t size)
Definition: lwutil.c:227
static char yy_hold_char
Definition: lwin_wkt_lex.c:318
void wkt_yyset_out(FILE *out_str)
static void wkt_yyensure_buffer_stack(void)
#define yytext_ptr
Definition: lwin_wkt_lex.c:394
static int yy_start
Definition: lwin_wkt_lex.c:325
YY_BUFFER_STATE wkt_yy_scan_buffer(char *base, yy_size_t size)
Setup the input buffer state to scan directly from a user-specified character buffer.
unsigned int flex_uint32_t
Definition: lwin_wkt_lex.c:100
void wkt_yyset_extra(YY_EXTRA_TYPE user_defined)
YYSTYPE wkt_yylval
#define PARSER_ERROR_OTHER
Definition: liblwgeom.h:2017
FILE * wkt_yyout
Definition: lwin_wkt_lex.c:385
static yyconst flex_int32_t yy_ec[256]
Definition: lwin_wkt_lex.c:443
int wkt_yylineno
Definition: lwin_wkt_lex.c:391
void * wkt_yyalloc(yy_size_t)
int wkt_yylex(void)
void wkt_yy_flush_buffer(YY_BUFFER_STATE b)
Discard all buffered characters.