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