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