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