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