PostGIS  3.7.0dev-r@@SVN_REVISION@@
lwin_wkt_parse.c
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 3.8.2. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6  Inc.
7 
8  This program is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program. If not, see <https://www.gnu.org/licenses/>. */
20 
21 /* As a special exception, you may create a larger work that contains
22  part or all of the Bison parser skeleton and distribute that work
23  under terms of your choice, so long as that work isn't itself a
24  parser generator using the skeleton or a modified version thereof
25  as a parser skeleton. Alternatively, if you modify or redistribute
26  the parser skeleton itself, you may (at your option) remove this
27  special exception, which will cause the skeleton and the resulting
28  Bison output files to be licensed under the GNU General Public
29  License without this special exception.
30 
31  This special exception was added by the Free Software Foundation in
32  version 2.2 of Bison. */
33 
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35  simplifying the original so-called "semantic" parser. */
36 
37 /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38  especially those whose name start with YY_ or yy_. They are
39  private implementation details that can be changed or removed. */
40 
41 /* All symbols defined below should begin with yy or YY, to avoid
42  infringing on user name space. This should be done even for local
43  variables, as they might otherwise be expanded by user macros.
44  There are some unavoidable exceptions within include files to
45  define necessary library symbols; they are noted "INFRINGES ON
46  USER NAME SPACE" below. */
47 
48 /* Identify Bison output, and Bison version. */
49 #define YYBISON 30802
50 
51 /* Bison version string. */
52 #define YYBISON_VERSION "3.8.2"
53 
54 /* Skeleton name. */
55 #define YYSKELETON_NAME "yacc.c"
56 
57 /* Pure parsers. */
58 #define YYPURE 0
59 
60 /* Push parsers. */
61 #define YYPUSH 0
62 
63 /* Pull parsers. */
64 #define YYPULL 1
65 
66 
67 /* Substitute the variable and function names. */
68 #define yyparse wkt_yyparse
69 #define yylex wkt_yylex
70 #define yyerror wkt_yyerror
71 #define yydebug wkt_yydebug
72 #define yynerrs wkt_yynerrs
73 #define yylval wkt_yylval
74 #define yychar wkt_yychar
75 #define yylloc wkt_yylloc
76 
77 /* First part of user prologue. */
78 #line 1 "lwin_wkt_parse.y"
79 
80 
81 /* WKT Parser */
82 #include <stdio.h>
83 #include <string.h>
84 #include <stdlib.h>
85 #include "lwin_wkt.h"
86 #include "lwin_wkt_parse.h"
87 #include "lwgeom_log.h"
88 
89 
90 /* Prototypes to quiet the compiler */
91 int wkt_yyparse(void);
92 void wkt_yyerror(const char *str);
93 int wkt_yylex(void);
94 
95 
96 /* Declare the global parser variable */
98 
99 /* Turn on/off verbose parsing (turn off for production) */
100 int wkt_yydebug = 0;
101 
102 /*
103 * Error handler called by the bison parser. Mostly we will be
104 * catching our own errors and filling out the message and errlocation
105 * from WKT_ERROR in the grammar, but we keep this one
106 * around just in case.
107 */
108 void wkt_yyerror(__attribute__((__unused__)) const char *str)
109 {
110  /* If we haven't already set a message and location, let's set one now. */
112  {
116  }
117  LWDEBUGF(4,"%s", str);
118 }
119 
126 int lwgeom_parse_wkt(LWGEOM_PARSER_RESULT *parser_result, char *wktstr, int parser_check_flags)
127 {
128  int parse_rv = 0;
129 
130  /* Clean up our global parser result. */
132  /* Work-around possible bug in GNU Bison 3.0.2 resulting in wkt_yylloc
133  * members not being initialized on yyparse() as documented here:
134  * https://www.gnu.org/software/bison/manual/html_node/Location-Type.html
135  * See discussion here:
136  * http://lists.osgeo.org/pipermail/postgis-devel/2014-September/024506.html
137  */
139  wkt_yylloc.first_column = wkt_yylloc.first_line = 1;
140 
141  /* Set the input text string, and parse checks. */
142  global_parser_result.wkinput = wktstr;
143  global_parser_result.parser_check_flags = parser_check_flags;
144 
145  wkt_lexer_init(wktstr); /* Lexer ready */
146  parse_rv = wkt_yyparse(); /* Run the parse */
147  LWDEBUGF(4,"wkt_yyparse returned %d", parse_rv);
148  wkt_lexer_close(); /* Clean up lexer */
149 
150  /* A non-zero parser return is an error. */
151  if ( parse_rv || global_parser_result.errcode )
152  {
154  {
158  }
159  else if (global_parser_result.geom)
160  {
162  global_parser_result.geom = NULL;
163  }
164 
165  LWDEBUGF(5, "error returned by wkt_yyparse() @ %d: [%d] '%s'",
169 
170  /* Copy the global values into the return pointer */
171  *parser_result = global_parser_result;
173  return LW_FAILURE;
174  }
175 
176  /* Copy the global value into the return pointer */
177  *parser_result = global_parser_result;
179  return LW_SUCCESS;
180 }
181 
182 #define WKT_ERROR() { if ( global_parser_result.errcode != 0 ) { YYERROR; } }
183 
184 
185 
186 #line 187 "lwin_wkt_parse.c"
187 
188 # ifndef YY_CAST
189 # ifdef __cplusplus
190 # define YY_CAST(Type, Val) static_cast<Type> (Val)
191 # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
192 # else
193 # define YY_CAST(Type, Val) ((Type) (Val))
194 # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
195 # endif
196 # endif
197 # ifndef YY_NULLPTR
198 # if defined __cplusplus
199 # if 201103L <= __cplusplus
200 # define YY_NULLPTR nullptr
201 # else
202 # define YY_NULLPTR 0
203 # endif
204 # else
205 # define YY_NULLPTR ((void*)0)
206 # endif
207 # endif
208 
209 #include "lwin_wkt_parse.h"
210 /* Symbol kind. */
212 {
214  YYSYMBOL_YYEOF = 0, /* "end of file" */
215  YYSYMBOL_YYerror = 1, /* error */
216  YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
217  YYSYMBOL_POINT_TOK = 3, /* POINT_TOK */
218  YYSYMBOL_LINESTRING_TOK = 4, /* LINESTRING_TOK */
219  YYSYMBOL_POLYGON_TOK = 5, /* POLYGON_TOK */
220  YYSYMBOL_MPOINT_TOK = 6, /* MPOINT_TOK */
221  YYSYMBOL_MLINESTRING_TOK = 7, /* MLINESTRING_TOK */
222  YYSYMBOL_MPOLYGON_TOK = 8, /* MPOLYGON_TOK */
223  YYSYMBOL_MSURFACE_TOK = 9, /* MSURFACE_TOK */
224  YYSYMBOL_MCURVE_TOK = 10, /* MCURVE_TOK */
225  YYSYMBOL_CURVEPOLYGON_TOK = 11, /* CURVEPOLYGON_TOK */
226  YYSYMBOL_COMPOUNDCURVE_TOK = 12, /* COMPOUNDCURVE_TOK */
227  YYSYMBOL_CIRCULARSTRING_TOK = 13, /* CIRCULARSTRING_TOK */
228  YYSYMBOL_COLLECTION_TOK = 14, /* COLLECTION_TOK */
229  YYSYMBOL_RBRACKET_TOK = 15, /* RBRACKET_TOK */
230  YYSYMBOL_LBRACKET_TOK = 16, /* LBRACKET_TOK */
231  YYSYMBOL_COMMA_TOK = 17, /* COMMA_TOK */
232  YYSYMBOL_EMPTY_TOK = 18, /* EMPTY_TOK */
233  YYSYMBOL_SEMICOLON_TOK = 19, /* SEMICOLON_TOK */
234  YYSYMBOL_TRIANGLE_TOK = 20, /* TRIANGLE_TOK */
235  YYSYMBOL_TIN_TOK = 21, /* TIN_TOK */
236  YYSYMBOL_POLYHEDRALSURFACE_TOK = 22, /* POLYHEDRALSURFACE_TOK */
237  YYSYMBOL_DOUBLE_TOK = 23, /* DOUBLE_TOK */
238  YYSYMBOL_DIMENSIONALITY_TOK = 24, /* DIMENSIONALITY_TOK */
239  YYSYMBOL_SRID_TOK = 25, /* SRID_TOK */
240  YYSYMBOL_YYACCEPT = 26, /* $accept */
241  YYSYMBOL_geometry = 27, /* geometry */
242  YYSYMBOL_geometry_no_srid = 28, /* geometry_no_srid */
243  YYSYMBOL_geometrycollection = 29, /* geometrycollection */
244  YYSYMBOL_geometry_list = 30, /* geometry_list */
245  YYSYMBOL_multisurface = 31, /* multisurface */
246  YYSYMBOL_surface_list = 32, /* surface_list */
247  YYSYMBOL_tin = 33, /* tin */
248  YYSYMBOL_polyhedralsurface = 34, /* polyhedralsurface */
249  YYSYMBOL_multipolygon = 35, /* multipolygon */
250  YYSYMBOL_polygon_list = 36, /* polygon_list */
251  YYSYMBOL_patch_list = 37, /* patch_list */
252  YYSYMBOL_polygon = 38, /* polygon */
253  YYSYMBOL_polygon_untagged = 39, /* polygon_untagged */
254  YYSYMBOL_patch = 40, /* patch */
255  YYSYMBOL_curvepolygon = 41, /* curvepolygon */
256  YYSYMBOL_curvering_list = 42, /* curvering_list */
257  YYSYMBOL_curvering = 43, /* curvering */
258  YYSYMBOL_patchring_list = 44, /* patchring_list */
259  YYSYMBOL_ring_list = 45, /* ring_list */
260  YYSYMBOL_patchring = 46, /* patchring */
261  YYSYMBOL_ring = 47, /* ring */
262  YYSYMBOL_compoundcurve = 48, /* compoundcurve */
263  YYSYMBOL_compound_list = 49, /* compound_list */
264  YYSYMBOL_multicurve = 50, /* multicurve */
265  YYSYMBOL_curve_list = 51, /* curve_list */
266  YYSYMBOL_multilinestring = 52, /* multilinestring */
267  YYSYMBOL_linestring_list = 53, /* linestring_list */
268  YYSYMBOL_circularstring = 54, /* circularstring */
269  YYSYMBOL_linestring = 55, /* linestring */
270  YYSYMBOL_linestring_untagged = 56, /* linestring_untagged */
271  YYSYMBOL_triangle_list = 57, /* triangle_list */
272  YYSYMBOL_triangle = 58, /* triangle */
273  YYSYMBOL_triangle_untagged = 59, /* triangle_untagged */
274  YYSYMBOL_multipoint = 60, /* multipoint */
275  YYSYMBOL_point_list = 61, /* point_list */
276  YYSYMBOL_point_untagged = 62, /* point_untagged */
277  YYSYMBOL_point = 63, /* point */
278  YYSYMBOL_ptarray = 64, /* ptarray */
279  YYSYMBOL_coordinate = 65 /* coordinate */
280 };
281 typedef enum yysymbol_kind_t yysymbol_kind_t;
282 
283 
284 
285 
286 #ifdef short
287 # undef short
288 #endif
289 
290 /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
291  <limits.h> and (if available) <stdint.h> are included
292  so that the code can choose integer types of a good width. */
293 
294 #ifndef __PTRDIFF_MAX__
295 # include <limits.h> /* INFRINGES ON USER NAME SPACE */
296 # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
297 # include <stdint.h> /* INFRINGES ON USER NAME SPACE */
298 # define YY_STDINT_H
299 # endif
300 #endif
301 
302 /* Narrow types that promote to a signed type and that can represent a
303  signed or unsigned integer of at least N bits. In tables they can
304  save space and decrease cache pressure. Promoting to a signed type
305  helps avoid bugs in integer arithmetic. */
306 
307 #ifdef __INT_LEAST8_MAX__
308 typedef __INT_LEAST8_TYPE__ yytype_int8;
309 #elif defined YY_STDINT_H
310 typedef int_least8_t yytype_int8;
311 #else
312 typedef signed char yytype_int8;
313 #endif
314 
315 #ifdef __INT_LEAST16_MAX__
316 typedef __INT_LEAST16_TYPE__ yytype_int16;
317 #elif defined YY_STDINT_H
318 typedef int_least16_t yytype_int16;
319 #else
320 typedef short yytype_int16;
321 #endif
322 
323 /* Work around bug in HP-UX 11.23, which defines these macros
324  incorrectly for preprocessor constants. This workaround can likely
325  be removed in 2023, as HPE has promised support for HP-UX 11.23
326  (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
327  <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
328 #ifdef __hpux
329 # undef UINT_LEAST8_MAX
330 # undef UINT_LEAST16_MAX
331 # define UINT_LEAST8_MAX 255
332 # define UINT_LEAST16_MAX 65535
333 #endif
334 
335 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
336 typedef __UINT_LEAST8_TYPE__ yytype_uint8;
337 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
338  && UINT_LEAST8_MAX <= INT_MAX)
339 typedef uint_least8_t yytype_uint8;
340 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
341 typedef unsigned char yytype_uint8;
342 #else
343 typedef short yytype_uint8;
344 #endif
345 
346 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
347 typedef __UINT_LEAST16_TYPE__ yytype_uint16;
348 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
349  && UINT_LEAST16_MAX <= INT_MAX)
350 typedef uint_least16_t yytype_uint16;
351 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
352 typedef unsigned short yytype_uint16;
353 #else
354 typedef int yytype_uint16;
355 #endif
356 
357 #ifndef YYPTRDIFF_T
358 # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
359 # define YYPTRDIFF_T __PTRDIFF_TYPE__
360 # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
361 # elif defined PTRDIFF_MAX
362 # ifndef ptrdiff_t
363 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
364 # endif
365 # define YYPTRDIFF_T ptrdiff_t
366 # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
367 # else
368 # define YYPTRDIFF_T long
369 # define YYPTRDIFF_MAXIMUM LONG_MAX
370 # endif
371 #endif
372 
373 #ifndef YYSIZE_T
374 # ifdef __SIZE_TYPE__
375 # define YYSIZE_T __SIZE_TYPE__
376 # elif defined size_t
377 # define YYSIZE_T size_t
378 # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
379 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
380 # define YYSIZE_T size_t
381 # else
382 # define YYSIZE_T unsigned
383 # endif
384 #endif
385 
386 #define YYSIZE_MAXIMUM \
387  YY_CAST (YYPTRDIFF_T, \
388  (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
389  ? YYPTRDIFF_MAXIMUM \
390  : YY_CAST (YYSIZE_T, -1)))
391 
392 #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
393 
394 
395 /* Stored state numbers (used for stacks). */
397 
398 /* State numbers in computations. */
399 typedef int yy_state_fast_t;
400 
401 #ifndef YY_
402 # if defined YYENABLE_NLS && YYENABLE_NLS
403 # if ENABLE_NLS
404 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
405 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
406 # endif
407 # endif
408 # ifndef YY_
409 # define YY_(Msgid) Msgid
410 # endif
411 #endif
412 
413 
414 #ifndef YY_ATTRIBUTE_PURE
415 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
416 # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
417 # else
418 # define YY_ATTRIBUTE_PURE
419 # endif
420 #endif
421 
422 #ifndef YY_ATTRIBUTE_UNUSED
423 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
424 # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
425 # else
426 # define YY_ATTRIBUTE_UNUSED
427 # endif
428 #endif
429 
430 /* Suppress unused-variable warnings by "using" E. */
431 #if ! defined lint || defined __GNUC__
432 # define YY_USE(E) ((void) (E))
433 #else
434 # define YY_USE(E) /* empty */
435 #endif
436 
437 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
438 #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
439 # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
440 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
441  _Pragma ("GCC diagnostic push") \
442  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
443 # else
444 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
445  _Pragma ("GCC diagnostic push") \
446  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
447  _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
448 # endif
449 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
450  _Pragma ("GCC diagnostic pop")
451 #else
452 # define YY_INITIAL_VALUE(Value) Value
453 #endif
454 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
455 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
456 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
457 #endif
458 #ifndef YY_INITIAL_VALUE
459 # define YY_INITIAL_VALUE(Value) /* Nothing. */
460 #endif
461 
462 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
463 # define YY_IGNORE_USELESS_CAST_BEGIN \
464  _Pragma ("GCC diagnostic push") \
465  _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
466 # define YY_IGNORE_USELESS_CAST_END \
467  _Pragma ("GCC diagnostic pop")
468 #endif
469 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
470 # define YY_IGNORE_USELESS_CAST_BEGIN
471 # define YY_IGNORE_USELESS_CAST_END
472 #endif
473 
474 
475 #define YY_ASSERT(E) ((void) (0 && (E)))
476 
477 #if 1
478 
479 /* The parser invokes alloca or malloc; define the necessary symbols. */
480 
481 # ifdef YYSTACK_USE_ALLOCA
482 # if YYSTACK_USE_ALLOCA
483 # ifdef __GNUC__
484 # define YYSTACK_ALLOC __builtin_alloca
485 # elif defined __BUILTIN_VA_ARG_INCR
486 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
487 # elif defined _AIX
488 # define YYSTACK_ALLOC __alloca
489 # elif defined _MSC_VER
490 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
491 # define alloca _alloca
492 # else
493 # define YYSTACK_ALLOC alloca
494 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
495 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
496  /* Use EXIT_SUCCESS as a witness for stdlib.h. */
497 # ifndef EXIT_SUCCESS
498 # define EXIT_SUCCESS 0
499 # endif
500 # endif
501 # endif
502 # endif
503 # endif
504 
505 # ifdef YYSTACK_ALLOC
506  /* Pacify GCC's 'empty if-body' warning. */
507 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
508 # ifndef YYSTACK_ALLOC_MAXIMUM
509  /* The OS might guarantee only one guard page at the bottom of the stack,
510  and a page size can be as small as 4096 bytes. So we cannot safely
511  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
512  to allow for a few compiler-allocated temporary stack slots. */
513 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
514 # endif
515 # else
516 # define YYSTACK_ALLOC YYMALLOC
517 # define YYSTACK_FREE YYFREE
518 # ifndef YYSTACK_ALLOC_MAXIMUM
519 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
520 # endif
521 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
522  && ! ((defined YYMALLOC || defined malloc) \
523  && (defined YYFREE || defined free)))
524 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
525 # ifndef EXIT_SUCCESS
526 # define EXIT_SUCCESS 0
527 # endif
528 # endif
529 # ifndef YYMALLOC
530 # define YYMALLOC malloc
531 # if ! defined malloc && ! defined EXIT_SUCCESS
532 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
533 # endif
534 # endif
535 # ifndef YYFREE
536 # define YYFREE free
537 # if ! defined free && ! defined EXIT_SUCCESS
538 void free (void *); /* INFRINGES ON USER NAME SPACE */
539 # endif
540 # endif
541 # endif
542 #endif /* 1 */
543 
544 #if (! defined yyoverflow \
545  && (! defined __cplusplus \
546  || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
547  && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
548 
549 /* A type that is properly aligned for any stack member. */
550 union yyalloc
551 {
555 };
556 
557 /* The size of the maximum gap between one aligned stack and the next. */
558 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
559 
560 /* The size of an array large to enough to hold all stacks, each with
561  N elements. */
562 # define YYSTACK_BYTES(N) \
563  ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
564  + YYSIZEOF (YYLTYPE)) \
565  + 2 * YYSTACK_GAP_MAXIMUM)
566 
567 # define YYCOPY_NEEDED 1
568 
569 /* Relocate STACK from its old location to the new one. The
570  local variables YYSIZE and YYSTACKSIZE give the old and new number of
571  elements in the stack, and YYPTR gives the new location of the
572  stack. Advance YYPTR to a properly aligned location for the next
573  stack. */
574 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
575  do \
576  { \
577  YYPTRDIFF_T yynewbytes; \
578  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
579  Stack = &yyptr->Stack_alloc; \
580  yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
581  yyptr += yynewbytes / YYSIZEOF (*yyptr); \
582  } \
583  while (0)
584 
585 #endif
586 
587 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
588 /* Copy COUNT objects from SRC to DST. The source and destination do
589  not overlap. */
590 # ifndef YYCOPY
591 # if defined __GNUC__ && 1 < __GNUC__
592 # define YYCOPY(Dst, Src, Count) \
593  __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
594 # else
595 # define YYCOPY(Dst, Src, Count) \
596  do \
597  { \
598  YYPTRDIFF_T yyi; \
599  for (yyi = 0; yyi < (Count); yyi++) \
600  (Dst)[yyi] = (Src)[yyi]; \
601  } \
602  while (0)
603 # endif
604 # endif
605 #endif /* !YYCOPY_NEEDED */
606 
607 /* YYFINAL -- State number of the termination state. */
608 #define YYFINAL 80
609 /* YYLAST -- Last index in YYTABLE. */
610 #define YYLAST 294
611 
612 /* YYNTOKENS -- Number of terminals. */
613 #define YYNTOKENS 26
614 /* YYNNTS -- Number of nonterminals. */
615 #define YYNNTS 40
616 /* YYNRULES -- Number of rules. */
617 #define YYNRULES 136
618 /* YYNSTATES -- Number of states. */
619 #define YYNSTATES 264
620 
621 /* YYMAXUTOK -- Last valid token kind. */
622 #define YYMAXUTOK 280
623 
624 
625 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
626  as returned by yylex, with out-of-bounds checking. */
627 #define YYTRANSLATE(YYX) \
628  (0 <= (YYX) && (YYX) <= YYMAXUTOK \
629  ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
630  : YYSYMBOL_YYUNDEF)
631 
632 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
633  as returned by yylex. */
634 static const yytype_int8 yytranslate[] =
635 {
636  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
637  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
638  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
639  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
640  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
641  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
642  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
643  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
644  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
645  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
646  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
647  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
648  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
649  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
650  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
651  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
652  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
653  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
654  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
655  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
656  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
657  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
658  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
659  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
660  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
661  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
662  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
663  15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
664  25
665 };
666 
667 #if YYDEBUG
668 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
669 static const yytype_int16 yyrline[] =
670 {
671  0, 217, 217, 219, 223, 224, 225, 226, 227, 228,
672  229, 230, 231, 232, 233, 234, 235, 236, 237, 240,
673  242, 244, 246, 250, 252, 256, 258, 260, 262, 266,
674  268, 270, 272, 274, 276, 280, 282, 284, 286, 290,
675  292, 294, 296, 300, 302, 304, 306, 310, 312, 316,
676  318, 322, 324, 326, 328, 332, 334, 338, 341, 343,
677  345, 347, 351, 353, 357, 358, 359, 360, 363, 365,
678  369, 371, 375, 378, 381, 383, 385, 387, 391, 393,
679  395, 397, 399, 401, 405, 407, 409, 411, 415, 417,
680  419, 421, 423, 425, 427, 429, 433, 435, 437, 439,
681  443, 445, 449, 451, 453, 455, 459, 461, 463, 465,
682  469, 471, 475, 477, 481, 483, 485, 487, 491, 495,
683  497, 499, 501, 505, 507, 511, 513, 515, 519, 521,
684  523, 525, 529, 531, 535, 537, 539
685 };
686 #endif
687 
689 #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
690 
691 #if 1
692 /* The user-facing name of the symbol whose (internal) number is
693  YYSYMBOL. No bounds checking. */
694 static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
695 
696 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
697  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
698 static const char *const yytname[] =
699 {
700  "\"end of file\"", "error", "\"invalid token\"", "POINT_TOK",
701  "LINESTRING_TOK", "POLYGON_TOK", "MPOINT_TOK", "MLINESTRING_TOK",
702  "MPOLYGON_TOK", "MSURFACE_TOK", "MCURVE_TOK", "CURVEPOLYGON_TOK",
703  "COMPOUNDCURVE_TOK", "CIRCULARSTRING_TOK", "COLLECTION_TOK",
704  "RBRACKET_TOK", "LBRACKET_TOK", "COMMA_TOK", "EMPTY_TOK",
705  "SEMICOLON_TOK", "TRIANGLE_TOK", "TIN_TOK", "POLYHEDRALSURFACE_TOK",
706  "DOUBLE_TOK", "DIMENSIONALITY_TOK", "SRID_TOK", "$accept", "geometry",
707  "geometry_no_srid", "geometrycollection", "geometry_list",
708  "multisurface", "surface_list", "tin", "polyhedralsurface",
709  "multipolygon", "polygon_list", "patch_list", "polygon",
710  "polygon_untagged", "patch", "curvepolygon", "curvering_list",
711  "curvering", "patchring_list", "ring_list", "patchring", "ring",
712  "compoundcurve", "compound_list", "multicurve", "curve_list",
713  "multilinestring", "linestring_list", "circularstring", "linestring",
714  "linestring_untagged", "triangle_list", "triangle", "triangle_untagged",
715  "multipoint", "point_list", "point_untagged", "point", "ptarray",
716  "coordinate", YY_NULLPTR
717 };
718 
719 static const char *
721 {
722  return yytname[yysymbol];
723 }
724 #endif
725 
726 #define YYPACT_NINF (-90)
727 
728 #define yypact_value_is_default(Yyn) \
729  ((Yyn) == YYPACT_NINF)
730 
731 #define YYTABLE_NINF (-1)
732 
733 #define yytable_value_is_error(Yyn) \
734  0
735 
736 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
737  STATE-NUM. */
738 static const yytype_int16 yypact[] =
739 {
740  109, -2, 16, 23, 26, 36, 39, 40, 52, 53,
741  74, 79, 83, 84, 108, 137, 7, 46, -90, -90,
742  -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
743  -90, -90, -90, -90, 43, -90, 27, 43, -90, 88,
744  33, -90, 144, 140, -90, 167, 175, -90, 176, 179,
745  -90, 183, 20, -90, 184, 11, -90, 187, 11, -90,
746  188, 17, -90, 191, 43, -90, 192, 168, -90, 195,
747  51, -90, 196, 56, -90, 199, 70, -90, 200, 168,
748  -90, 68, 110, -90, 43, -90, 169, 43, -90, 43,
749  204, -90, 33, -90, 43, -90, 205, -90, -90, 140,
750  -90, 43, -90, 208, -90, 175, -90, 33, -90, 209,
751  -90, 179, -90, 212, -90, -90, -90, 20, -90, -90,
752  213, -90, -90, -90, 11, -90, 216, -90, -90, -90,
753  -90, -90, 11, -90, 217, -90, -90, -90, 17, -90,
754  220, 43, -90, -90, 221, 168, -90, 43, 80, -90,
755  93, 224, -90, 56, -90, 94, 225, -90, 70, -90,
756  -90, 105, -90, 43, 228, -90, 229, 232, -90, 33,
757  233, 44, -90, 140, 236, 237, -90, 175, 240, 241,
758  -90, 179, 244, -90, 20, 245, -90, 11, 248, -90,
759  11, 249, -90, 17, 252, -90, 253, -90, 168, 256,
760  257, 43, 43, -90, 56, 260, 43, 261, -90, -90,
761  70, 264, 112, -90, -90, -90, -90, -90, -90, -90,
762  -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
763  -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
764  -90, -90, -90, -90, -90, -90, 47, 265, 268, -90,
765  -90, 269, -90, 94, -90, -90, -90, -90, 131, 132,
766  -90, -90, -90, -90
767 };
768 
769 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
770  Performed when YYTABLE does not specify something else to do. Zero
771  means the default is an error. */
772 static const yytype_uint8 yydefact[] =
773 {
774  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
775  0, 0, 0, 0, 0, 0, 0, 0, 2, 18,
776  13, 15, 16, 12, 8, 9, 7, 14, 11, 6,
777  5, 17, 10, 4, 0, 131, 0, 0, 109, 0,
778  0, 54, 0, 0, 122, 0, 0, 99, 0, 0,
779  46, 0, 0, 28, 0, 0, 87, 0, 0, 61,
780  0, 0, 77, 0, 0, 105, 0, 0, 22, 0,
781  0, 117, 0, 0, 38, 0, 0, 42, 0, 0,
782  1, 0, 0, 133, 0, 130, 0, 0, 108, 0,
783  0, 71, 0, 53, 0, 127, 0, 124, 125, 0,
784  121, 0, 111, 0, 101, 0, 98, 0, 56, 0,
785  48, 0, 45, 0, 32, 34, 33, 0, 27, 93,
786  0, 92, 94, 95, 0, 86, 0, 63, 66, 67,
787  65, 64, 0, 60, 0, 81, 82, 83, 0, 76,
788  0, 0, 104, 24, 0, 0, 21, 0, 0, 116,
789  0, 0, 113, 0, 37, 0, 0, 50, 0, 41,
790  3, 134, 128, 0, 0, 106, 0, 0, 51, 0,
791  0, 0, 119, 0, 0, 0, 96, 0, 0, 0,
792  43, 0, 0, 25, 0, 0, 84, 0, 0, 58,
793  0, 0, 74, 0, 0, 102, 0, 19, 0, 0,
794  0, 0, 0, 35, 0, 0, 0, 0, 69, 39,
795  0, 0, 135, 132, 129, 107, 73, 70, 52, 126,
796  123, 120, 110, 100, 97, 55, 47, 44, 29, 31,
797  30, 26, 89, 88, 90, 91, 85, 62, 59, 78,
798  79, 80, 75, 103, 23, 20, 0, 0, 0, 112,
799  36, 0, 57, 0, 49, 40, 136, 114, 0, 0,
800  72, 68, 115, 118
801 };
802 
803 /* YYPGOTO[NTERM-NUM]. */
804 static const yytype_int16 yypgoto[] =
805 {
806  -90, -90, 0, -90, 5, -90, 37, -90, -90, -90,
807  48, 6, -39, -33, -42, -32, 55, -21, -90, -89,
808  -57, 118, -50, 150, -90, 165, -90, 185, -51, -49,
809  -44, 138, -90, 89, -90, 193, 121, -90, -36, -6
810 };
811 
812 /* YYDEFGOTO[NTERM-NUM]. */
813 static const yytype_uint8 yydefgoto[] =
814 {
815  0, 17, 143, 19, 144, 20, 113, 21, 22, 23,
816  109, 156, 24, 110, 157, 25, 126, 127, 207, 90,
817  208, 91, 26, 134, 27, 120, 28, 103, 29, 30,
818  131, 151, 31, 152, 32, 96, 97, 33, 82, 83
819 };
820 
821 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
822  positive, shift that token. If negative, reduce the rule whose
823  number is the opposite. If YYTABLE_NINF, syntax error. */
824 static const yytype_int16 yytable[] =
825 {
826  18, 86, 104, 170, 121, 119, 122, 129, 128, 130,
827  135, 123, 136, 114, 34, 2, 35, 137, 179, 115,
828  116, 2, 36, 10, 11, 3, 79, 101, 140, 102,
829  11, 9, 37, 101, 38, 102, 107, 98, 108, 40,
830  39, 41, 43, 84, 44, 85, 80, 42, 164, 89,
831  45, 166, 46, 167, 47, 49, 52, 50, 53, 219,
832  48, 104, 257, 51, 54, 175, 81, 147, 55, 58,
833  56, 59, 150, 121, 119, 122, 57, 60, 114, 160,
834  123, 129, 128, 130, 115, 116, 155, 135, 171, 136,
835  61, 161, 62, 98, 137, 64, 201, 65, 63, 67,
836  70, 68, 71, 66, 87, 196, 88, 69, 72, 202,
837  206, 200, 1, 2, 3, 4, 5, 6, 7, 8,
838  9, 10, 11, 12, 73, 162, 74, 163, 212, 13,
839  14, 15, 75, 223, 16, 256, 233, 232, 234, 129,
840  128, 130, 239, 235, 240, 228, 262, 263, 226, 241,
841  199, 229, 230, 76, 185, 77, 94, 213, 95, 182,
842  92, 78, 93, 81, 211, 247, 248, 98, 254, 237,
843  251, 1, 2, 3, 4, 5, 6, 7, 8, 9,
844  10, 11, 12, 99, 165, 100, 163, 191, 13, 14,
845  15, 101, 105, 102, 106, 107, 261, 108, 244, 111,
846  117, 112, 118, 124, 132, 125, 133, 138, 141, 139,
847  142, 145, 148, 146, 149, 153, 158, 154, 159, 168,
848  172, 169, 173, 176, 180, 177, 181, 183, 186, 184,
849  187, 189, 192, 190, 193, 195, 197, 163, 198, 203,
850  209, 204, 210, 214, 215, 163, 163, 216, 218, 163,
851  169, 221, 222, 173, 163, 224, 225, 177, 169, 227,
852  231, 181, 184, 236, 238, 187, 190, 242, 243, 193,
853  163, 245, 246, 198, 163, 250, 252, 204, 253, 255,
854  258, 210, 163, 259, 260, 163, 163, 217, 194, 188,
855  178, 205, 174, 249, 220
856 };
857 
858 static const yytype_uint8 yycheck[] =
859 {
860  0, 37, 46, 92, 55, 55, 55, 58, 58, 58,
861  61, 55, 61, 52, 16, 4, 18, 61, 107, 52,
862  52, 4, 24, 12, 13, 5, 19, 16, 64, 18,
863  13, 11, 16, 16, 18, 18, 16, 43, 18, 16,
864  24, 18, 16, 16, 18, 18, 0, 24, 84, 16,
865  24, 87, 16, 89, 18, 16, 16, 18, 18, 15,
866  24, 105, 15, 24, 24, 101, 23, 16, 16, 16,
867  18, 18, 16, 124, 124, 124, 24, 24, 117, 79,
868  124, 132, 132, 132, 117, 117, 16, 138, 94, 138,
869  16, 23, 18, 99, 138, 16, 16, 18, 24, 16,
870  16, 18, 18, 24, 16, 141, 18, 24, 24, 16,
871  16, 147, 3, 4, 5, 6, 7, 8, 9, 10,
872  11, 12, 13, 14, 16, 15, 18, 17, 23, 20,
873  21, 22, 24, 177, 25, 23, 187, 187, 187, 190,
874  190, 190, 193, 187, 193, 184, 15, 15, 181, 193,
875  145, 184, 184, 16, 117, 18, 16, 163, 18, 111,
876  16, 24, 18, 23, 158, 201, 202, 173, 210, 190,
877  206, 3, 4, 5, 6, 7, 8, 9, 10, 11,
878  12, 13, 14, 16, 15, 18, 17, 132, 20, 21,
879  22, 16, 16, 18, 18, 16, 253, 18, 198, 16,
880  16, 18, 18, 16, 16, 18, 18, 16, 16, 18,
881  18, 16, 16, 18, 18, 16, 16, 18, 18, 15,
882  15, 17, 17, 15, 15, 17, 17, 15, 15, 17,
883  17, 15, 15, 17, 17, 15, 15, 17, 17, 15,
884  15, 17, 17, 15, 15, 17, 17, 15, 15, 17,
885  17, 15, 15, 17, 17, 15, 15, 17, 17, 15,
886  15, 17, 17, 15, 15, 17, 17, 15, 15, 17,
887  17, 15, 15, 17, 17, 15, 15, 17, 17, 15,
888  15, 17, 17, 15, 15, 17, 17, 169, 138, 124,
889  105, 153, 99, 204, 173
890 };
891 
892 /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
893  state STATE-NUM. */
894 static const yytype_int8 yystos[] =
895 {
896  0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
897  12, 13, 14, 20, 21, 22, 25, 27, 28, 29,
898  31, 33, 34, 35, 38, 41, 48, 50, 52, 54,
899  55, 58, 60, 63, 16, 18, 24, 16, 18, 24,
900  16, 18, 24, 16, 18, 24, 16, 18, 24, 16,
901  18, 24, 16, 18, 24, 16, 18, 24, 16, 18,
902  24, 16, 18, 24, 16, 18, 24, 16, 18, 24,
903  16, 18, 24, 16, 18, 24, 16, 18, 24, 19,
904  0, 23, 64, 65, 16, 18, 64, 16, 18, 16,
905  45, 47, 16, 18, 16, 18, 61, 62, 65, 16,
906  18, 16, 18, 53, 56, 16, 18, 16, 18, 36,
907  39, 16, 18, 32, 38, 39, 41, 16, 18, 48,
908  51, 54, 55, 56, 16, 18, 42, 43, 48, 54,
909  55, 56, 16, 18, 49, 54, 55, 56, 16, 18,
910  64, 16, 18, 28, 30, 16, 18, 16, 16, 18,
911  16, 57, 59, 16, 18, 16, 37, 40, 16, 18,
912  28, 23, 15, 17, 64, 15, 64, 64, 15, 17,
913  45, 65, 15, 17, 61, 64, 15, 17, 53, 45,
914  15, 17, 36, 15, 17, 32, 15, 17, 51, 15,
915  17, 42, 15, 17, 49, 15, 64, 15, 17, 30,
916  64, 16, 16, 15, 17, 57, 16, 44, 46, 15,
917  17, 37, 23, 65, 15, 15, 15, 47, 15, 15,
918  62, 15, 15, 56, 15, 15, 39, 15, 38, 39,
919  41, 15, 48, 54, 55, 56, 15, 43, 15, 54,
920  55, 56, 15, 15, 28, 15, 15, 64, 64, 59,
921  15, 64, 15, 17, 40, 15, 23, 15, 15, 15,
922  15, 46, 15, 15
923 };
924 
925 /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
926 static const yytype_int8 yyr1[] =
927 {
928  0, 26, 27, 27, 28, 28, 28, 28, 28, 28,
929  28, 28, 28, 28, 28, 28, 28, 28, 28, 29,
930  29, 29, 29, 30, 30, 31, 31, 31, 31, 32,
931  32, 32, 32, 32, 32, 33, 33, 33, 33, 34,
932  34, 34, 34, 35, 35, 35, 35, 36, 36, 37,
933  37, 38, 38, 38, 38, 39, 39, 40, 41, 41,
934  41, 41, 42, 42, 43, 43, 43, 43, 44, 44,
935  45, 45, 46, 47, 48, 48, 48, 48, 49, 49,
936  49, 49, 49, 49, 50, 50, 50, 50, 51, 51,
937  51, 51, 51, 51, 51, 51, 52, 52, 52, 52,
938  53, 53, 54, 54, 54, 54, 55, 55, 55, 55,
939  56, 56, 57, 57, 58, 58, 58, 58, 59, 60,
940  60, 60, 60, 61, 61, 62, 62, 62, 63, 63,
941  63, 63, 64, 64, 65, 65, 65
942 };
943 
944 /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
945 static const yytype_int8 yyr2[] =
946 {
947  0, 2, 1, 3, 1, 1, 1, 1, 1, 1,
948  1, 1, 1, 1, 1, 1, 1, 1, 1, 4,
949  5, 3, 2, 3, 1, 4, 5, 3, 2, 3,
950  3, 3, 1, 1, 1, 4, 5, 3, 2, 4,
951  5, 3, 2, 4, 5, 3, 2, 3, 1, 3,
952  1, 4, 5, 3, 2, 3, 1, 3, 4, 5,
953  3, 2, 3, 1, 1, 1, 1, 1, 3, 1,
954  3, 1, 3, 3, 4, 5, 3, 2, 3, 3,
955  3, 1, 1, 1, 4, 5, 3, 2, 3, 3,
956  3, 3, 1, 1, 1, 1, 4, 5, 3, 2,
957  3, 1, 4, 5, 3, 2, 4, 5, 3, 2,
958  3, 1, 3, 1, 6, 7, 3, 2, 5, 4,
959  5, 3, 2, 3, 1, 1, 3, 1, 4, 5,
960  3, 2, 3, 1, 2, 3, 4
961 };
962 
963 
964 enum { YYENOMEM = -2 };
965 
966 #define yyerrok (yyerrstatus = 0)
967 #define yyclearin (yychar = YYEMPTY)
968 
969 #define YYACCEPT goto yyacceptlab
970 #define YYABORT goto yyabortlab
971 #define YYERROR goto yyerrorlab
972 #define YYNOMEM goto yyexhaustedlab
973 
974 
975 #define YYRECOVERING() (!!yyerrstatus)
976 
977 #define YYBACKUP(Token, Value) \
978  do \
979  if (yychar == YYEMPTY) \
980  { \
981  yychar = (Token); \
982  yylval = (Value); \
983  YYPOPSTACK (yylen); \
984  yystate = *yyssp; \
985  goto yybackup; \
986  } \
987  else \
988  { \
989  yyerror (YY_("syntax error: cannot back up")); \
990  YYERROR; \
991  } \
992  while (0)
993 
994 /* Backward compatibility with an undocumented macro.
995  Use YYerror or YYUNDEF. */
996 #define YYERRCODE YYUNDEF
997 
998 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
999  If N is 0, then set CURRENT to the empty location which ends
1000  the previous symbol: RHS[0] (always defined). */
1001 
1002 #ifndef YYLLOC_DEFAULT
1003 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1004  do \
1005  if (N) \
1006  { \
1007  (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1008  (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1009  (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1010  (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1011  } \
1012  else \
1013  { \
1014  (Current).first_line = (Current).last_line = \
1015  YYRHSLOC (Rhs, 0).last_line; \
1016  (Current).first_column = (Current).last_column = \
1017  YYRHSLOC (Rhs, 0).last_column; \
1018  } \
1019  while (0)
1020 #endif
1021 
1022 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1023 
1024 
1025 /* Enable debugging if requested. */
1026 #if YYDEBUG
1027 
1028 # ifndef YYFPRINTF
1029 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1030 # define YYFPRINTF fprintf
1031 # endif
1032 
1033 # define YYDPRINTF(Args) \
1034 do { \
1035  if (yydebug) \
1036  YYFPRINTF Args; \
1037 } while (0)
1038 
1039 
1040 /* YYLOCATION_PRINT -- Print the location on the stream.
1041  This macro was not mandated originally: define only if we know
1042  we won't break user code: when these are the locations we know. */
1043 
1044 # ifndef YYLOCATION_PRINT
1045 
1046 # if defined YY_LOCATION_PRINT
1047 
1048  /* Temporary convenience wrapper in case some people defined the
1049  undocumented and private YY_LOCATION_PRINT macros. */
1050 # define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc))
1051 
1052 # elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1053 
1054 /* Print *YYLOCP on YYO. Private, do not rely on its existence. */
1055 
1057 static int
1058 yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
1059 {
1060  int res = 0;
1061  int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
1062  if (0 <= yylocp->first_line)
1063  {
1064  res += YYFPRINTF (yyo, "%d", yylocp->first_line);
1065  if (0 <= yylocp->first_column)
1066  res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
1067  }
1068  if (0 <= yylocp->last_line)
1069  {
1070  if (yylocp->first_line < yylocp->last_line)
1071  {
1072  res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
1073  if (0 <= end_col)
1074  res += YYFPRINTF (yyo, ".%d", end_col);
1075  }
1076  else if (0 <= end_col && yylocp->first_column < end_col)
1077  res += YYFPRINTF (yyo, "-%d", end_col);
1078  }
1079  return res;
1080 }
1081 
1082 # define YYLOCATION_PRINT yy_location_print_
1083 
1084  /* Temporary convenience wrapper in case some people defined the
1085  undocumented and private YY_LOCATION_PRINT macros. */
1086 # define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc))
1087 
1088 # else
1089 
1090 # define YYLOCATION_PRINT(File, Loc) ((void) 0)
1091  /* Temporary convenience wrapper in case some people defined the
1092  undocumented and private YY_LOCATION_PRINT macros. */
1093 # define YY_LOCATION_PRINT YYLOCATION_PRINT
1094 
1095 # endif
1096 # endif /* !defined YYLOCATION_PRINT */
1097 
1098 
1099 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
1100 do { \
1101  if (yydebug) \
1102  { \
1103  YYFPRINTF (stderr, "%s ", Title); \
1104  yy_symbol_print (stderr, \
1105  Kind, Value, Location); \
1106  YYFPRINTF (stderr, "\n"); \
1107  } \
1108 } while (0)
1109 
1110 
1111 /*-----------------------------------.
1112 | Print this symbol's value on YYO. |
1113 `-----------------------------------*/
1114 
1115 static void
1116 yy_symbol_value_print (FILE *yyo,
1117  yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
1118 {
1119  FILE *yyoutput = yyo;
1120  YY_USE (yyoutput);
1121  YY_USE (yylocationp);
1122  if (!yyvaluep)
1123  return;
1125  YY_USE (yykind);
1127 }
1128 
1129 
1130 /*---------------------------.
1131 | Print this symbol on YYO. |
1132 `---------------------------*/
1133 
1134 static void
1135 yy_symbol_print (FILE *yyo,
1136  yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
1137 {
1138  YYFPRINTF (yyo, "%s %s (",
1139  yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1140 
1141  YYLOCATION_PRINT (yyo, yylocationp);
1142  YYFPRINTF (yyo, ": ");
1143  yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp);
1144  YYFPRINTF (yyo, ")");
1145 }
1146 
1147 /*------------------------------------------------------------------.
1148 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1149 | TOP (included). |
1150 `------------------------------------------------------------------*/
1151 
1152 static void
1153 yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1154 {
1155  YYFPRINTF (stderr, "Stack now");
1156  for (; yybottom <= yytop; yybottom++)
1157  {
1158  int yybot = *yybottom;
1159  YYFPRINTF (stderr, " %d", yybot);
1160  }
1161  YYFPRINTF (stderr, "\n");
1162 }
1163 
1164 # define YY_STACK_PRINT(Bottom, Top) \
1165 do { \
1166  if (yydebug) \
1167  yy_stack_print ((Bottom), (Top)); \
1168 } while (0)
1169 
1170 
1171 /*------------------------------------------------.
1172 | Report that the YYRULE is going to be reduced. |
1173 `------------------------------------------------*/
1174 
1175 static void
1176 yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp,
1177  int yyrule)
1178 {
1179  int yylno = yyrline[yyrule];
1180  int yynrhs = yyr2[yyrule];
1181  int yyi;
1182  YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1183  yyrule - 1, yylno);
1184  /* The symbols being reduced. */
1185  for (yyi = 0; yyi < yynrhs; yyi++)
1186  {
1187  YYFPRINTF (stderr, " $%d = ", yyi + 1);
1188  yy_symbol_print (stderr,
1189  YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1190  &yyvsp[(yyi + 1) - (yynrhs)],
1191  &(yylsp[(yyi + 1) - (yynrhs)]));
1192  YYFPRINTF (stderr, "\n");
1193  }
1194 }
1195 
1196 # define YY_REDUCE_PRINT(Rule) \
1197 do { \
1198  if (yydebug) \
1199  yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1200 } while (0)
1201 
1202 /* Nonzero means print parse trace. It is left uninitialized so that
1203  multiple parsers can coexist. */
1204 int yydebug;
1205 #else /* !YYDEBUG */
1206 # define YYDPRINTF(Args) ((void) 0)
1207 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1208 # define YY_STACK_PRINT(Bottom, Top)
1209 # define YY_REDUCE_PRINT(Rule)
1210 #endif /* !YYDEBUG */
1211 
1212 
1213 /* YYINITDEPTH -- initial size of the parser's stacks. */
1214 #ifndef YYINITDEPTH
1215 # define YYINITDEPTH 200
1216 #endif
1217 
1218 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1219  if the built-in stack extension method is used).
1220 
1221  Do not make this value too large; the results are undefined if
1222  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1223  evaluated with infinite-precision integer arithmetic. */
1224 
1225 #ifndef YYMAXDEPTH
1226 # define YYMAXDEPTH 10000
1227 #endif
1228 
1229 
1230 /* Context of a parse error. */
1231 typedef struct
1232 {
1236 } yypcontext_t;
1237 
1238 /* Put in YYARG at most YYARGN of the expected tokens given the
1239  current YYCTX, and return the number of tokens stored in YYARG. If
1240  YYARG is null, return the number of expected tokens (guaranteed to
1241  be less than YYNTOKENS). Return YYENOMEM on memory exhaustion.
1242  Return 0 if there are more than YYARGN expected tokens, yet fill
1243  YYARG up to YYARGN. */
1244 static int
1246  yysymbol_kind_t yyarg[], int yyargn)
1247 {
1248  /* Actual size of YYARG. */
1249  int yycount = 0;
1250  int yyn = yypact[+*yyctx->yyssp];
1251  if (!yypact_value_is_default (yyn))
1252  {
1253  /* Start YYX at -YYN if negative to avoid negative indexes in
1254  YYCHECK. In other words, skip the first -YYN actions for
1255  this state because they are default actions. */
1256  int yyxbegin = yyn < 0 ? -yyn : 0;
1257  /* Stay within bounds of both yycheck and yytname. */
1258  int yychecklim = YYLAST - yyn + 1;
1259  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1260  int yyx;
1261  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1262  if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
1263  && !yytable_value_is_error (yytable[yyx + yyn]))
1264  {
1265  if (!yyarg)
1266  ++yycount;
1267  else if (yycount == yyargn)
1268  return 0;
1269  else
1270  yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
1271  }
1272  }
1273  if (yyarg && yycount == 0 && 0 < yyargn)
1274  yyarg[0] = YYSYMBOL_YYEMPTY;
1275  return yycount;
1276 }
1277 
1278 
1279 
1280 
1281 #ifndef yystrlen
1282 # if defined __GLIBC__ && defined _STRING_H
1283 # define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
1284 # else
1285 /* Return the length of YYSTR. */
1286 static YYPTRDIFF_T
1287 yystrlen (const char *yystr)
1288 {
1289  YYPTRDIFF_T yylen;
1290  for (yylen = 0; yystr[yylen]; yylen++)
1291  continue;
1292  return yylen;
1293 }
1294 # endif
1295 #endif
1296 
1297 #ifndef yystpcpy
1298 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1299 # define yystpcpy stpcpy
1300 # else
1301 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1302  YYDEST. */
1303 static char *
1304 yystpcpy (char *yydest, const char *yysrc)
1305 {
1306  char *yyd = yydest;
1307  const char *yys = yysrc;
1308 
1309  while ((*yyd++ = *yys++) != '\0')
1310  continue;
1311 
1312  return yyd - 1;
1313 }
1314 # endif
1315 #endif
1316 
1317 #ifndef yytnamerr
1318 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1319  quotes and backslashes, so that it's suitable for yyerror. The
1320  heuristic is that double-quoting is unnecessary unless the string
1321  contains an apostrophe, a comma, or backslash (other than
1322  backslash-backslash). YYSTR is taken from yytname. If YYRES is
1323  null, do not copy; instead, return the length of what the result
1324  would have been. */
1325 static YYPTRDIFF_T
1326 yytnamerr (char *yyres, const char *yystr)
1327 {
1328  if (*yystr == '"')
1329  {
1330  YYPTRDIFF_T yyn = 0;
1331  char const *yyp = yystr;
1332  for (;;)
1333  switch (*++yyp)
1334  {
1335  case '\'':
1336  case ',':
1337  goto do_not_strip_quotes;
1338 
1339  case '\\':
1340  if (*++yyp != '\\')
1341  goto do_not_strip_quotes;
1342  else
1343  goto append;
1344 
1345  append:
1346  default:
1347  if (yyres)
1348  yyres[yyn] = *yyp;
1349  yyn++;
1350  break;
1351 
1352  case '"':
1353  if (yyres)
1354  yyres[yyn] = '\0';
1355  return yyn;
1356  }
1357  do_not_strip_quotes: ;
1358  }
1359 
1360  if (yyres)
1361  return yystpcpy (yyres, yystr) - yyres;
1362  else
1363  return yystrlen (yystr);
1364 }
1365 #endif
1366 
1367 
1368 static int
1370  yysymbol_kind_t yyarg[], int yyargn)
1371 {
1372  /* Actual size of YYARG. */
1373  int yycount = 0;
1374  /* There are many possibilities here to consider:
1375  - If this state is a consistent state with a default action, then
1376  the only way this function was invoked is if the default action
1377  is an error action. In that case, don't check for expected
1378  tokens because there are none.
1379  - The only way there can be no lookahead present (in yychar) is if
1380  this state is a consistent state with a default action. Thus,
1381  detecting the absence of a lookahead is sufficient to determine
1382  that there is no unexpected or expected token to report. In that
1383  case, just report a simple "syntax error".
1384  - Don't assume there isn't a lookahead just because this state is a
1385  consistent state with a default action. There might have been a
1386  previous inconsistent state, consistent state with a non-default
1387  action, or user semantic action that manipulated yychar.
1388  - Of course, the expected token list depends on states to have
1389  correct lookahead information, and it depends on the parser not
1390  to perform extra reductions after fetching a lookahead from the
1391  scanner and before detecting a syntax error. Thus, state merging
1392  (from LALR or IELR) and default reductions corrupt the expected
1393  token list. However, the list is correct for canonical LR with
1394  one exception: it will still contain any token that will not be
1395  accepted due to an error action in a later state.
1396  */
1397  if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
1398  {
1399  int yyn;
1400  if (yyarg)
1401  yyarg[yycount] = yyctx->yytoken;
1402  ++yycount;
1403  yyn = yypcontext_expected_tokens (yyctx,
1404  yyarg ? yyarg + 1 : yyarg, yyargn - 1);
1405  if (yyn == YYENOMEM)
1406  return YYENOMEM;
1407  else
1408  yycount += yyn;
1409  }
1410  return yycount;
1411 }
1412 
1413 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1414  about the unexpected token YYTOKEN for the state stack whose top is
1415  YYSSP.
1416 
1417  Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is
1418  not large enough to hold the message. In that case, also set
1419  *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the
1420  required number of bytes is too large to store. */
1421 static int
1422 yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
1423  const yypcontext_t *yyctx)
1424 {
1425  enum { YYARGS_MAX = 5 };
1426  /* Internationalized format string. */
1427  const char *yyformat = YY_NULLPTR;
1428  /* Arguments of yyformat: reported tokens (one for the "unexpected",
1429  one per "expected"). */
1430  yysymbol_kind_t yyarg[YYARGS_MAX];
1431  /* Cumulated lengths of YYARG. */
1432  YYPTRDIFF_T yysize = 0;
1433 
1434  /* Actual size of YYARG. */
1435  int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
1436  if (yycount == YYENOMEM)
1437  return YYENOMEM;
1438 
1439  switch (yycount)
1440  {
1441 #define YYCASE_(N, S) \
1442  case N: \
1443  yyformat = S; \
1444  break
1445  default: /* Avoid compiler warnings. */
1446  YYCASE_(0, YY_("syntax error"));
1447  YYCASE_(1, YY_("syntax error, unexpected %s"));
1448  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1449  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1450  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1451  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1452 #undef YYCASE_
1453  }
1454 
1455  /* Compute error message size. Don't count the "%s"s, but reserve
1456  room for the terminator. */
1457  yysize = yystrlen (yyformat) - 2 * yycount + 1;
1458  {
1459  int yyi;
1460  for (yyi = 0; yyi < yycount; ++yyi)
1461  {
1462  YYPTRDIFF_T yysize1
1463  = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
1464  if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1465  yysize = yysize1;
1466  else
1467  return YYENOMEM;
1468  }
1469  }
1470 
1471  if (*yymsg_alloc < yysize)
1472  {
1473  *yymsg_alloc = 2 * yysize;
1474  if (! (yysize <= *yymsg_alloc
1475  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1476  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1477  return -1;
1478  }
1479 
1480  /* Avoid sprintf, as that infringes on the user's name space.
1481  Don't have undefined behavior even if the translation
1482  produced a string with the wrong number of "%s"s. */
1483  {
1484  char *yyp = *yymsg;
1485  int yyi = 0;
1486  while ((*yyp = *yyformat) != '\0')
1487  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1488  {
1489  yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
1490  yyformat += 2;
1491  }
1492  else
1493  {
1494  ++yyp;
1495  ++yyformat;
1496  }
1497  }
1498  return 0;
1499 }
1500 
1501 
1502 /*-----------------------------------------------.
1503 | Release the memory associated to this symbol. |
1504 `-----------------------------------------------*/
1505 
1506 static void
1507 yydestruct (const char *yymsg,
1508  yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
1509 {
1510  YY_USE (yyvaluep);
1511  YY_USE (yylocationp);
1512  if (!yymsg)
1513  yymsg = "Deleting";
1514  YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1515 
1517  switch (yykind)
1518  {
1519  case YYSYMBOL_geometry_no_srid: /* geometry_no_srid */
1520 #line 194 "lwin_wkt_parse.y"
1521  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1522 #line 1523 "lwin_wkt_parse.c"
1523  break;
1524 
1525  case YYSYMBOL_geometrycollection: /* geometrycollection */
1526 #line 195 "lwin_wkt_parse.y"
1527  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1528 #line 1529 "lwin_wkt_parse.c"
1529  break;
1530 
1531  case YYSYMBOL_geometry_list: /* geometry_list */
1532 #line 196 "lwin_wkt_parse.y"
1533  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1534 #line 1535 "lwin_wkt_parse.c"
1535  break;
1536 
1537  case YYSYMBOL_multisurface: /* multisurface */
1538 #line 203 "lwin_wkt_parse.y"
1539  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1540 #line 1541 "lwin_wkt_parse.c"
1541  break;
1542 
1543  case YYSYMBOL_surface_list: /* surface_list */
1544 #line 181 "lwin_wkt_parse.y"
1545  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1546 #line 1547 "lwin_wkt_parse.c"
1547  break;
1548 
1549  case YYSYMBOL_tin: /* tin */
1550 #line 210 "lwin_wkt_parse.y"
1551  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1552 #line 1553 "lwin_wkt_parse.c"
1553  break;
1554 
1555  case YYSYMBOL_polyhedralsurface: /* polyhedralsurface */
1556 #line 209 "lwin_wkt_parse.y"
1557  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1558 #line 1559 "lwin_wkt_parse.c"
1559  break;
1560 
1561  case YYSYMBOL_multipolygon: /* multipolygon */
1562 #line 202 "lwin_wkt_parse.y"
1563  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1564 #line 1565 "lwin_wkt_parse.c"
1565  break;
1566 
1567  case YYSYMBOL_polygon_list: /* polygon_list */
1568 #line 182 "lwin_wkt_parse.y"
1569  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1570 #line 1571 "lwin_wkt_parse.c"
1571  break;
1572 
1573  case YYSYMBOL_patch_list: /* patch_list */
1574 #line 183 "lwin_wkt_parse.y"
1575  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1576 #line 1577 "lwin_wkt_parse.c"
1577  break;
1578 
1579  case YYSYMBOL_polygon: /* polygon */
1580 #line 206 "lwin_wkt_parse.y"
1581  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1582 #line 1583 "lwin_wkt_parse.c"
1583  break;
1584 
1585  case YYSYMBOL_polygon_untagged: /* polygon_untagged */
1586 #line 208 "lwin_wkt_parse.y"
1587  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1588 #line 1589 "lwin_wkt_parse.c"
1589  break;
1590 
1591  case YYSYMBOL_patch: /* patch */
1592 #line 207 "lwin_wkt_parse.y"
1593  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1594 #line 1595 "lwin_wkt_parse.c"
1595  break;
1596 
1597  case YYSYMBOL_curvepolygon: /* curvepolygon */
1598 #line 192 "lwin_wkt_parse.y"
1599  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1600 #line 1601 "lwin_wkt_parse.c"
1601  break;
1602 
1603  case YYSYMBOL_curvering_list: /* curvering_list */
1604 #line 179 "lwin_wkt_parse.y"
1605  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1606 #line 1607 "lwin_wkt_parse.c"
1607  break;
1608 
1609  case YYSYMBOL_curvering: /* curvering */
1610 #line 193 "lwin_wkt_parse.y"
1611  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1612 #line 1613 "lwin_wkt_parse.c"
1613  break;
1614 
1615  case YYSYMBOL_patchring_list: /* patchring_list */
1616 #line 189 "lwin_wkt_parse.y"
1617  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1618 #line 1619 "lwin_wkt_parse.c"
1619  break;
1620 
1621  case YYSYMBOL_ring_list: /* ring_list */
1622 #line 188 "lwin_wkt_parse.y"
1623  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1624 #line 1625 "lwin_wkt_parse.c"
1625  break;
1626 
1627  case YYSYMBOL_patchring: /* patchring */
1628 #line 178 "lwin_wkt_parse.y"
1629  { ptarray_free(((*yyvaluep).ptarrayvalue)); }
1630 #line 1631 "lwin_wkt_parse.c"
1631  break;
1632 
1633  case YYSYMBOL_ring: /* ring */
1634 #line 177 "lwin_wkt_parse.y"
1635  { ptarray_free(((*yyvaluep).ptarrayvalue)); }
1636 #line 1637 "lwin_wkt_parse.c"
1637  break;
1638 
1639  case YYSYMBOL_compoundcurve: /* compoundcurve */
1640 #line 191 "lwin_wkt_parse.y"
1641  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1642 #line 1643 "lwin_wkt_parse.c"
1643  break;
1644 
1645  case YYSYMBOL_compound_list: /* compound_list */
1646 #line 187 "lwin_wkt_parse.y"
1647  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1648 #line 1649 "lwin_wkt_parse.c"
1649  break;
1650 
1651  case YYSYMBOL_multicurve: /* multicurve */
1652 #line 199 "lwin_wkt_parse.y"
1653  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1654 #line 1655 "lwin_wkt_parse.c"
1655  break;
1656 
1657  case YYSYMBOL_curve_list: /* curve_list */
1658 #line 186 "lwin_wkt_parse.y"
1659  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1660 #line 1661 "lwin_wkt_parse.c"
1661  break;
1662 
1663  case YYSYMBOL_multilinestring: /* multilinestring */
1664 #line 200 "lwin_wkt_parse.y"
1665  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1666 #line 1667 "lwin_wkt_parse.c"
1667  break;
1668 
1669  case YYSYMBOL_linestring_list: /* linestring_list */
1670 #line 185 "lwin_wkt_parse.y"
1671  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1672 #line 1673 "lwin_wkt_parse.c"
1673  break;
1674 
1675  case YYSYMBOL_circularstring: /* circularstring */
1676 #line 190 "lwin_wkt_parse.y"
1677  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1678 #line 1679 "lwin_wkt_parse.c"
1679  break;
1680 
1681  case YYSYMBOL_linestring: /* linestring */
1682 #line 197 "lwin_wkt_parse.y"
1683  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1684 #line 1685 "lwin_wkt_parse.c"
1685  break;
1686 
1687  case YYSYMBOL_linestring_untagged: /* linestring_untagged */
1688 #line 198 "lwin_wkt_parse.y"
1689  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1690 #line 1691 "lwin_wkt_parse.c"
1691  break;
1692 
1693  case YYSYMBOL_triangle_list: /* triangle_list */
1694 #line 180 "lwin_wkt_parse.y"
1695  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1696 #line 1697 "lwin_wkt_parse.c"
1697  break;
1698 
1699  case YYSYMBOL_triangle: /* triangle */
1700 #line 211 "lwin_wkt_parse.y"
1701  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1702 #line 1703 "lwin_wkt_parse.c"
1703  break;
1704 
1705  case YYSYMBOL_triangle_untagged: /* triangle_untagged */
1706 #line 212 "lwin_wkt_parse.y"
1707  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1708 #line 1709 "lwin_wkt_parse.c"
1709  break;
1710 
1711  case YYSYMBOL_multipoint: /* multipoint */
1712 #line 201 "lwin_wkt_parse.y"
1713  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1714 #line 1715 "lwin_wkt_parse.c"
1715  break;
1716 
1717  case YYSYMBOL_point_list: /* point_list */
1718 #line 184 "lwin_wkt_parse.y"
1719  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1720 #line 1721 "lwin_wkt_parse.c"
1721  break;
1722 
1723  case YYSYMBOL_point_untagged: /* point_untagged */
1724 #line 205 "lwin_wkt_parse.y"
1725  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1726 #line 1727 "lwin_wkt_parse.c"
1727  break;
1728 
1729  case YYSYMBOL_point: /* point */
1730 #line 204 "lwin_wkt_parse.y"
1731  { lwgeom_free(((*yyvaluep).geometryvalue)); }
1732 #line 1733 "lwin_wkt_parse.c"
1733  break;
1734 
1735  case YYSYMBOL_ptarray: /* ptarray */
1736 #line 176 "lwin_wkt_parse.y"
1737  { ptarray_free(((*yyvaluep).ptarrayvalue)); }
1738 #line 1739 "lwin_wkt_parse.c"
1739  break;
1740 
1741  default:
1742  break;
1743  }
1745 }
1746 
1747 
1748 /* Lookahead token kind. */
1750 
1751 /* The semantic value of the lookahead symbol. */
1753 /* Location data for the lookahead symbol. */
1755 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1756  = { 1, 1, 1, 1 }
1757 # endif
1758 ;
1759 /* Number of syntax errors so far. */
1761 
1762 
1763 
1764 
1765 /*----------.
1766 | yyparse. |
1767 `----------*/
1768 
1769 int
1770 yyparse (void)
1771 {
1772  yy_state_fast_t yystate = 0;
1773  /* Number of tokens to shift before error messages enabled. */
1774  int yyerrstatus = 0;
1775 
1776  /* Refer to the stacks through separate pointers, to allow yyoverflow
1777  to reallocate them elsewhere. */
1778 
1779  /* Their size. */
1780  YYPTRDIFF_T yystacksize = YYINITDEPTH;
1781 
1782  /* The state stack: array, bottom, top. */
1783  yy_state_t yyssa[YYINITDEPTH];
1784  yy_state_t *yyss = yyssa;
1785  yy_state_t *yyssp = yyss;
1786 
1787  /* The semantic value stack: array, bottom, top. */
1788  YYSTYPE yyvsa[YYINITDEPTH];
1789  YYSTYPE *yyvs = yyvsa;
1790  YYSTYPE *yyvsp = yyvs;
1791 
1792  /* The location stack: array, bottom, top. */
1793  YYLTYPE yylsa[YYINITDEPTH];
1794  YYLTYPE *yyls = yylsa;
1795  YYLTYPE *yylsp = yyls;
1796 
1797  int yyn;
1798  /* The return value of yyparse. */
1799  int yyresult;
1800  /* Lookahead symbol kind. */
1802  /* The variables used to return semantic value and location from the
1803  action routines. */
1804  YYSTYPE yyval;
1805  YYLTYPE yyloc;
1806 
1807  /* The locations where the error started and ended. */
1808  YYLTYPE yyerror_range[3];
1809 
1810  /* Buffer for error messages, and its allocated size. */
1811  char yymsgbuf[128];
1812  char *yymsg = yymsgbuf;
1813  YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
1814 
1815 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1816 
1817  /* The number of symbols on the RHS of the reduced rule.
1818  Keep to zero when no symbol should be popped. */
1819  int yylen = 0;
1820 
1821  YYDPRINTF ((stderr, "Starting parse\n"));
1822 
1823  yychar = YYEMPTY; /* Cause a token to be read. */
1824 
1825  yylsp[0] = yylloc;
1826  goto yysetstate;
1827 
1828 
1829 /*------------------------------------------------------------.
1830 | yynewstate -- push a new state, which is found in yystate. |
1831 `------------------------------------------------------------*/
1832 yynewstate:
1833  /* In all cases, when you get here, the value and location stacks
1834  have just been pushed. So pushing a state here evens the stacks. */
1835  yyssp++;
1836 
1837 
1838 /*--------------------------------------------------------------------.
1839 | yysetstate -- set current state (the top of the stack) to yystate. |
1840 `--------------------------------------------------------------------*/
1841 yysetstate:
1842  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1843  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1845  *yyssp = YY_CAST (yy_state_t, yystate);
1847  YY_STACK_PRINT (yyss, yyssp);
1848 
1849  if (yyss + yystacksize - 1 <= yyssp)
1850 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1851  YYNOMEM;
1852 #else
1853  {
1854  /* Get the current used size of the three stacks, in elements. */
1855  YYPTRDIFF_T yysize = yyssp - yyss + 1;
1856 
1857 # if defined yyoverflow
1858  {
1859  /* Give user a chance to reallocate the stack. Use copies of
1860  these so that the &'s don't force the real ones into
1861  memory. */
1862  yy_state_t *yyss1 = yyss;
1863  YYSTYPE *yyvs1 = yyvs;
1864  YYLTYPE *yyls1 = yyls;
1865 
1866  /* Each stack pointer address is followed by the size of the
1867  data in use in that stack, in bytes. This used to be a
1868  conditional around just the two extra args, but that might
1869  be undefined if yyoverflow is a macro. */
1870  yyoverflow (YY_("memory exhausted"),
1871  &yyss1, yysize * YYSIZEOF (*yyssp),
1872  &yyvs1, yysize * YYSIZEOF (*yyvsp),
1873  &yyls1, yysize * YYSIZEOF (*yylsp),
1874  &yystacksize);
1875  yyss = yyss1;
1876  yyvs = yyvs1;
1877  yyls = yyls1;
1878  }
1879 # else /* defined YYSTACK_RELOCATE */
1880  /* Extend the stack our own way. */
1881  if (YYMAXDEPTH <= yystacksize)
1882  YYNOMEM;
1883  yystacksize *= 2;
1884  if (YYMAXDEPTH < yystacksize)
1885  yystacksize = YYMAXDEPTH;
1886 
1887  {
1888  yy_state_t *yyss1 = yyss;
1889  union yyalloc *yyptr =
1890  YY_CAST (union yyalloc *,
1891  YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1892  if (! yyptr)
1893  YYNOMEM;
1894  YYSTACK_RELOCATE (yyss_alloc, yyss);
1895  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1896  YYSTACK_RELOCATE (yyls_alloc, yyls);
1897 # undef YYSTACK_RELOCATE
1898  if (yyss1 != yyssa)
1899  YYSTACK_FREE (yyss1);
1900  }
1901 # endif
1902 
1903  yyssp = yyss + yysize - 1;
1904  yyvsp = yyvs + yysize - 1;
1905  yylsp = yyls + yysize - 1;
1906 
1908  YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1909  YY_CAST (long, yystacksize)));
1911 
1912  if (yyss + yystacksize - 1 <= yyssp)
1913  YYABORT;
1914  }
1915 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1916 
1917 
1918  if (yystate == YYFINAL)
1919  YYACCEPT;
1920 
1921  goto yybackup;
1922 
1923 
1924 /*-----------.
1925 | yybackup. |
1926 `-----------*/
1927 yybackup:
1928  /* Do appropriate processing given the current state. Read a
1929  lookahead token if we need one and don't already have one. */
1930 
1931  /* First try to decide what to do without reference to lookahead token. */
1932  yyn = yypact[yystate];
1933  if (yypact_value_is_default (yyn))
1934  goto yydefault;
1935 
1936  /* Not known => get a lookahead token if don't already have one. */
1937 
1938  /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1939  if (yychar == YYEMPTY)
1940  {
1941  YYDPRINTF ((stderr, "Reading a token\n"));
1942  yychar = yylex ();
1943  }
1944 
1945  if (yychar <= YYEOF)
1946  {
1947  yychar = YYEOF;
1948  yytoken = YYSYMBOL_YYEOF;
1949  YYDPRINTF ((stderr, "Now at end of input.\n"));
1950  }
1951  else if (yychar == YYerror)
1952  {
1953  /* The scanner already issued an error message, process directly
1954  to error recovery. But do not keep the error token as
1955  lookahead, it is too special and may lead us to an endless
1956  loop in error recovery. */
1957  yychar = YYUNDEF;
1958  yytoken = YYSYMBOL_YYerror;
1959  yyerror_range[1] = yylloc;
1960  goto yyerrlab1;
1961  }
1962  else
1963  {
1964  yytoken = YYTRANSLATE (yychar);
1965  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1966  }
1967 
1968  /* If the proper action on seeing token YYTOKEN is to reduce or to
1969  detect an error, take that action. */
1970  yyn += yytoken;
1971  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1972  goto yydefault;
1973  yyn = yytable[yyn];
1974  if (yyn <= 0)
1975  {
1976  if (yytable_value_is_error (yyn))
1977  goto yyerrlab;
1978  yyn = -yyn;
1979  goto yyreduce;
1980  }
1981 
1982  /* Count tokens shifted since error; after three, turn off error
1983  status. */
1984  if (yyerrstatus)
1985  yyerrstatus--;
1986 
1987  /* Shift the lookahead token. */
1988  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1989  yystate = yyn;
1991  *++yyvsp = yylval;
1993  *++yylsp = yylloc;
1994 
1995  /* Discard the shifted token. */
1996  yychar = YYEMPTY;
1997  goto yynewstate;
1998 
1999 
2000 /*-----------------------------------------------------------.
2001 | yydefault -- do the default action for the current state. |
2002 `-----------------------------------------------------------*/
2003 yydefault:
2004  yyn = yydefact[yystate];
2005  if (yyn == 0)
2006  goto yyerrlab;
2007  goto yyreduce;
2008 
2009 
2010 /*-----------------------------.
2011 | yyreduce -- do a reduction. |
2012 `-----------------------------*/
2013 yyreduce:
2014  /* yyn is the number of a rule to reduce with. */
2015  yylen = yyr2[yyn];
2016 
2017  /* If YYLEN is nonzero, implement the default value of the action:
2018  '$$ = $1'.
2019 
2020  Otherwise, the following line sets YYVAL to garbage.
2021  This behavior is undocumented and Bison
2022  users should not rely upon it. Assigning to YYVAL
2023  unconditionally makes the parser a bit smaller, and it avoids a
2024  GCC warning that YYVAL may be used uninitialized. */
2025  yyval = yyvsp[1-yylen];
2026 
2027  /* Default location. */
2028  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
2029  yyerror_range[1] = yyloc;
2030  YY_REDUCE_PRINT (yyn);
2031  switch (yyn)
2032  {
2033  case 2: /* geometry: geometry_no_srid */
2034 #line 218 "lwin_wkt_parse.y"
2035  { wkt_parser_geometry_new((yyvsp[0].geometryvalue), SRID_UNKNOWN); WKT_ERROR(); }
2036 #line 2037 "lwin_wkt_parse.c"
2037  break;
2038 
2039  case 3: /* geometry: SRID_TOK SEMICOLON_TOK geometry_no_srid */
2040 #line 220 "lwin_wkt_parse.y"
2041  { wkt_parser_geometry_new((yyvsp[0].geometryvalue), (yyvsp[-2].integervalue)); WKT_ERROR(); }
2042 #line 2043 "lwin_wkt_parse.c"
2043  break;
2044 
2045  case 4: /* geometry_no_srid: point */
2046 #line 223 "lwin_wkt_parse.y"
2047  { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
2048 #line 2049 "lwin_wkt_parse.c"
2049  break;
2050 
2051  case 5: /* geometry_no_srid: linestring */
2052 #line 224 "lwin_wkt_parse.y"
2053  { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
2054 #line 2055 "lwin_wkt_parse.c"
2055  break;
2056 
2057  case 6: /* geometry_no_srid: circularstring */
2058 #line 225 "lwin_wkt_parse.y"
2059  { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
2060 #line 2061 "lwin_wkt_parse.c"
2061  break;
2062 
2063  case 7: /* geometry_no_srid: compoundcurve */
2064 #line 226 "lwin_wkt_parse.y"
2065  { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
2066 #line 2067 "lwin_wkt_parse.c"
2067  break;
2068 
2069  case 8: /* geometry_no_srid: polygon */
2070 #line 227 "lwin_wkt_parse.y"
2071  { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
2072 #line 2073 "lwin_wkt_parse.c"
2073  break;
2074 
2075  case 9: /* geometry_no_srid: curvepolygon */
2076 #line 228 "lwin_wkt_parse.y"
2077  { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
2078 #line 2079 "lwin_wkt_parse.c"
2079  break;
2080 
2081  case 10: /* geometry_no_srid: multipoint */
2082 #line 229 "lwin_wkt_parse.y"
2083  { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
2084 #line 2085 "lwin_wkt_parse.c"
2085  break;
2086 
2087  case 11: /* geometry_no_srid: multilinestring */
2088 #line 230 "lwin_wkt_parse.y"
2089  { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
2090 #line 2091 "lwin_wkt_parse.c"
2091  break;
2092 
2093  case 12: /* geometry_no_srid: multipolygon */
2094 #line 231 "lwin_wkt_parse.y"
2095  { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
2096 #line 2097 "lwin_wkt_parse.c"
2097  break;
2098 
2099  case 13: /* geometry_no_srid: multisurface */
2100 #line 232 "lwin_wkt_parse.y"
2101  { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
2102 #line 2103 "lwin_wkt_parse.c"
2103  break;
2104 
2105  case 14: /* geometry_no_srid: multicurve */
2106 #line 233 "lwin_wkt_parse.y"
2107  { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
2108 #line 2109 "lwin_wkt_parse.c"
2109  break;
2110 
2111  case 15: /* geometry_no_srid: tin */
2112 #line 234 "lwin_wkt_parse.y"
2113  { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
2114 #line 2115 "lwin_wkt_parse.c"
2115  break;
2116 
2117  case 16: /* geometry_no_srid: polyhedralsurface */
2118 #line 235 "lwin_wkt_parse.y"
2119  { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
2120 #line 2121 "lwin_wkt_parse.c"
2121  break;
2122 
2123  case 17: /* geometry_no_srid: triangle */
2124 #line 236 "lwin_wkt_parse.y"
2125  { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
2126 #line 2127 "lwin_wkt_parse.c"
2127  break;
2128 
2129  case 18: /* geometry_no_srid: geometrycollection */
2130 #line 237 "lwin_wkt_parse.y"
2131  { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
2132 #line 2133 "lwin_wkt_parse.c"
2133  break;
2134 
2135  case 19: /* geometrycollection: COLLECTION_TOK LBRACKET_TOK geometry_list RBRACKET_TOK */
2136 #line 241 "lwin_wkt_parse.y"
2137  { (yyval.geometryvalue) = wkt_parser_collection_finalize(COLLECTIONTYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); }
2138 #line 2139 "lwin_wkt_parse.c"
2139  break;
2140 
2141  case 20: /* geometrycollection: COLLECTION_TOK DIMENSIONALITY_TOK LBRACKET_TOK geometry_list RBRACKET_TOK */
2142 #line 243 "lwin_wkt_parse.y"
2143  { (yyval.geometryvalue) = wkt_parser_collection_finalize(COLLECTIONTYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
2144 #line 2145 "lwin_wkt_parse.c"
2145  break;
2146 
2147  case 21: /* geometrycollection: COLLECTION_TOK DIMENSIONALITY_TOK EMPTY_TOK */
2148 #line 245 "lwin_wkt_parse.y"
2149  { (yyval.geometryvalue) = wkt_parser_collection_finalize(COLLECTIONTYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
2150 #line 2151 "lwin_wkt_parse.c"
2151  break;
2152 
2153  case 22: /* geometrycollection: COLLECTION_TOK EMPTY_TOK */
2154 #line 247 "lwin_wkt_parse.y"
2156 #line 2157 "lwin_wkt_parse.c"
2157  break;
2158 
2159  case 23: /* geometry_list: geometry_list COMMA_TOK geometry_no_srid */
2160 #line 251 "lwin_wkt_parse.y"
2161  { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
2162 #line 2163 "lwin_wkt_parse.c"
2163  break;
2164 
2165  case 24: /* geometry_list: geometry_no_srid */
2166 #line 253 "lwin_wkt_parse.y"
2167  { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
2168 #line 2169 "lwin_wkt_parse.c"
2169  break;
2170 
2171  case 25: /* multisurface: MSURFACE_TOK LBRACKET_TOK surface_list RBRACKET_TOK */
2172 #line 257 "lwin_wkt_parse.y"
2173  { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTISURFACETYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); }
2174 #line 2175 "lwin_wkt_parse.c"
2175  break;
2176 
2177  case 26: /* multisurface: MSURFACE_TOK DIMENSIONALITY_TOK LBRACKET_TOK surface_list RBRACKET_TOK */
2178 #line 259 "lwin_wkt_parse.y"
2179  { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTISURFACETYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
2180 #line 2181 "lwin_wkt_parse.c"
2181  break;
2182 
2183  case 27: /* multisurface: MSURFACE_TOK DIMENSIONALITY_TOK EMPTY_TOK */
2184 #line 261 "lwin_wkt_parse.y"
2185  { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTISURFACETYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
2186 #line 2187 "lwin_wkt_parse.c"
2187  break;
2188 
2189  case 28: /* multisurface: MSURFACE_TOK EMPTY_TOK */
2190 #line 263 "lwin_wkt_parse.y"
2192 #line 2193 "lwin_wkt_parse.c"
2193  break;
2194 
2195  case 29: /* surface_list: surface_list COMMA_TOK polygon */
2196 #line 267 "lwin_wkt_parse.y"
2197  { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
2198 #line 2199 "lwin_wkt_parse.c"
2199  break;
2200 
2201  case 30: /* surface_list: surface_list COMMA_TOK curvepolygon */
2202 #line 269 "lwin_wkt_parse.y"
2203  { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
2204 #line 2205 "lwin_wkt_parse.c"
2205  break;
2206 
2207  case 31: /* surface_list: surface_list COMMA_TOK polygon_untagged */
2208 #line 271 "lwin_wkt_parse.y"
2209  { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
2210 #line 2211 "lwin_wkt_parse.c"
2211  break;
2212 
2213  case 32: /* surface_list: polygon */
2214 #line 273 "lwin_wkt_parse.y"
2215  { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
2216 #line 2217 "lwin_wkt_parse.c"
2217  break;
2218 
2219  case 33: /* surface_list: curvepolygon */
2220 #line 275 "lwin_wkt_parse.y"
2221  { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
2222 #line 2223 "lwin_wkt_parse.c"
2223  break;
2224 
2225  case 34: /* surface_list: polygon_untagged */
2226 #line 277 "lwin_wkt_parse.y"
2227  { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
2228 #line 2229 "lwin_wkt_parse.c"
2229  break;
2230 
2231  case 35: /* tin: TIN_TOK LBRACKET_TOK triangle_list RBRACKET_TOK */
2232 #line 281 "lwin_wkt_parse.y"
2233  { (yyval.geometryvalue) = wkt_parser_collection_finalize(TINTYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); }
2234 #line 2235 "lwin_wkt_parse.c"
2235  break;
2236 
2237  case 36: /* tin: TIN_TOK DIMENSIONALITY_TOK LBRACKET_TOK triangle_list RBRACKET_TOK */
2238 #line 283 "lwin_wkt_parse.y"
2239  { (yyval.geometryvalue) = wkt_parser_collection_finalize(TINTYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
2240 #line 2241 "lwin_wkt_parse.c"
2241  break;
2242 
2243  case 37: /* tin: TIN_TOK DIMENSIONALITY_TOK EMPTY_TOK */
2244 #line 285 "lwin_wkt_parse.y"
2245  { (yyval.geometryvalue) = wkt_parser_collection_finalize(TINTYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
2246 #line 2247 "lwin_wkt_parse.c"
2247  break;
2248 
2249  case 38: /* tin: TIN_TOK EMPTY_TOK */
2250 #line 287 "lwin_wkt_parse.y"
2251  { (yyval.geometryvalue) = wkt_parser_collection_finalize(TINTYPE, NULL, NULL); WKT_ERROR(); }
2252 #line 2253 "lwin_wkt_parse.c"
2253  break;
2254 
2255  case 39: /* polyhedralsurface: POLYHEDRALSURFACE_TOK LBRACKET_TOK patch_list RBRACKET_TOK */
2256 #line 291 "lwin_wkt_parse.y"
2257  { (yyval.geometryvalue) = wkt_parser_collection_finalize(POLYHEDRALSURFACETYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); }
2258 #line 2259 "lwin_wkt_parse.c"
2259  break;
2260 
2261  case 40: /* polyhedralsurface: POLYHEDRALSURFACE_TOK DIMENSIONALITY_TOK LBRACKET_TOK patch_list RBRACKET_TOK */
2262 #line 293 "lwin_wkt_parse.y"
2263  { (yyval.geometryvalue) = wkt_parser_collection_finalize(POLYHEDRALSURFACETYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
2264 #line 2265 "lwin_wkt_parse.c"
2265  break;
2266 
2267  case 41: /* polyhedralsurface: POLYHEDRALSURFACE_TOK DIMENSIONALITY_TOK EMPTY_TOK */
2268 #line 295 "lwin_wkt_parse.y"
2269  { (yyval.geometryvalue) = wkt_parser_collection_finalize(POLYHEDRALSURFACETYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
2270 #line 2271 "lwin_wkt_parse.c"
2271  break;
2272 
2273  case 42: /* polyhedralsurface: POLYHEDRALSURFACE_TOK EMPTY_TOK */
2274 #line 297 "lwin_wkt_parse.y"
2276 #line 2277 "lwin_wkt_parse.c"
2277  break;
2278 
2279  case 43: /* multipolygon: MPOLYGON_TOK LBRACKET_TOK polygon_list RBRACKET_TOK */
2280 #line 301 "lwin_wkt_parse.y"
2281  { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOLYGONTYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); }
2282 #line 2283 "lwin_wkt_parse.c"
2283  break;
2284 
2285  case 44: /* multipolygon: MPOLYGON_TOK DIMENSIONALITY_TOK LBRACKET_TOK polygon_list RBRACKET_TOK */
2286 #line 303 "lwin_wkt_parse.y"
2287  { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOLYGONTYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
2288 #line 2289 "lwin_wkt_parse.c"
2289  break;
2290 
2291  case 45: /* multipolygon: MPOLYGON_TOK DIMENSIONALITY_TOK EMPTY_TOK */
2292 #line 305 "lwin_wkt_parse.y"
2293  { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOLYGONTYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
2294 #line 2295 "lwin_wkt_parse.c"
2295  break;
2296 
2297  case 46: /* multipolygon: MPOLYGON_TOK EMPTY_TOK */
2298 #line 307 "lwin_wkt_parse.y"
2300 #line 2301 "lwin_wkt_parse.c"
2301  break;
2302 
2303  case 47: /* polygon_list: polygon_list COMMA_TOK polygon_untagged */
2304 #line 311 "lwin_wkt_parse.y"
2305  { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
2306 #line 2307 "lwin_wkt_parse.c"
2307  break;
2308 
2309  case 48: /* polygon_list: polygon_untagged */
2310 #line 313 "lwin_wkt_parse.y"
2311  { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
2312 #line 2313 "lwin_wkt_parse.c"
2313  break;
2314 
2315  case 49: /* patch_list: patch_list COMMA_TOK patch */
2316 #line 317 "lwin_wkt_parse.y"
2317  { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
2318 #line 2319 "lwin_wkt_parse.c"
2319  break;
2320 
2321  case 50: /* patch_list: patch */
2322 #line 319 "lwin_wkt_parse.y"
2323  { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
2324 #line 2325 "lwin_wkt_parse.c"
2325  break;
2326 
2327  case 51: /* polygon: POLYGON_TOK LBRACKET_TOK ring_list RBRACKET_TOK */
2328 #line 323 "lwin_wkt_parse.y"
2329  { (yyval.geometryvalue) = wkt_parser_polygon_finalize((yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); }
2330 #line 2331 "lwin_wkt_parse.c"
2331  break;
2332 
2333  case 52: /* polygon: POLYGON_TOK DIMENSIONALITY_TOK LBRACKET_TOK ring_list RBRACKET_TOK */
2334 #line 325 "lwin_wkt_parse.y"
2335  { (yyval.geometryvalue) = wkt_parser_polygon_finalize((yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
2336 #line 2337 "lwin_wkt_parse.c"
2337  break;
2338 
2339  case 53: /* polygon: POLYGON_TOK DIMENSIONALITY_TOK EMPTY_TOK */
2340 #line 327 "lwin_wkt_parse.y"
2341  { (yyval.geometryvalue) = wkt_parser_polygon_finalize(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
2342 #line 2343 "lwin_wkt_parse.c"
2343  break;
2344 
2345  case 54: /* polygon: POLYGON_TOK EMPTY_TOK */
2346 #line 329 "lwin_wkt_parse.y"
2347  { (yyval.geometryvalue) = wkt_parser_polygon_finalize(NULL, NULL); WKT_ERROR(); }
2348 #line 2349 "lwin_wkt_parse.c"
2349  break;
2350 
2351  case 55: /* polygon_untagged: LBRACKET_TOK ring_list RBRACKET_TOK */
2352 #line 333 "lwin_wkt_parse.y"
2353  { (yyval.geometryvalue) = (yyvsp[-1].geometryvalue); }
2354 #line 2355 "lwin_wkt_parse.c"
2355  break;
2356 
2357  case 56: /* polygon_untagged: EMPTY_TOK */
2358 #line 335 "lwin_wkt_parse.y"
2359  { (yyval.geometryvalue) = wkt_parser_polygon_finalize(NULL, NULL); WKT_ERROR(); }
2360 #line 2361 "lwin_wkt_parse.c"
2361  break;
2362 
2363  case 57: /* patch: LBRACKET_TOK patchring_list RBRACKET_TOK */
2364 #line 338 "lwin_wkt_parse.y"
2365  { (yyval.geometryvalue) = (yyvsp[-1].geometryvalue); }
2366 #line 2367 "lwin_wkt_parse.c"
2367  break;
2368 
2369  case 58: /* curvepolygon: CURVEPOLYGON_TOK LBRACKET_TOK curvering_list RBRACKET_TOK */
2370 #line 342 "lwin_wkt_parse.y"
2371  { (yyval.geometryvalue) = wkt_parser_curvepolygon_finalize((yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); }
2372 #line 2373 "lwin_wkt_parse.c"
2373  break;
2374 
2375  case 59: /* curvepolygon: CURVEPOLYGON_TOK DIMENSIONALITY_TOK LBRACKET_TOK curvering_list RBRACKET_TOK */
2376 #line 344 "lwin_wkt_parse.y"
2377  { (yyval.geometryvalue) = wkt_parser_curvepolygon_finalize((yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
2378 #line 2379 "lwin_wkt_parse.c"
2379  break;
2380 
2381  case 60: /* curvepolygon: CURVEPOLYGON_TOK DIMENSIONALITY_TOK EMPTY_TOK */
2382 #line 346 "lwin_wkt_parse.y"
2383  { (yyval.geometryvalue) = wkt_parser_curvepolygon_finalize(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
2384 #line 2385 "lwin_wkt_parse.c"
2385  break;
2386 
2387  case 61: /* curvepolygon: CURVEPOLYGON_TOK EMPTY_TOK */
2388 #line 348 "lwin_wkt_parse.y"
2389  { (yyval.geometryvalue) = wkt_parser_curvepolygon_finalize(NULL, NULL); WKT_ERROR(); }
2390 #line 2391 "lwin_wkt_parse.c"
2391  break;
2392 
2393  case 62: /* curvering_list: curvering_list COMMA_TOK curvering */
2394 #line 352 "lwin_wkt_parse.y"
2395  { (yyval.geometryvalue) = wkt_parser_curvepolygon_add_ring((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
2396 #line 2397 "lwin_wkt_parse.c"
2397  break;
2398 
2399  case 63: /* curvering_list: curvering */
2400 #line 354 "lwin_wkt_parse.y"
2401  { (yyval.geometryvalue) = wkt_parser_curvepolygon_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
2402 #line 2403 "lwin_wkt_parse.c"
2403  break;
2404 
2405  case 64: /* curvering: linestring_untagged */
2406 #line 357 "lwin_wkt_parse.y"
2407  { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
2408 #line 2409 "lwin_wkt_parse.c"
2409  break;
2410 
2411  case 65: /* curvering: linestring */
2412 #line 358 "lwin_wkt_parse.y"
2413  { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
2414 #line 2415 "lwin_wkt_parse.c"
2415  break;
2416 
2417  case 66: /* curvering: compoundcurve */
2418 #line 359 "lwin_wkt_parse.y"
2419  { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
2420 #line 2421 "lwin_wkt_parse.c"
2421  break;
2422 
2423  case 67: /* curvering: circularstring */
2424 #line 360 "lwin_wkt_parse.y"
2425  { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
2426 #line 2427 "lwin_wkt_parse.c"
2427  break;
2428 
2429  case 68: /* patchring_list: patchring_list COMMA_TOK patchring */
2430 #line 364 "lwin_wkt_parse.y"
2431  { (yyval.geometryvalue) = wkt_parser_polygon_add_ring((yyvsp[-2].geometryvalue),(yyvsp[0].ptarrayvalue),'Z'); WKT_ERROR(); }
2432 #line 2433 "lwin_wkt_parse.c"
2433  break;
2434 
2435  case 69: /* patchring_list: patchring */
2436 #line 366 "lwin_wkt_parse.y"
2437  { (yyval.geometryvalue) = wkt_parser_polygon_new((yyvsp[0].ptarrayvalue),'Z'); WKT_ERROR(); }
2438 #line 2439 "lwin_wkt_parse.c"
2439  break;
2440 
2441  case 70: /* ring_list: ring_list COMMA_TOK ring */
2442 #line 370 "lwin_wkt_parse.y"
2443  { (yyval.geometryvalue) = wkt_parser_polygon_add_ring((yyvsp[-2].geometryvalue),(yyvsp[0].ptarrayvalue),'2'); WKT_ERROR(); }
2444 #line 2445 "lwin_wkt_parse.c"
2445  break;
2446 
2447  case 71: /* ring_list: ring */
2448 #line 372 "lwin_wkt_parse.y"
2449  { (yyval.geometryvalue) = wkt_parser_polygon_new((yyvsp[0].ptarrayvalue),'2'); WKT_ERROR(); }
2450 #line 2451 "lwin_wkt_parse.c"
2451  break;
2452 
2453  case 72: /* patchring: LBRACKET_TOK ptarray RBRACKET_TOK */
2454 #line 375 "lwin_wkt_parse.y"
2455  { (yyval.ptarrayvalue) = (yyvsp[-1].ptarrayvalue); }
2456 #line 2457 "lwin_wkt_parse.c"
2457  break;
2458 
2459  case 73: /* ring: LBRACKET_TOK ptarray RBRACKET_TOK */
2460 #line 378 "lwin_wkt_parse.y"
2461  { (yyval.ptarrayvalue) = (yyvsp[-1].ptarrayvalue); }
2462 #line 2463 "lwin_wkt_parse.c"
2463  break;
2464 
2465  case 74: /* compoundcurve: COMPOUNDCURVE_TOK LBRACKET_TOK compound_list RBRACKET_TOK */
2466 #line 382 "lwin_wkt_parse.y"
2467  { (yyval.geometryvalue) = wkt_parser_compound_finalize((yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); }
2468 #line 2469 "lwin_wkt_parse.c"
2469  break;
2470 
2471  case 75: /* compoundcurve: COMPOUNDCURVE_TOK DIMENSIONALITY_TOK LBRACKET_TOK compound_list RBRACKET_TOK */
2472 #line 384 "lwin_wkt_parse.y"
2473  { (yyval.geometryvalue) = wkt_parser_compound_finalize((yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
2474 #line 2475 "lwin_wkt_parse.c"
2475  break;
2476 
2477  case 76: /* compoundcurve: COMPOUNDCURVE_TOK DIMENSIONALITY_TOK EMPTY_TOK */
2478 #line 386 "lwin_wkt_parse.y"
2479  { (yyval.geometryvalue) = wkt_parser_compound_finalize(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
2480 #line 2481 "lwin_wkt_parse.c"
2481  break;
2482 
2483  case 77: /* compoundcurve: COMPOUNDCURVE_TOK EMPTY_TOK */
2484 #line 388 "lwin_wkt_parse.y"
2485  { (yyval.geometryvalue) = wkt_parser_compound_finalize(NULL, NULL); WKT_ERROR(); }
2486 #line 2487 "lwin_wkt_parse.c"
2487  break;
2488 
2489  case 78: /* compound_list: compound_list COMMA_TOK circularstring */
2490 #line 392 "lwin_wkt_parse.y"
2491  { (yyval.geometryvalue) = wkt_parser_compound_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
2492 #line 2493 "lwin_wkt_parse.c"
2493  break;
2494 
2495  case 79: /* compound_list: compound_list COMMA_TOK linestring */
2496 #line 394 "lwin_wkt_parse.y"
2497  { (yyval.geometryvalue) = wkt_parser_compound_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
2498 #line 2499 "lwin_wkt_parse.c"
2499  break;
2500 
2501  case 80: /* compound_list: compound_list COMMA_TOK linestring_untagged */
2502 #line 396 "lwin_wkt_parse.y"
2503  { (yyval.geometryvalue) = wkt_parser_compound_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
2504 #line 2505 "lwin_wkt_parse.c"
2505  break;
2506 
2507  case 81: /* compound_list: circularstring */
2508 #line 398 "lwin_wkt_parse.y"
2509  { (yyval.geometryvalue) = wkt_parser_compound_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
2510 #line 2511 "lwin_wkt_parse.c"
2511  break;
2512 
2513  case 82: /* compound_list: linestring */
2514 #line 400 "lwin_wkt_parse.y"
2515  { (yyval.geometryvalue) = wkt_parser_compound_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
2516 #line 2517 "lwin_wkt_parse.c"
2517  break;
2518 
2519  case 83: /* compound_list: linestring_untagged */
2520 #line 402 "lwin_wkt_parse.y"
2521  { (yyval.geometryvalue) = wkt_parser_compound_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
2522 #line 2523 "lwin_wkt_parse.c"
2523  break;
2524 
2525  case 84: /* multicurve: MCURVE_TOK LBRACKET_TOK curve_list RBRACKET_TOK */
2526 #line 406 "lwin_wkt_parse.y"
2527  { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTICURVETYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); }
2528 #line 2529 "lwin_wkt_parse.c"
2529  break;
2530 
2531  case 85: /* multicurve: MCURVE_TOK DIMENSIONALITY_TOK LBRACKET_TOK curve_list RBRACKET_TOK */
2532 #line 408 "lwin_wkt_parse.y"
2533  { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTICURVETYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
2534 #line 2535 "lwin_wkt_parse.c"
2535  break;
2536 
2537  case 86: /* multicurve: MCURVE_TOK DIMENSIONALITY_TOK EMPTY_TOK */
2538 #line 410 "lwin_wkt_parse.y"
2539  { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTICURVETYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
2540 #line 2541 "lwin_wkt_parse.c"
2541  break;
2542 
2543  case 87: /* multicurve: MCURVE_TOK EMPTY_TOK */
2544 #line 412 "lwin_wkt_parse.y"
2546 #line 2547 "lwin_wkt_parse.c"
2547  break;
2548 
2549  case 88: /* curve_list: curve_list COMMA_TOK circularstring */
2550 #line 416 "lwin_wkt_parse.y"
2551  { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
2552 #line 2553 "lwin_wkt_parse.c"
2553  break;
2554 
2555  case 89: /* curve_list: curve_list COMMA_TOK compoundcurve */
2556 #line 418 "lwin_wkt_parse.y"
2557  { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
2558 #line 2559 "lwin_wkt_parse.c"
2559  break;
2560 
2561  case 90: /* curve_list: curve_list COMMA_TOK linestring */
2562 #line 420 "lwin_wkt_parse.y"
2563  { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
2564 #line 2565 "lwin_wkt_parse.c"
2565  break;
2566 
2567  case 91: /* curve_list: curve_list COMMA_TOK linestring_untagged */
2568 #line 422 "lwin_wkt_parse.y"
2569  { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
2570 #line 2571 "lwin_wkt_parse.c"
2571  break;
2572 
2573  case 92: /* curve_list: circularstring */
2574 #line 424 "lwin_wkt_parse.y"
2575  { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
2576 #line 2577 "lwin_wkt_parse.c"
2577  break;
2578 
2579  case 93: /* curve_list: compoundcurve */
2580 #line 426 "lwin_wkt_parse.y"
2581  { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
2582 #line 2583 "lwin_wkt_parse.c"
2583  break;
2584 
2585  case 94: /* curve_list: linestring */
2586 #line 428 "lwin_wkt_parse.y"
2587  { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
2588 #line 2589 "lwin_wkt_parse.c"
2589  break;
2590 
2591  case 95: /* curve_list: linestring_untagged */
2592 #line 430 "lwin_wkt_parse.y"
2593  { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
2594 #line 2595 "lwin_wkt_parse.c"
2595  break;
2596 
2597  case 96: /* multilinestring: MLINESTRING_TOK LBRACKET_TOK linestring_list RBRACKET_TOK */
2598 #line 434 "lwin_wkt_parse.y"
2599  { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTILINETYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); }
2600 #line 2601 "lwin_wkt_parse.c"
2601  break;
2602 
2603  case 97: /* multilinestring: MLINESTRING_TOK DIMENSIONALITY_TOK LBRACKET_TOK linestring_list RBRACKET_TOK */
2604 #line 436 "lwin_wkt_parse.y"
2605  { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTILINETYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
2606 #line 2607 "lwin_wkt_parse.c"
2607  break;
2608 
2609  case 98: /* multilinestring: MLINESTRING_TOK DIMENSIONALITY_TOK EMPTY_TOK */
2610 #line 438 "lwin_wkt_parse.y"
2611  { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTILINETYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
2612 #line 2613 "lwin_wkt_parse.c"
2613  break;
2614 
2615  case 99: /* multilinestring: MLINESTRING_TOK EMPTY_TOK */
2616 #line 440 "lwin_wkt_parse.y"
2618 #line 2619 "lwin_wkt_parse.c"
2619  break;
2620 
2621  case 100: /* linestring_list: linestring_list COMMA_TOK linestring_untagged */
2622 #line 444 "lwin_wkt_parse.y"
2623  { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
2624 #line 2625 "lwin_wkt_parse.c"
2625  break;
2626 
2627  case 101: /* linestring_list: linestring_untagged */
2628 #line 446 "lwin_wkt_parse.y"
2629  { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
2630 #line 2631 "lwin_wkt_parse.c"
2631  break;
2632 
2633  case 102: /* circularstring: CIRCULARSTRING_TOK LBRACKET_TOK ptarray RBRACKET_TOK */
2634 #line 450 "lwin_wkt_parse.y"
2635  { (yyval.geometryvalue) = wkt_parser_circularstring_new((yyvsp[-1].ptarrayvalue), NULL); WKT_ERROR(); }
2636 #line 2637 "lwin_wkt_parse.c"
2637  break;
2638 
2639  case 103: /* circularstring: CIRCULARSTRING_TOK DIMENSIONALITY_TOK LBRACKET_TOK ptarray RBRACKET_TOK */
2640 #line 452 "lwin_wkt_parse.y"
2641  { (yyval.geometryvalue) = wkt_parser_circularstring_new((yyvsp[-1].ptarrayvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
2642 #line 2643 "lwin_wkt_parse.c"
2643  break;
2644 
2645  case 104: /* circularstring: CIRCULARSTRING_TOK DIMENSIONALITY_TOK EMPTY_TOK */
2646 #line 454 "lwin_wkt_parse.y"
2647  { (yyval.geometryvalue) = wkt_parser_circularstring_new(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
2648 #line 2649 "lwin_wkt_parse.c"
2649  break;
2650 
2651  case 105: /* circularstring: CIRCULARSTRING_TOK EMPTY_TOK */
2652 #line 456 "lwin_wkt_parse.y"
2653  { (yyval.geometryvalue) = wkt_parser_circularstring_new(NULL, NULL); WKT_ERROR(); }
2654 #line 2655 "lwin_wkt_parse.c"
2655  break;
2656 
2657  case 106: /* linestring: LINESTRING_TOK LBRACKET_TOK ptarray RBRACKET_TOK */
2658 #line 460 "lwin_wkt_parse.y"
2659  { (yyval.geometryvalue) = wkt_parser_linestring_new((yyvsp[-1].ptarrayvalue), NULL); WKT_ERROR(); }
2660 #line 2661 "lwin_wkt_parse.c"
2661  break;
2662 
2663  case 107: /* linestring: LINESTRING_TOK DIMENSIONALITY_TOK LBRACKET_TOK ptarray RBRACKET_TOK */
2664 #line 462 "lwin_wkt_parse.y"
2665  { (yyval.geometryvalue) = wkt_parser_linestring_new((yyvsp[-1].ptarrayvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
2666 #line 2667 "lwin_wkt_parse.c"
2667  break;
2668 
2669  case 108: /* linestring: LINESTRING_TOK DIMENSIONALITY_TOK EMPTY_TOK */
2670 #line 464 "lwin_wkt_parse.y"
2671  { (yyval.geometryvalue) = wkt_parser_linestring_new(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
2672 #line 2673 "lwin_wkt_parse.c"
2673  break;
2674 
2675  case 109: /* linestring: LINESTRING_TOK EMPTY_TOK */
2676 #line 466 "lwin_wkt_parse.y"
2677  { (yyval.geometryvalue) = wkt_parser_linestring_new(NULL, NULL); WKT_ERROR(); }
2678 #line 2679 "lwin_wkt_parse.c"
2679  break;
2680 
2681  case 110: /* linestring_untagged: LBRACKET_TOK ptarray RBRACKET_TOK */
2682 #line 470 "lwin_wkt_parse.y"
2683  { (yyval.geometryvalue) = wkt_parser_linestring_new((yyvsp[-1].ptarrayvalue), NULL); WKT_ERROR(); }
2684 #line 2685 "lwin_wkt_parse.c"
2685  break;
2686 
2687  case 111: /* linestring_untagged: EMPTY_TOK */
2688 #line 472 "lwin_wkt_parse.y"
2689  { (yyval.geometryvalue) = wkt_parser_linestring_new(NULL, NULL); WKT_ERROR(); }
2690 #line 2691 "lwin_wkt_parse.c"
2691  break;
2692 
2693  case 112: /* triangle_list: triangle_list COMMA_TOK triangle_untagged */
2694 #line 476 "lwin_wkt_parse.y"
2695  { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
2696 #line 2697 "lwin_wkt_parse.c"
2697  break;
2698 
2699  case 113: /* triangle_list: triangle_untagged */
2700 #line 478 "lwin_wkt_parse.y"
2701  { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
2702 #line 2703 "lwin_wkt_parse.c"
2703  break;
2704 
2705  case 114: /* triangle: TRIANGLE_TOK LBRACKET_TOK LBRACKET_TOK ptarray RBRACKET_TOK RBRACKET_TOK */
2706 #line 482 "lwin_wkt_parse.y"
2707  { (yyval.geometryvalue) = wkt_parser_triangle_new((yyvsp[-2].ptarrayvalue), NULL); WKT_ERROR(); }
2708 #line 2709 "lwin_wkt_parse.c"
2709  break;
2710 
2711  case 115: /* triangle: TRIANGLE_TOK DIMENSIONALITY_TOK LBRACKET_TOK LBRACKET_TOK ptarray RBRACKET_TOK RBRACKET_TOK */
2712 #line 484 "lwin_wkt_parse.y"
2713  { (yyval.geometryvalue) = wkt_parser_triangle_new((yyvsp[-2].ptarrayvalue), (yyvsp[-5].stringvalue)); WKT_ERROR(); }
2714 #line 2715 "lwin_wkt_parse.c"
2715  break;
2716 
2717  case 116: /* triangle: TRIANGLE_TOK DIMENSIONALITY_TOK EMPTY_TOK */
2718 #line 486 "lwin_wkt_parse.y"
2719  { (yyval.geometryvalue) = wkt_parser_triangle_new(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
2720 #line 2721 "lwin_wkt_parse.c"
2721  break;
2722 
2723  case 117: /* triangle: TRIANGLE_TOK EMPTY_TOK */
2724 #line 488 "lwin_wkt_parse.y"
2725  { (yyval.geometryvalue) = wkt_parser_triangle_new(NULL, NULL); WKT_ERROR(); }
2726 #line 2727 "lwin_wkt_parse.c"
2727  break;
2728 
2729  case 118: /* triangle_untagged: LBRACKET_TOK LBRACKET_TOK ptarray RBRACKET_TOK RBRACKET_TOK */
2730 #line 492 "lwin_wkt_parse.y"
2731  { (yyval.geometryvalue) = wkt_parser_triangle_new((yyvsp[-2].ptarrayvalue), NULL); WKT_ERROR(); }
2732 #line 2733 "lwin_wkt_parse.c"
2733  break;
2734 
2735  case 119: /* multipoint: MPOINT_TOK LBRACKET_TOK point_list RBRACKET_TOK */
2736 #line 496 "lwin_wkt_parse.y"
2737  { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOINTTYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); }
2738 #line 2739 "lwin_wkt_parse.c"
2739  break;
2740 
2741  case 120: /* multipoint: MPOINT_TOK DIMENSIONALITY_TOK LBRACKET_TOK point_list RBRACKET_TOK */
2742 #line 498 "lwin_wkt_parse.y"
2743  { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOINTTYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
2744 #line 2745 "lwin_wkt_parse.c"
2745  break;
2746 
2747  case 121: /* multipoint: MPOINT_TOK DIMENSIONALITY_TOK EMPTY_TOK */
2748 #line 500 "lwin_wkt_parse.y"
2749  { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOINTTYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
2750 #line 2751 "lwin_wkt_parse.c"
2751  break;
2752 
2753  case 122: /* multipoint: MPOINT_TOK EMPTY_TOK */
2754 #line 502 "lwin_wkt_parse.y"
2756 #line 2757 "lwin_wkt_parse.c"
2757  break;
2758 
2759  case 123: /* point_list: point_list COMMA_TOK point_untagged */
2760 #line 506 "lwin_wkt_parse.y"
2761  { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
2762 #line 2763 "lwin_wkt_parse.c"
2763  break;
2764 
2765  case 124: /* point_list: point_untagged */
2766 #line 508 "lwin_wkt_parse.y"
2767  { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
2768 #line 2769 "lwin_wkt_parse.c"
2769  break;
2770 
2771  case 125: /* point_untagged: coordinate */
2772 #line 512 "lwin_wkt_parse.y"
2773  { (yyval.geometryvalue) = wkt_parser_point_new(wkt_parser_ptarray_new((yyvsp[0].coordinatevalue)),NULL); WKT_ERROR(); }
2774 #line 2775 "lwin_wkt_parse.c"
2775  break;
2776 
2777  case 126: /* point_untagged: LBRACKET_TOK coordinate RBRACKET_TOK */
2778 #line 514 "lwin_wkt_parse.y"
2779  { (yyval.geometryvalue) = wkt_parser_point_new(wkt_parser_ptarray_new((yyvsp[-1].coordinatevalue)),NULL); WKT_ERROR(); }
2780 #line 2781 "lwin_wkt_parse.c"
2781  break;
2782 
2783  case 127: /* point_untagged: EMPTY_TOK */
2784 #line 516 "lwin_wkt_parse.y"
2785  { (yyval.geometryvalue) = wkt_parser_point_new(NULL, NULL); WKT_ERROR(); }
2786 #line 2787 "lwin_wkt_parse.c"
2787  break;
2788 
2789  case 128: /* point: POINT_TOK LBRACKET_TOK ptarray RBRACKET_TOK */
2790 #line 520 "lwin_wkt_parse.y"
2791  { (yyval.geometryvalue) = wkt_parser_point_new((yyvsp[-1].ptarrayvalue), NULL); WKT_ERROR(); }
2792 #line 2793 "lwin_wkt_parse.c"
2793  break;
2794 
2795  case 129: /* point: POINT_TOK DIMENSIONALITY_TOK LBRACKET_TOK ptarray RBRACKET_TOK */
2796 #line 522 "lwin_wkt_parse.y"
2797  { (yyval.geometryvalue) = wkt_parser_point_new((yyvsp[-1].ptarrayvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
2798 #line 2799 "lwin_wkt_parse.c"
2799  break;
2800 
2801  case 130: /* point: POINT_TOK DIMENSIONALITY_TOK EMPTY_TOK */
2802 #line 524 "lwin_wkt_parse.y"
2803  { (yyval.geometryvalue) = wkt_parser_point_new(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
2804 #line 2805 "lwin_wkt_parse.c"
2805  break;
2806 
2807  case 131: /* point: POINT_TOK EMPTY_TOK */
2808 #line 526 "lwin_wkt_parse.y"
2809  { (yyval.geometryvalue) = wkt_parser_point_new(NULL,NULL); WKT_ERROR(); }
2810 #line 2811 "lwin_wkt_parse.c"
2811  break;
2812 
2813  case 132: /* ptarray: ptarray COMMA_TOK coordinate */
2814 #line 530 "lwin_wkt_parse.y"
2815  { (yyval.ptarrayvalue) = wkt_parser_ptarray_add_coord((yyvsp[-2].ptarrayvalue), (yyvsp[0].coordinatevalue)); WKT_ERROR(); }
2816 #line 2817 "lwin_wkt_parse.c"
2817  break;
2818 
2819  case 133: /* ptarray: coordinate */
2820 #line 532 "lwin_wkt_parse.y"
2821  { (yyval.ptarrayvalue) = wkt_parser_ptarray_new((yyvsp[0].coordinatevalue)); WKT_ERROR(); }
2822 #line 2823 "lwin_wkt_parse.c"
2823  break;
2824 
2825  case 134: /* coordinate: DOUBLE_TOK DOUBLE_TOK */
2826 #line 536 "lwin_wkt_parse.y"
2827  { (yyval.coordinatevalue) = wkt_parser_coord_2((yyvsp[-1].doublevalue), (yyvsp[0].doublevalue)); WKT_ERROR(); }
2828 #line 2829 "lwin_wkt_parse.c"
2829  break;
2830 
2831  case 135: /* coordinate: DOUBLE_TOK DOUBLE_TOK DOUBLE_TOK */
2832 #line 538 "lwin_wkt_parse.y"
2833  { (yyval.coordinatevalue) = wkt_parser_coord_3((yyvsp[-2].doublevalue), (yyvsp[-1].doublevalue), (yyvsp[0].doublevalue)); WKT_ERROR(); }
2834 #line 2835 "lwin_wkt_parse.c"
2835  break;
2836 
2837  case 136: /* coordinate: DOUBLE_TOK DOUBLE_TOK DOUBLE_TOK DOUBLE_TOK */
2838 #line 540 "lwin_wkt_parse.y"
2839  { (yyval.coordinatevalue) = wkt_parser_coord_4((yyvsp[-3].doublevalue), (yyvsp[-2].doublevalue), (yyvsp[-1].doublevalue), (yyvsp[0].doublevalue)); WKT_ERROR(); }
2840 #line 2841 "lwin_wkt_parse.c"
2841  break;
2842 
2843 
2844 #line 2845 "lwin_wkt_parse.c"
2845 
2846  default: break;
2847  }
2848  /* User semantic actions sometimes alter yychar, and that requires
2849  that yytoken be updated with the new translation. We take the
2850  approach of translating immediately before every use of yytoken.
2851  One alternative is translating here after every semantic action,
2852  but that translation would be missed if the semantic action invokes
2853  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2854  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2855  incorrect destructor might then be invoked immediately. In the
2856  case of YYERROR or YYBACKUP, subsequent parser actions might lead
2857  to an incorrect destructor call or verbose syntax error message
2858  before the lookahead is translated. */
2859  YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
2860 
2861  YYPOPSTACK (yylen);
2862  yylen = 0;
2863 
2864  *++yyvsp = yyval;
2865  *++yylsp = yyloc;
2866 
2867  /* Now 'shift' the result of the reduction. Determine what state
2868  that goes to, based on the state we popped back to and the rule
2869  number reduced by. */
2870  {
2871  const int yylhs = yyr1[yyn] - YYNTOKENS;
2872  const int yyi = yypgoto[yylhs] + *yyssp;
2873  yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
2874  ? yytable[yyi]
2875  : yydefgoto[yylhs]);
2876  }
2877 
2878  goto yynewstate;
2879 
2880 
2881 /*--------------------------------------.
2882 | yyerrlab -- here on detecting error. |
2883 `--------------------------------------*/
2884 yyerrlab:
2885  /* Make sure we have latest lookahead translation. See comments at
2886  user semantic actions for why this is necessary. */
2887  yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
2888  /* If not already recovering from an error, report this error. */
2889  if (!yyerrstatus)
2890  {
2891  ++yynerrs;
2892  {
2893  yypcontext_t yyctx
2894  = {yyssp, yytoken, &yylloc};
2895  char const *yymsgp = YY_("syntax error");
2896  int yysyntax_error_status;
2897  yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
2898  if (yysyntax_error_status == 0)
2899  yymsgp = yymsg;
2900  else if (yysyntax_error_status == -1)
2901  {
2902  if (yymsg != yymsgbuf)
2903  YYSTACK_FREE (yymsg);
2904  yymsg = YY_CAST (char *,
2905  YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
2906  if (yymsg)
2907  {
2908  yysyntax_error_status
2909  = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
2910  yymsgp = yymsg;
2911  }
2912  else
2913  {
2914  yymsg = yymsgbuf;
2915  yymsg_alloc = sizeof yymsgbuf;
2916  yysyntax_error_status = YYENOMEM;
2917  }
2918  }
2919  yyerror (yymsgp);
2920  if (yysyntax_error_status == YYENOMEM)
2921  YYNOMEM;
2922  }
2923  }
2924 
2925  yyerror_range[1] = yylloc;
2926  if (yyerrstatus == 3)
2927  {
2928  /* If just tried and failed to reuse lookahead token after an
2929  error, discard it. */
2930 
2931  if (yychar <= YYEOF)
2932  {
2933  /* Return failure if at end of input. */
2934  if (yychar == YYEOF)
2935  YYABORT;
2936  }
2937  else
2938  {
2939  yydestruct ("Error: discarding",
2940  yytoken, &yylval, &yylloc);
2941  yychar = YYEMPTY;
2942  }
2943  }
2944 
2945  /* Else will try to reuse lookahead token after shifting the error
2946  token. */
2947  goto yyerrlab1;
2948 
2949 
2950 /*---------------------------------------------------.
2951 | yyerrorlab -- error raised explicitly by YYERROR. |
2952 `---------------------------------------------------*/
2953 yyerrorlab:
2954  /* Pacify compilers when the user code never invokes YYERROR and the
2955  label yyerrorlab therefore never appears in user code. */
2956  if (0)
2957  YYERROR;
2958  ++yynerrs;
2959 
2960  /* Do not reclaim the symbols of the rule whose action triggered
2961  this YYERROR. */
2962  YYPOPSTACK (yylen);
2963  yylen = 0;
2964  YY_STACK_PRINT (yyss, yyssp);
2965  yystate = *yyssp;
2966  goto yyerrlab1;
2967 
2968 
2969 /*-------------------------------------------------------------.
2970 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2971 `-------------------------------------------------------------*/
2972 yyerrlab1:
2973  yyerrstatus = 3; /* Each real token shifted decrements this. */
2974 
2975  /* Pop stack until we find a state that shifts the error token. */
2976  for (;;)
2977  {
2978  yyn = yypact[yystate];
2979  if (!yypact_value_is_default (yyn))
2980  {
2981  yyn += YYSYMBOL_YYerror;
2982  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
2983  {
2984  yyn = yytable[yyn];
2985  if (0 < yyn)
2986  break;
2987  }
2988  }
2989 
2990  /* Pop the current state because it cannot handle the error token. */
2991  if (yyssp == yyss)
2992  YYABORT;
2993 
2994  yyerror_range[1] = *yylsp;
2995  yydestruct ("Error: popping",
2996  YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp);
2997  YYPOPSTACK (1);
2998  yystate = *yyssp;
2999  YY_STACK_PRINT (yyss, yyssp);
3000  }
3001 
3003  *++yyvsp = yylval;
3005 
3006  yyerror_range[2] = yylloc;
3007  ++yylsp;
3008  YYLLOC_DEFAULT (*yylsp, yyerror_range, 2);
3009 
3010  /* Shift the error token. */
3011  YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
3012 
3013  yystate = yyn;
3014  goto yynewstate;
3015 
3016 
3017 /*-------------------------------------.
3018 | yyacceptlab -- YYACCEPT comes here. |
3019 `-------------------------------------*/
3020 yyacceptlab:
3021  yyresult = 0;
3022  goto yyreturnlab;
3023 
3024 
3025 /*-----------------------------------.
3026 | yyabortlab -- YYABORT comes here. |
3027 `-----------------------------------*/
3028 yyabortlab:
3029  yyresult = 1;
3030  goto yyreturnlab;
3031 
3032 
3033 /*-----------------------------------------------------------.
3034 | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
3035 `-----------------------------------------------------------*/
3036 yyexhaustedlab:
3037  yyerror (YY_("memory exhausted"));
3038  yyresult = 2;
3039  goto yyreturnlab;
3040 
3041 
3042 /*----------------------------------------------------------.
3043 | yyreturnlab -- parsing is finished, clean up and return. |
3044 `----------------------------------------------------------*/
3045 yyreturnlab:
3046  if (yychar != YYEMPTY)
3047  {
3048  /* Make sure we have latest lookahead translation. See comments at
3049  user semantic actions for why this is necessary. */
3050  yytoken = YYTRANSLATE (yychar);
3051  yydestruct ("Cleanup: discarding lookahead",
3052  yytoken, &yylval, &yylloc);
3053  }
3054  /* Do not reclaim the symbols of the rule whose action triggered
3055  this YYABORT or YYACCEPT. */
3056  YYPOPSTACK (yylen);
3057  YY_STACK_PRINT (yyss, yyssp);
3058  while (yyssp != yyss)
3059  {
3060  yydestruct ("Cleanup: popping",
3061  YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp);
3062  YYPOPSTACK (1);
3063  }
3064 #ifndef yyoverflow
3065  if (yyss != yyssa)
3066  YYSTACK_FREE (yyss);
3067 #endif
3068  if (yymsg != yymsgbuf)
3069  YYSTACK_FREE (yymsg);
3070  return yyresult;
3071 }
3072 
3073 #line 542 "lwin_wkt_parse.y"
3074 
3075 
#define COLLECTIONTYPE
Definition: liblwgeom.h:108
#define LW_FAILURE
Definition: liblwgeom.h:96
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1218
#define MULTILINETYPE
Definition: liblwgeom.h:106
#define MULTISURFACETYPE
Definition: liblwgeom.h:113
#define LW_SUCCESS
Definition: liblwgeom.h:97
void lwgeom_parser_result_init(LWGEOM_PARSER_RESULT *parser_result)
Definition: lwin_wkt.c:915
#define MULTIPOINTTYPE
Definition: liblwgeom.h:105
#define PARSER_ERROR_OTHER
Definition: liblwgeom.h:2178
#define TINTYPE
Definition: liblwgeom.h:116
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:107
#define __attribute__(x)
Definition: liblwgeom.h:228
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:114
void ptarray_free(POINTARRAY *pa)
Definition: ptarray.c:327
#define MULTICURVETYPE
Definition: liblwgeom.h:112
#define SRID_UNKNOWN
Unknown SRID value.
Definition: liblwgeom.h:215
#define str(s)
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:106
LWGEOM * wkt_parser_circularstring_new(POINTARRAY *pa, char *dimensionality)
Create a new circularstring.
Definition: lwin_wkt.c:388
LWGEOM * wkt_parser_collection_finalize(int lwtype, LWGEOM *geom, char *dimensionality)
Definition: lwin_wkt.c:840
LWGEOM * wkt_parser_triangle_new(POINTARRAY *pa, char *dimensionality)
Definition: lwin_wkt.c:424
LWGEOM * wkt_parser_polygon_finalize(LWGEOM *poly, char *dimensionality)
Definition: lwin_wkt.c:535
LWGEOM * wkt_parser_collection_add_geom(LWGEOM *col, LWGEOM *geom)
Definition: lwin_wkt.c:826
POINT wkt_parser_coord_2(double c1, double c2)
Build a 2d coordinate.
Definition: lwin_wkt.c:221
LWGEOM * wkt_parser_polygon_add_ring(LWGEOM *poly, POINTARRAY *pa, char dimcheck)
Definition: lwin_wkt.c:485
POINT wkt_parser_coord_4(double c1, double c2, double c3, double c4)
Definition: lwin_wkt.c:252
LWGEOM * wkt_parser_compound_finalize(LWGEOM *compound, char *dimensionality)
Definition: lwin_wkt.c:791
const char * parser_error_messages[]
Definition: lwin_wkt.c:37
LWGEOM * wkt_parser_compound_add_geom(LWGEOM *col, LWGEOM *geom)
Definition: lwin_wkt.c:759
LWGEOM * wkt_parser_curvepolygon_new(LWGEOM *ring)
Definition: lwin_wkt.c:567
POINTARRAY * wkt_parser_ptarray_new(POINT p)
Start a point array from the first coordinate.
Definition: lwin_wkt.c:303
LWGEOM * wkt_parser_curvepolygon_add_ring(LWGEOM *poly, LWGEOM *ring)
Definition: lwin_wkt.c:585
LWGEOM * wkt_parser_compound_new(LWGEOM *geom)
Definition: lwin_wkt.c:724
POINT wkt_parser_coord_3(double c1, double c2, double c3)
Note, if this is an XYM coordinate we'll have to fix it later when we build the object itself and hav...
Definition: lwin_wkt.c:237
LWGEOM * wkt_parser_point_new(POINTARRAY *pa, char *dimensionality)
Create a new point.
Definition: lwin_wkt.c:320
LWGEOM * wkt_parser_curvepolygon_finalize(LWGEOM *poly, char *dimensionality)
Definition: lwin_wkt.c:666
LWGEOM * wkt_parser_collection_new(LWGEOM *geom)
Definition: lwin_wkt.c:698
LWGEOM * wkt_parser_linestring_new(POINTARRAY *pa, char *dimensionality)
Create a new linestring.
Definition: lwin_wkt.c:354
POINTARRAY * wkt_parser_ptarray_add_coord(POINTARRAY *pa, POINT p)
Definition: lwin_wkt.c:265
void wkt_parser_geometry_new(LWGEOM *geom, int32_t srid)
Definition: lwin_wkt.c:895
LWGEOM * wkt_parser_polygon_new(POINTARRAY *pa, char dimcheck)
Definition: lwin_wkt.c:460
void wkt_lexer_close(void)
int wkt_yylex_destroy(void)
void wkt_lexer_init(char *str)
static const char * yysymbol_name(yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED
static YYPTRDIFF_T yystrlen(const char *yystr)
#define yylloc
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YYMAXDEPTH
#define YYSTACK_FREE
static const yytype_int8 yytranslate[]
yysymbol_kind_t
@ YYSYMBOL_polyhedralsurface
@ YYSYMBOL_curvering_list
@ YYSYMBOL_linestring_untagged
@ YYSYMBOL_geometry_list
@ YYSYMBOL_coordinate
@ YYSYMBOL_COMPOUNDCURVE_TOK
@ YYSYMBOL_point_list
@ YYSYMBOL_multicurve
@ YYSYMBOL_YYUNDEF
@ YYSYMBOL_circularstring
@ YYSYMBOL_DOUBLE_TOK
@ YYSYMBOL_MLINESTRING_TOK
@ YYSYMBOL_patchring_list
@ YYSYMBOL_triangle_list
@ YYSYMBOL_MSURFACE_TOK
@ YYSYMBOL_YYerror
@ YYSYMBOL_multilinestring
@ YYSYMBOL_polygon_untagged
@ YYSYMBOL_patch_list
@ YYSYMBOL_multipolygon
@ YYSYMBOL_MPOINT_TOK
@ YYSYMBOL_POLYGON_TOK
@ YYSYMBOL_CIRCULARSTRING_TOK
@ YYSYMBOL_multisurface
@ YYSYMBOL_ring
@ YYSYMBOL_EMPTY_TOK
@ YYSYMBOL_MPOLYGON_TOK
@ YYSYMBOL_COLLECTION_TOK
@ YYSYMBOL_patchring
@ YYSYMBOL_POINT_TOK
@ YYSYMBOL_ring_list
@ YYSYMBOL_polygon_list
@ YYSYMBOL_curve_list
@ YYSYMBOL_compound_list
@ YYSYMBOL_RBRACKET_TOK
@ YYSYMBOL_point_untagged
@ YYSYMBOL_COMMA_TOK
@ YYSYMBOL_triangle_untagged
@ YYSYMBOL_POLYHEDRALSURFACE_TOK
@ YYSYMBOL_MCURVE_TOK
@ YYSYMBOL_curvepolygon
@ YYSYMBOL_TRIANGLE_TOK
@ YYSYMBOL_multipoint
@ YYSYMBOL_DIMENSIONALITY_TOK
@ YYSYMBOL_YYACCEPT
@ YYSYMBOL_compoundcurve
@ YYSYMBOL_tin
@ YYSYMBOL_YYEOF
@ YYSYMBOL_curvering
@ YYSYMBOL_patch
@ YYSYMBOL_LBRACKET_TOK
@ YYSYMBOL_YYEMPTY
@ YYSYMBOL_geometry
@ YYSYMBOL_TIN_TOK
@ YYSYMBOL_LINESTRING_TOK
@ YYSYMBOL_linestring_list
@ YYSYMBOL_ptarray
@ YYSYMBOL_surface_list
@ YYSYMBOL_SEMICOLON_TOK
@ YYSYMBOL_SRID_TOK
@ YYSYMBOL_geometrycollection
@ YYSYMBOL_linestring
@ YYSYMBOL_polygon
@ YYSYMBOL_geometry_no_srid
@ YYSYMBOL_triangle
@ YYSYMBOL_point
@ YYSYMBOL_CURVEPOLYGON_TOK
#define YY_ASSERT(E)
#define YY_(Msgid)
#define WKT_ERROR()
#define YYNOMEM
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
#define YYNSTATES
#define YY_IGNORE_USELESS_CAST_END
short yytype_int16
#define yychar
#define YYABORT
#define YYSTACK_BYTES(N)
yytype_int16 yy_state_t
#define YYLLOC_DEFAULT(Current, Rhs, N)
static void yydestruct(const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
int lwgeom_parse_wkt(LWGEOM_PARSER_RESULT *parser_result, char *wktstr, int parser_check_flags)
Parse a WKT geometry string into an LWGEOM structure.
#define YY_REDUCE_PRINT(Rule)
#define YY_CAST(Type, Val)
static const yytype_int16 yypact[]
#define yylex
#define YYCASE_(N, S)
static const yytype_uint8 yydefgoto[]
#define YY_NULLPTR
void * malloc(YYSIZE_T)
#define YYFINAL
#define YY_ACCESSING_SYMBOL(State)
Accessing symbol of state STATE.
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
static const yytype_int16 yypgoto[]
static YYPTRDIFF_T yytnamerr(char *yyres, const char *yystr)
#define yylval
#define YYNTOKENS
unsigned char yytype_uint8
static char * yystpcpy(char *yydest, const char *yysrc)
#define YY_STACK_PRINT(Bottom, Top)
#define YYSIZE_T
#define YYSTACK_ALLOC_MAXIMUM
void wkt_yyerror(const char *str)
#define yydebug
#define YY_IGNORE_USELESS_CAST_BEGIN
static const yytype_int8 yyr2[]
#define YYPTRDIFF_T
#define yynerrs
int wkt_yylex(void)
int wkt_yydebug
#define yyparse
static const yytype_int16 yytable[]
#define YYACCEPT
#define yytable_value_is_error(Yyn)
#define YYTRANSLATE(YYX)
static const yytype_int8 yystos[]
int wkt_yyparse(void)
#define YY_ATTRIBUTE_UNUSED
static const char *const yytname[]
static int yypcontext_expected_tokens(const yypcontext_t *yyctx, yysymbol_kind_t yyarg[], int yyargn)
static const yytype_int8 yyr1[]
#define YYPOPSTACK(N)
int yy_state_fast_t
unsigned short yytype_uint16
@ YYENOMEM
#define YYLAST
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
#define yypact_value_is_default(Yyn)
#define YYINITDEPTH
static int yy_syntax_error_arguments(const yypcontext_t *yyctx, yysymbol_kind_t yyarg[], int yyargn)
signed char yytype_int8
void free(void *)
#define YYERROR
LWGEOM_PARSER_RESULT global_parser_result
#define YYSIZEOF(X)
#define YYSTACK_ALLOC
#define YYDPRINTF(Args)
static const yytype_uint8 yydefact[]
static const yytype_uint8 yycheck[]
#define YY_USE(E)
#define yyerror
static int yysyntax_error(YYPTRDIFF_T *yymsg_alloc, char **yymsg, const yypcontext_t *yyctx)
@ YYEOF
@ YYerror
@ YYEMPTY
@ YYUNDEF
YYLTYPE wkt_yylloc
tuple res
Definition: window.py:79
int first_column
int first_line
int last_column
Parser result structure: returns the result of attempting to convert (E)WKT/(E)WKB to LWGEOM.
Definition: liblwgeom.h:2154
YYLTYPE * yylloc
yysymbol_kind_t yytoken
yy_state_t * yyssp
POINTARRAY * ptarrayvalue
LWGEOM * geometryvalue
char * stringvalue
double doublevalue
POINT coordinatevalue
YYLTYPE yyls_alloc
YYSTYPE yyvs_alloc
yy_state_t yyss_alloc