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