~ubuntu-branches/ubuntu/trusty/postgresql-9.3/trusty-proposed

« back to all changes in this revision

Viewing changes to contrib/cube/cubeparse.c

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2016-03-31 11:04:53 UTC
  • mfrom: (1.1.11) (18.1.4 trusty-security)
  • Revision ID: package-import@ubuntu.com-20160331110453-h6xfs9f11suj3mze
Tags: 9.3.12-0ubuntu0.14.04
* New upstream bug fix release. (LP: #1564268)
  - See http://www.postgresql.org/about/news/1656/ for details.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* A Bison parser, made by GNU Bison 2.5.  */
 
1
/* A Bison parser, made by GNU Bison 3.0.2.  */
2
2
 
3
3
/* Bison implementation for Yacc-like parsers in C
4
 
   
5
 
      Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
6
 
   
 
4
 
 
5
   Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
 
6
 
7
7
   This program is free software: you can redistribute it and/or modify
8
8
   it under the terms of the GNU General Public License as published by
9
9
   the Free Software Foundation, either version 3 of the License, or
10
10
   (at your option) any later version.
11
 
   
 
11
 
12
12
   This program is distributed in the hope that it will be useful,
13
13
   but WITHOUT ANY WARRANTY; without even the implied warranty of
14
14
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
15
   GNU General Public License for more details.
16
 
   
 
16
 
17
17
   You should have received a copy of the GNU General Public License
18
18
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
19
19
 
26
26
   special exception, which will cause the skeleton and the resulting
27
27
   Bison output files to be licensed under the GNU General Public
28
28
   License without this special exception.
29
 
   
 
29
 
30
30
   This special exception was added by the Free Software Foundation in
31
31
   version 2.2 of Bison.  */
32
32
 
44
44
#define YYBISON 1
45
45
 
46
46
/* Bison version.  */
47
 
#define YYBISON_VERSION "2.5"
 
47
#define YYBISON_VERSION "3.0.2"
48
48
 
49
49
/* Skeleton name.  */
50
50
#define YYSKELETON_NAME "yacc.c"
58
58
/* Pull parsers.  */
59
59
#define YYPULL 1
60
60
 
61
 
/* Using locations.  */
62
 
#define YYLSP_NEEDED 0
63
61
 
64
62
/* Substitute the variable and function names.  */
65
63
#define yyparse         cube_yyparse
66
64
#define yylex           cube_yylex
67
65
#define yyerror         cube_yyerror
 
66
#define yydebug         cube_yydebug
 
67
#define yynerrs         cube_yynerrs
 
68
 
68
69
#define yylval          cube_yylval
69
70
#define yychar          cube_yychar
70
 
#define yydebug         cube_yydebug
71
 
#define yynerrs         cube_yynerrs
72
 
 
73
71
 
74
72
/* Copy the first part of user declarations.  */
75
 
 
76
 
/* Line 268 of yacc.c  */
77
 
#line 1 "cubeparse.y"
 
73
#line 1 "cubeparse.y" /* yacc.c:339  */
78
74
 
79
75
/* contrib/cube/cubeparse.y */
80
76
 
112
108
static NDBOX * write_point_as_box(char *s, int dim);
113
109
 
114
110
 
115
 
 
116
 
/* Line 268 of yacc.c  */
117
 
#line 118 "cubeparse.c"
118
 
 
119
 
/* Enabling traces.  */
120
 
#ifndef YYDEBUG
121
 
# define YYDEBUG 0
122
 
#endif
 
111
#line 112 "cubeparse.c" /* yacc.c:339  */
 
112
 
 
113
# ifndef YY_NULLPTR
 
114
#  if defined __cplusplus && 201103L <= __cplusplus
 
115
#   define YY_NULLPTR nullptr
 
116
#  else
 
117
#   define YY_NULLPTR 0
 
118
#  endif
 
119
# endif
123
120
 
124
121
/* Enabling verbose error messages.  */
125
122
#ifdef YYERROR_VERBOSE
129
126
# define YYERROR_VERBOSE 0
130
127
#endif
131
128
 
132
 
/* Enabling the token table.  */
133
 
#ifndef YYTOKEN_TABLE
134
 
# define YYTOKEN_TABLE 0
135
 
#endif
136
 
 
137
 
 
138
 
/* Tokens.  */
 
129
 
 
130
/* Debug traces.  */
 
131
#ifndef YYDEBUG
 
132
# define YYDEBUG 0
 
133
#endif
 
134
#if YYDEBUG
 
135
extern int cube_yydebug;
 
136
#endif
 
137
 
 
138
/* Token type.  */
139
139
#ifndef YYTOKENTYPE
140
140
# define YYTOKENTYPE
141
 
   /* Put the tokens into the symbol table, so that GDB and other debuggers
142
 
      know about them.  */
143
 
   enum yytokentype {
144
 
     CUBEFLOAT = 258,
145
 
     O_PAREN = 259,
146
 
     C_PAREN = 260,
147
 
     O_BRACKET = 261,
148
 
     C_BRACKET = 262,
149
 
     COMMA = 263
150
 
   };
 
141
  enum yytokentype
 
142
  {
 
143
    CUBEFLOAT = 258,
 
144
    O_PAREN = 259,
 
145
    C_PAREN = 260,
 
146
    O_BRACKET = 261,
 
147
    C_BRACKET = 262,
 
148
    COMMA = 263
 
149
  };
151
150
#endif
152
151
 
153
 
 
154
 
 
 
152
/* Value type.  */
155
153
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
156
154
typedef int YYSTYPE;
157
155
# define YYSTYPE_IS_TRIVIAL 1
158
 
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
159
156
# define YYSTYPE_IS_DECLARED 1
160
157
#endif
161
158
 
162
159
 
 
160
extern YYSTYPE cube_yylval;
 
161
 
 
162
int cube_yyparse (NDBOX **result);
 
163
 
 
164
 
 
165
 
163
166
/* Copy the second part of user declarations.  */
164
167
 
165
 
 
166
 
/* Line 343 of yacc.c  */
167
 
#line 168 "cubeparse.c"
 
168
#line 169 "cubeparse.c" /* yacc.c:358  */
168
169
 
169
170
#ifdef short
170
171
# undef short
178
179
 
179
180
#ifdef YYTYPE_INT8
180
181
typedef YYTYPE_INT8 yytype_int8;
181
 
#elif (defined __STDC__ || defined __C99__FUNC__ \
182
 
     || defined __cplusplus || defined _MSC_VER)
 
182
#else
183
183
typedef signed char yytype_int8;
184
 
#else
185
 
typedef short int yytype_int8;
186
184
#endif
187
185
 
188
186
#ifdef YYTYPE_UINT16
202
200
#  define YYSIZE_T __SIZE_TYPE__
203
201
# elif defined size_t
204
202
#  define YYSIZE_T size_t
205
 
# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
206
 
     || defined __cplusplus || defined _MSC_VER)
 
203
# elif ! defined YYSIZE_T
207
204
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
208
205
#  define YYSIZE_T size_t
209
206
# else
217
214
# if defined YYENABLE_NLS && YYENABLE_NLS
218
215
#  if ENABLE_NLS
219
216
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
220
 
#   define YY_(msgid) dgettext ("bison-runtime", msgid)
 
217
#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
221
218
#  endif
222
219
# endif
223
220
# ifndef YY_
224
 
#  define YY_(msgid) msgid
 
221
#  define YY_(Msgid) Msgid
 
222
# endif
 
223
#endif
 
224
 
 
225
#ifndef YY_ATTRIBUTE
 
226
# if (defined __GNUC__                                               \
 
227
      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
 
228
     || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
 
229
#  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
 
230
# else
 
231
#  define YY_ATTRIBUTE(Spec) /* empty */
 
232
# endif
 
233
#endif
 
234
 
 
235
#ifndef YY_ATTRIBUTE_PURE
 
236
# define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
 
237
#endif
 
238
 
 
239
#ifndef YY_ATTRIBUTE_UNUSED
 
240
# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
 
241
#endif
 
242
 
 
243
#if !defined _Noreturn \
 
244
     && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
 
245
# if defined _MSC_VER && 1200 <= _MSC_VER
 
246
#  define _Noreturn __declspec (noreturn)
 
247
# else
 
248
#  define _Noreturn YY_ATTRIBUTE ((__noreturn__))
225
249
# endif
226
250
#endif
227
251
 
228
252
/* Suppress unused-variable warnings by "using" E.  */
229
253
#if ! defined lint || defined __GNUC__
230
 
# define YYUSE(e) ((void) (e))
231
 
#else
232
 
# define YYUSE(e) /* empty */
233
 
#endif
234
 
 
235
 
/* Identity function, used to suppress warnings about constant conditions.  */
236
 
#ifndef lint
237
 
# define YYID(n) (n)
238
 
#else
239
 
#if (defined __STDC__ || defined __C99__FUNC__ \
240
 
     || defined __cplusplus || defined _MSC_VER)
241
 
static int
242
 
YYID (int yyi)
243
 
#else
244
 
static int
245
 
YYID (yyi)
246
 
    int yyi;
247
 
#endif
248
 
{
249
 
  return yyi;
250
 
}
251
 
#endif
 
254
# define YYUSE(E) ((void) (E))
 
255
#else
 
256
# define YYUSE(E) /* empty */
 
257
#endif
 
258
 
 
259
#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
 
260
/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
 
261
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
 
262
    _Pragma ("GCC diagnostic push") \
 
263
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
 
264
    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
 
265
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
 
266
    _Pragma ("GCC diagnostic pop")
 
267
#else
 
268
# define YY_INITIAL_VALUE(Value) Value
 
269
#endif
 
270
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
 
271
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
 
272
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
 
273
#endif
 
274
#ifndef YY_INITIAL_VALUE
 
275
# define YY_INITIAL_VALUE(Value) /* Nothing. */
 
276
#endif
 
277
 
252
278
 
253
279
#if ! defined yyoverflow || YYERROR_VERBOSE
254
280
 
267
293
#    define alloca _alloca
268
294
#   else
269
295
#    define YYSTACK_ALLOC alloca
270
 
#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
271
 
     || defined __cplusplus || defined _MSC_VER)
 
296
#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
272
297
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 
298
      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
273
299
#     ifndef EXIT_SUCCESS
274
300
#      define EXIT_SUCCESS 0
275
301
#     endif
279
305
# endif
280
306
 
281
307
# ifdef YYSTACK_ALLOC
282
 
   /* Pacify GCC's `empty if-body' warning.  */
283
 
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
 
308
   /* Pacify GCC's 'empty if-body' warning.  */
 
309
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
284
310
#  ifndef YYSTACK_ALLOC_MAXIMUM
285
311
    /* The OS might guarantee only one guard page at the bottom of the stack,
286
312
       and a page size can be as small as 4096 bytes.  So we cannot safely
296
322
#  endif
297
323
#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
298
324
       && ! ((defined YYMALLOC || defined malloc) \
299
 
             && (defined YYFREE || defined free)))
 
325
             && (defined YYFREE || defined free)))
300
326
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
301
327
#   ifndef EXIT_SUCCESS
302
328
#    define EXIT_SUCCESS 0
304
330
#  endif
305
331
#  ifndef YYMALLOC
306
332
#   define YYMALLOC malloc
307
 
#   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
308
 
     || defined __cplusplus || defined _MSC_VER)
 
333
#   if ! defined malloc && ! defined EXIT_SUCCESS
309
334
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
310
335
#   endif
311
336
#  endif
312
337
#  ifndef YYFREE
313
338
#   define YYFREE free
314
 
#   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
315
 
     || defined __cplusplus || defined _MSC_VER)
 
339
#   if ! defined free && ! defined EXIT_SUCCESS
316
340
void free (void *); /* INFRINGES ON USER NAME SPACE */
317
341
#   endif
318
342
#  endif
322
346
 
323
347
#if (! defined yyoverflow \
324
348
     && (! defined __cplusplus \
325
 
         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
 
349
         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
326
350
 
327
351
/* A type that is properly aligned for any stack member.  */
328
352
union yyalloc
347
371
   elements in the stack, and YYPTR gives the new location of the
348
372
   stack.  Advance YYPTR to a properly aligned location for the next
349
373
   stack.  */
350
 
# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
351
 
    do                                                                  \
352
 
      {                                                                 \
353
 
        YYSIZE_T yynewbytes;                                            \
354
 
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
355
 
        Stack = &yyptr->Stack_alloc;                                    \
356
 
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
357
 
        yyptr += yynewbytes / sizeof (*yyptr);                          \
358
 
      }                                                                 \
359
 
    while (YYID (0))
 
374
# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
 
375
    do                                                                  \
 
376
      {                                                                 \
 
377
        YYSIZE_T yynewbytes;                                            \
 
378
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
 
379
        Stack = &yyptr->Stack_alloc;                                    \
 
380
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
 
381
        yyptr += yynewbytes / sizeof (*yyptr);                          \
 
382
      }                                                                 \
 
383
    while (0)
360
384
 
361
385
#endif
362
386
 
363
387
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
364
 
/* Copy COUNT objects from FROM to TO.  The source and destination do
 
388
/* Copy COUNT objects from SRC to DST.  The source and destination do
365
389
   not overlap.  */
366
390
# ifndef YYCOPY
367
391
#  if defined __GNUC__ && 1 < __GNUC__
368
 
#   define YYCOPY(To, From, Count) \
369
 
      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
 
392
#   define YYCOPY(Dst, Src, Count) \
 
393
      __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
370
394
#  else
371
 
#   define YYCOPY(To, From, Count)              \
372
 
      do                                        \
373
 
        {                                       \
374
 
          YYSIZE_T yyi;                         \
375
 
          for (yyi = 0; yyi < (Count); yyi++)   \
376
 
            (To)[yyi] = (From)[yyi];            \
377
 
        }                                       \
378
 
      while (YYID (0))
 
395
#   define YYCOPY(Dst, Src, Count)              \
 
396
      do                                        \
 
397
        {                                       \
 
398
          YYSIZE_T yyi;                         \
 
399
          for (yyi = 0; yyi < (Count); yyi++)   \
 
400
            (Dst)[yyi] = (Src)[yyi];            \
 
401
        }                                       \
 
402
      while (0)
379
403
#  endif
380
404
# endif
381
405
#endif /* !YYCOPY_NEEDED */
391
415
#define YYNNTS  4
392
416
/* YYNRULES -- Number of rules.  */
393
417
#define YYNRULES  8
394
 
/* YYNRULES -- Number of states.  */
 
418
/* YYNSTATES -- Number of states.  */
395
419
#define YYNSTATES  18
396
420
 
397
 
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 
421
/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
 
422
   by yylex, with out-of-bounds checking.  */
398
423
#define YYUNDEFTOK  2
399
424
#define YYMAXUTOK   263
400
425
 
401
 
#define YYTRANSLATE(YYX)                                                \
 
426
#define YYTRANSLATE(YYX)                                                \
402
427
  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
403
428
 
404
 
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
 
429
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
 
430
   as returned by yylex, without out-of-bounds checking.  */
405
431
static const yytype_uint8 yytranslate[] =
406
432
{
407
433
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
434
460
};
435
461
 
436
462
#if YYDEBUG
437
 
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
438
 
   YYRHS.  */
439
 
static const yytype_uint8 yyprhs[] =
440
 
{
441
 
       0,     0,     3,     9,    13,    15,    17,    21,    23
442
 
};
443
 
 
444
 
/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
445
 
static const yytype_int8 yyrhs[] =
446
 
{
447
 
      10,     0,    -1,     6,    11,     8,    11,     7,    -1,    11,
448
 
       8,    11,    -1,    11,    -1,    12,    -1,     4,    12,     5,
449
 
      -1,     3,    -1,    12,     8,     3,    -1
450
 
};
451
 
 
452
 
/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 
463
  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
453
464
static const yytype_uint8 yyrline[] =
454
465
{
455
466
       0,    50,    50,    77,   103,   120,   137,   143,   149
456
467
};
457
468
#endif
458
469
 
459
 
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
 
470
#if YYDEBUG || YYERROR_VERBOSE || 0
460
471
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
461
472
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
462
473
static const char *const yytname[] =
463
474
{
464
475
  "$end", "error", "$undefined", "CUBEFLOAT", "O_PAREN", "C_PAREN",
465
476
  "O_BRACKET", "C_BRACKET", "COMMA", "$accept", "box", "paren_list",
466
 
  "list", 0
 
477
  "list", YY_NULLPTR
467
478
};
468
479
#endif
469
480
 
470
481
# ifdef YYPRINT
471
 
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
472
 
   token YYLEX-NUM.  */
 
482
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
 
483
   (internal) symbol number NUM (which must be that of a token).  */
473
484
static const yytype_uint16 yytoknum[] =
474
485
{
475
486
       0,   256,   257,   258,   259,   260,   261,   262,   263
476
487
};
477
488
# endif
478
489
 
479
 
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
480
 
static const yytype_uint8 yyr1[] =
481
 
{
482
 
       0,     9,    10,    10,    10,    10,    11,    12,    12
483
 
};
484
 
 
485
 
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
486
 
static const yytype_uint8 yyr2[] =
487
 
{
488
 
       0,     2,     5,     3,     1,     1,     3,     1,     3
489
 
};
490
 
 
491
 
/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
492
 
   Performed when YYTABLE doesn't specify something else to do.  Zero
493
 
   means the default is an error.  */
494
 
static const yytype_uint8 yydefact[] =
495
 
{
496
 
       0,     7,     0,     0,     0,     4,     5,     0,     0,     1,
497
 
       0,     0,     6,     0,     3,     8,     0,     2
498
 
};
499
 
 
500
 
/* YYDEFGOTO[NTERM-NUM].  */
501
 
static const yytype_int8 yydefgoto[] =
502
 
{
503
 
      -1,     4,     5,     6
504
 
};
505
 
 
506
 
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
507
 
   STATE-NUM.  */
508
490
#define YYPACT_NINF -4
 
491
 
 
492
#define yypact_value_is_default(Yystate) \
 
493
  (!!((Yystate) == (-4)))
 
494
 
 
495
#define YYTABLE_NINF -1
 
496
 
 
497
#define yytable_value_is_error(Yytable_value) \
 
498
  0
 
499
 
 
500
  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
 
501
     STATE-NUM.  */
509
502
static const yytype_int8 yypact[] =
510
503
{
511
504
      -2,    -4,     3,    -1,     9,     4,     5,     0,     6,    -4,
512
505
      -1,     8,    -4,    -1,    -4,    -4,    10,    -4
513
506
};
514
507
 
515
 
/* YYPGOTO[NTERM-NUM].  */
 
508
  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
 
509
     Performed when YYTABLE does not specify something else to do.  Zero
 
510
     means the default is an error.  */
 
511
static const yytype_uint8 yydefact[] =
 
512
{
 
513
       0,     7,     0,     0,     0,     4,     5,     0,     0,     1,
 
514
       0,     0,     6,     0,     3,     8,     0,     2
 
515
};
 
516
 
 
517
  /* YYPGOTO[NTERM-NUM].  */
516
518
static const yytype_int8 yypgoto[] =
517
519
{
518
520
      -4,    -4,    -3,    13
519
521
};
520
522
 
521
 
/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
522
 
   positive, shift that token.  If negative, reduce the rule which
523
 
   number is the opposite.  If YYTABLE_NINF, syntax error.  */
524
 
#define YYTABLE_NINF -1
 
523
  /* YYDEFGOTO[NTERM-NUM].  */
 
524
static const yytype_int8 yydefgoto[] =
 
525
{
 
526
      -1,     4,     5,     6
 
527
};
 
528
 
 
529
  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
 
530
     positive, shift that token.  If negative, reduce the rule whose
 
531
     number is the opposite.  If YYTABLE_NINF, syntax error.  */
525
532
static const yytype_uint8 yytable[] =
526
533
{
527
534
       8,     1,     2,     2,     3,    12,     1,    14,    11,     9,
528
535
      16,    15,    10,    11,    13,     7,     0,    17
529
536
};
530
537
 
531
 
#define yypact_value_is_default(yystate) \
532
 
  ((yystate) == (-4))
533
 
 
534
 
#define yytable_value_is_error(yytable_value) \
535
 
  YYID (0)
536
 
 
537
538
static const yytype_int8 yycheck[] =
538
539
{
539
540
       3,     3,     4,     4,     6,     5,     3,    10,     8,     0,
540
541
      13,     3,     8,     8,     8,     2,    -1,     7
541
542
};
542
543
 
543
 
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
544
 
   symbol of state STATE-NUM.  */
 
544
  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
 
545
     symbol of state STATE-NUM.  */
545
546
static const yytype_uint8 yystos[] =
546
547
{
547
548
       0,     3,     4,     6,    10,    11,    12,    12,    11,     0,
548
549
       8,     8,     5,     8,    11,     3,    11,     7
549
550
};
550
551
 
551
 
#define yyerrok         (yyerrstatus = 0)
552
 
#define yyclearin       (yychar = YYEMPTY)
553
 
#define YYEMPTY         (-2)
554
 
#define YYEOF           0
555
 
 
556
 
#define YYACCEPT        goto yyacceptlab
557
 
#define YYABORT         goto yyabortlab
558
 
#define YYERROR         goto yyerrorlab
559
 
 
560
 
 
561
 
/* Like YYERROR except do call yyerror.  This remains here temporarily
562
 
   to ease the transition to the new meaning of YYERROR, for GCC.
563
 
   Once GCC version 2 has supplanted version 1, this can go.  However,
564
 
   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
565
 
   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
566
 
   discussed.  */
567
 
 
568
 
#define YYFAIL          goto yyerrlab
569
 
#if defined YYFAIL
570
 
  /* This is here to suppress warnings from the GCC cpp's
571
 
     -Wunused-macros.  Normally we don't worry about that warning, but
572
 
     some users do, and we want to make it easy for users to remove
573
 
     YYFAIL uses, which will produce warnings from Bison 2.5.  */
574
 
#endif
 
552
  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 
553
static const yytype_uint8 yyr1[] =
 
554
{
 
555
       0,     9,    10,    10,    10,    10,    11,    12,    12
 
556
};
 
557
 
 
558
  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
 
559
static const yytype_uint8 yyr2[] =
 
560
{
 
561
       0,     2,     5,     3,     1,     1,     3,     1,     3
 
562
};
 
563
 
 
564
 
 
565
#define yyerrok         (yyerrstatus = 0)
 
566
#define yyclearin       (yychar = YYEMPTY)
 
567
#define YYEMPTY         (-2)
 
568
#define YYEOF           0
 
569
 
 
570
#define YYACCEPT        goto yyacceptlab
 
571
#define YYABORT         goto yyabortlab
 
572
#define YYERROR         goto yyerrorlab
 
573
 
575
574
 
576
575
#define YYRECOVERING()  (!!yyerrstatus)
577
576
 
578
 
#define YYBACKUP(Token, Value)                                  \
579
 
do                                                              \
580
 
  if (yychar == YYEMPTY && yylen == 1)                          \
581
 
    {                                                           \
582
 
      yychar = (Token);                                         \
583
 
      yylval = (Value);                                         \
584
 
      YYPOPSTACK (1);                                           \
585
 
      goto yybackup;                                            \
586
 
    }                                                           \
587
 
  else                                                          \
588
 
    {                                                           \
 
577
#define YYBACKUP(Token, Value)                                  \
 
578
do                                                              \
 
579
  if (yychar == YYEMPTY)                                        \
 
580
    {                                                           \
 
581
      yychar = (Token);                                         \
 
582
      yylval = (Value);                                         \
 
583
      YYPOPSTACK (yylen);                                       \
 
584
      yystate = *yyssp;                                         \
 
585
      goto yybackup;                                            \
 
586
    }                                                           \
 
587
  else                                                          \
 
588
    {                                                           \
589
589
      yyerror (result, YY_("syntax error: cannot back up")); \
590
 
      YYERROR;                                                  \
591
 
    }                                                           \
592
 
while (YYID (0))
593
 
 
594
 
 
595
 
#define YYTERROR        1
596
 
#define YYERRCODE       256
597
 
 
598
 
 
599
 
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
600
 
   If N is 0, then set CURRENT to the empty location which ends
601
 
   the previous symbol: RHS[0] (always defined).  */
602
 
 
603
 
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
604
 
#ifndef YYLLOC_DEFAULT
605
 
# define YYLLOC_DEFAULT(Current, Rhs, N)                                \
606
 
    do                                                                  \
607
 
      if (YYID (N))                                                    \
608
 
        {                                                               \
609
 
          (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
610
 
          (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
611
 
          (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
612
 
          (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
613
 
        }                                                               \
614
 
      else                                                              \
615
 
        {                                                               \
616
 
          (Current).first_line   = (Current).last_line   =              \
617
 
            YYRHSLOC (Rhs, 0).last_line;                                \
618
 
          (Current).first_column = (Current).last_column =              \
619
 
            YYRHSLOC (Rhs, 0).last_column;                              \
620
 
        }                                                               \
621
 
    while (YYID (0))
622
 
#endif
623
 
 
624
 
 
625
 
/* This macro is provided for backward compatibility. */
626
 
 
627
 
#ifndef YY_LOCATION_PRINT
628
 
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
629
 
#endif
630
 
 
631
 
 
632
 
/* YYLEX -- calling `yylex' with the right arguments.  */
633
 
 
634
 
#ifdef YYLEX_PARAM
635
 
# define YYLEX yylex (YYLEX_PARAM)
636
 
#else
637
 
# define YYLEX yylex ()
638
 
#endif
 
590
      YYERROR;                                                  \
 
591
    }                                                           \
 
592
while (0)
 
593
 
 
594
/* Error token number */
 
595
#define YYTERROR        1
 
596
#define YYERRCODE       256
 
597
 
 
598
 
639
599
 
640
600
/* Enable debugging if requested.  */
641
601
#if YYDEBUG
645
605
#  define YYFPRINTF fprintf
646
606
# endif
647
607
 
648
 
# define YYDPRINTF(Args)                        \
649
 
do {                                            \
650
 
  if (yydebug)                                  \
651
 
    YYFPRINTF Args;                             \
652
 
} while (YYID (0))
653
 
 
654
 
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
655
 
do {                                                                      \
656
 
  if (yydebug)                                                            \
657
 
    {                                                                     \
658
 
      YYFPRINTF (stderr, "%s ", Title);                                   \
659
 
      yy_symbol_print (stderr,                                            \
660
 
                  Type, Value, result); \
661
 
      YYFPRINTF (stderr, "\n");                                           \
662
 
    }                                                                     \
663
 
} while (YYID (0))
664
 
 
665
 
 
666
 
/*--------------------------------.
667
 
| Print this symbol on YYOUTPUT.  |
668
 
`--------------------------------*/
669
 
 
670
 
/*ARGSUSED*/
671
 
#if (defined __STDC__ || defined __C99__FUNC__ \
672
 
     || defined __cplusplus || defined _MSC_VER)
 
608
# define YYDPRINTF(Args)                        \
 
609
do {                                            \
 
610
  if (yydebug)                                  \
 
611
    YYFPRINTF Args;                             \
 
612
} while (0)
 
613
 
 
614
/* This macro is provided for backward compatibility. */
 
615
#ifndef YY_LOCATION_PRINT
 
616
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
 
617
#endif
 
618
 
 
619
 
 
620
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
 
621
do {                                                                      \
 
622
  if (yydebug)                                                            \
 
623
    {                                                                     \
 
624
      YYFPRINTF (stderr, "%s ", Title);                                   \
 
625
      yy_symbol_print (stderr,                                            \
 
626
                  Type, Value, result); \
 
627
      YYFPRINTF (stderr, "\n");                                           \
 
628
    }                                                                     \
 
629
} while (0)
 
630
 
 
631
 
 
632
/*----------------------------------------.
 
633
| Print this symbol's value on YYOUTPUT.  |
 
634
`----------------------------------------*/
 
635
 
673
636
static void
674
637
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, NDBOX **result)
675
 
#else
676
 
static void
677
 
yy_symbol_value_print (yyoutput, yytype, yyvaluep, result)
678
 
    FILE *yyoutput;
679
 
    int yytype;
680
 
    YYSTYPE const * const yyvaluep;
681
 
    NDBOX **result;
682
 
#endif
683
638
{
 
639
  FILE *yyo = yyoutput;
 
640
  YYUSE (yyo);
 
641
  YYUSE (result);
684
642
  if (!yyvaluep)
685
643
    return;
686
 
  YYUSE (result);
687
644
# ifdef YYPRINT
688
645
  if (yytype < YYNTOKENS)
689
646
    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
690
 
# else
691
 
  YYUSE (yyoutput);
692
647
# endif
693
 
  switch (yytype)
694
 
    {
695
 
      default:
696
 
        break;
697
 
    }
 
648
  YYUSE (yytype);
698
649
}
699
650
 
700
651
 
702
653
| Print this symbol on YYOUTPUT.  |
703
654
`--------------------------------*/
704
655
 
705
 
#if (defined __STDC__ || defined __C99__FUNC__ \
706
 
     || defined __cplusplus || defined _MSC_VER)
707
656
static void
708
657
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, NDBOX **result)
709
 
#else
710
 
static void
711
 
yy_symbol_print (yyoutput, yytype, yyvaluep, result)
712
 
    FILE *yyoutput;
713
 
    int yytype;
714
 
    YYSTYPE const * const yyvaluep;
715
 
    NDBOX **result;
716
 
#endif
717
658
{
718
 
  if (yytype < YYNTOKENS)
719
 
    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
720
 
  else
721
 
    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
 
659
  YYFPRINTF (yyoutput, "%s %s (",
 
660
             yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
722
661
 
723
662
  yy_symbol_value_print (yyoutput, yytype, yyvaluep, result);
724
663
  YYFPRINTF (yyoutput, ")");
729
668
| TOP (included).                                                   |
730
669
`------------------------------------------------------------------*/
731
670
 
732
 
#if (defined __STDC__ || defined __C99__FUNC__ \
733
 
     || defined __cplusplus || defined _MSC_VER)
734
671
static void
735
672
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
736
 
#else
737
 
static void
738
 
yy_stack_print (yybottom, yytop)
739
 
    yytype_int16 *yybottom;
740
 
    yytype_int16 *yytop;
741
 
#endif
742
673
{
743
674
  YYFPRINTF (stderr, "Stack now");
744
675
  for (; yybottom <= yytop; yybottom++)
749
680
  YYFPRINTF (stderr, "\n");
750
681
}
751
682
 
752
 
# define YY_STACK_PRINT(Bottom, Top)                            \
753
 
do {                                                            \
754
 
  if (yydebug)                                                  \
755
 
    yy_stack_print ((Bottom), (Top));                           \
756
 
} while (YYID (0))
 
683
# define YY_STACK_PRINT(Bottom, Top)                            \
 
684
do {                                                            \
 
685
  if (yydebug)                                                  \
 
686
    yy_stack_print ((Bottom), (Top));                           \
 
687
} while (0)
757
688
 
758
689
 
759
690
/*------------------------------------------------.
760
691
| Report that the YYRULE is going to be reduced.  |
761
692
`------------------------------------------------*/
762
693
 
763
 
#if (defined __STDC__ || defined __C99__FUNC__ \
764
 
     || defined __cplusplus || defined _MSC_VER)
765
 
static void
766
 
yy_reduce_print (YYSTYPE *yyvsp, int yyrule, NDBOX **result)
767
 
#else
768
 
static void
769
 
yy_reduce_print (yyvsp, yyrule, result)
770
 
    YYSTYPE *yyvsp;
771
 
    int yyrule;
772
 
    NDBOX **result;
773
 
#endif
 
694
static void
 
695
yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, NDBOX **result)
774
696
{
 
697
  unsigned long int yylno = yyrline[yyrule];
775
698
  int yynrhs = yyr2[yyrule];
776
699
  int yyi;
777
 
  unsigned long int yylno = yyrline[yyrule];
778
700
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
779
 
             yyrule - 1, yylno);
 
701
             yyrule - 1, yylno);
780
702
  /* The symbols being reduced.  */
781
703
  for (yyi = 0; yyi < yynrhs; yyi++)
782
704
    {
783
705
      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
784
 
      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
785
 
                       &(yyvsp[(yyi + 1) - (yynrhs)])
786
 
                                       , result);
 
706
      yy_symbol_print (stderr,
 
707
                       yystos[yyssp[yyi + 1 - yynrhs]],
 
708
                       &(yyvsp[(yyi + 1) - (yynrhs)])
 
709
                                              , result);
787
710
      YYFPRINTF (stderr, "\n");
788
711
    }
789
712
}
790
713
 
791
 
# define YY_REDUCE_PRINT(Rule)          \
792
 
do {                                    \
793
 
  if (yydebug)                          \
794
 
    yy_reduce_print (yyvsp, Rule, result); \
795
 
} while (YYID (0))
 
714
# define YY_REDUCE_PRINT(Rule)          \
 
715
do {                                    \
 
716
  if (yydebug)                          \
 
717
    yy_reduce_print (yyssp, yyvsp, Rule, result); \
 
718
} while (0)
796
719
 
797
720
/* Nonzero means print parse trace.  It is left uninitialized so that
798
721
   multiple parsers can coexist.  */
806
729
 
807
730
 
808
731
/* YYINITDEPTH -- initial size of the parser's stacks.  */
809
 
#ifndef YYINITDEPTH
 
732
#ifndef YYINITDEPTH
810
733
# define YYINITDEPTH 200
811
734
#endif
812
735
 
829
752
#   define yystrlen strlen
830
753
#  else
831
754
/* Return the length of YYSTR.  */
832
 
#if (defined __STDC__ || defined __C99__FUNC__ \
833
 
     || defined __cplusplus || defined _MSC_VER)
834
755
static YYSIZE_T
835
756
yystrlen (const char *yystr)
836
 
#else
837
 
static YYSIZE_T
838
 
yystrlen (yystr)
839
 
    const char *yystr;
840
 
#endif
841
757
{
842
758
  YYSIZE_T yylen;
843
759
  for (yylen = 0; yystr[yylen]; yylen++)
853
769
#  else
854
770
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
855
771
   YYDEST.  */
856
 
#if (defined __STDC__ || defined __C99__FUNC__ \
857
 
     || defined __cplusplus || defined _MSC_VER)
858
772
static char *
859
773
yystpcpy (char *yydest, const char *yysrc)
860
 
#else
861
 
static char *
862
 
yystpcpy (yydest, yysrc)
863
 
    char *yydest;
864
 
    const char *yysrc;
865
 
#endif
866
774
{
867
775
  char *yyd = yydest;
868
776
  const char *yys = yysrc;
892
800
      char const *yyp = yystr;
893
801
 
894
802
      for (;;)
895
 
        switch (*++yyp)
896
 
          {
897
 
          case '\'':
898
 
          case ',':
899
 
            goto do_not_strip_quotes;
900
 
 
901
 
          case '\\':
902
 
            if (*++yyp != '\\')
903
 
              goto do_not_strip_quotes;
904
 
            /* Fall through.  */
905
 
          default:
906
 
            if (yyres)
907
 
              yyres[yyn] = *yyp;
908
 
            yyn++;
909
 
            break;
910
 
 
911
 
          case '"':
912
 
            if (yyres)
913
 
              yyres[yyn] = '\0';
914
 
            return yyn;
915
 
          }
 
803
        switch (*++yyp)
 
804
          {
 
805
          case '\'':
 
806
          case ',':
 
807
            goto do_not_strip_quotes;
 
808
 
 
809
          case '\\':
 
810
            if (*++yyp != '\\')
 
811
              goto do_not_strip_quotes;
 
812
            /* Fall through.  */
 
813
          default:
 
814
            if (yyres)
 
815
              yyres[yyn] = *yyp;
 
816
            yyn++;
 
817
            break;
 
818
 
 
819
          case '"':
 
820
            if (yyres)
 
821
              yyres[yyn] = '\0';
 
822
            return yyn;
 
823
          }
916
824
    do_not_strip_quotes: ;
917
825
    }
918
826
 
935
843
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
936
844
                yytype_int16 *yyssp, int yytoken)
937
845
{
938
 
  YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
 
846
  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
939
847
  YYSIZE_T yysize = yysize0;
940
 
  YYSIZE_T yysize1;
941
848
  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
942
849
  /* Internationalized format string. */
943
 
  const char *yyformat = 0;
 
850
  const char *yyformat = YY_NULLPTR;
944
851
  /* Arguments of yyformat. */
945
852
  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
946
853
  /* Number of reported tokens (one for the "unexpected", one per
948
855
  int yycount = 0;
949
856
 
950
857
  /* There are many possibilities here to consider:
951
 
     - Assume YYFAIL is not used.  It's too flawed to consider.  See
952
 
       <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
953
 
       for details.  YYERROR is fine as it does not invoke this
954
 
       function.
955
858
     - If this state is a consistent state with a default action, then
956
859
       the only way this function was invoked is if the default action
957
860
       is an error action.  In that case, don't check for expected
1000
903
                    break;
1001
904
                  }
1002
905
                yyarg[yycount++] = yytname[yyx];
1003
 
                yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1004
 
                if (! (yysize <= yysize1
1005
 
                       && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1006
 
                  return 2;
1007
 
                yysize = yysize1;
 
906
                {
 
907
                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
 
908
                  if (! (yysize <= yysize1
 
909
                         && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
 
910
                    return 2;
 
911
                  yysize = yysize1;
 
912
                }
1008
913
              }
1009
914
        }
1010
915
    }
1024
929
# undef YYCASE_
1025
930
    }
1026
931
 
1027
 
  yysize1 = yysize + yystrlen (yyformat);
1028
 
  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1029
 
    return 2;
1030
 
  yysize = yysize1;
 
932
  {
 
933
    YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
 
934
    if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
 
935
      return 2;
 
936
    yysize = yysize1;
 
937
  }
1031
938
 
1032
939
  if (*yymsg_alloc < yysize)
1033
940
    {
1064
971
| Release the memory associated to this symbol.  |
1065
972
`-----------------------------------------------*/
1066
973
 
1067
 
/*ARGSUSED*/
1068
 
#if (defined __STDC__ || defined __C99__FUNC__ \
1069
 
     || defined __cplusplus || defined _MSC_VER)
1070
974
static void
1071
975
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, NDBOX **result)
1072
 
#else
1073
 
static void
1074
 
yydestruct (yymsg, yytype, yyvaluep, result)
1075
 
    const char *yymsg;
1076
 
    int yytype;
1077
 
    YYSTYPE *yyvaluep;
1078
 
    NDBOX **result;
1079
 
#endif
1080
976
{
1081
977
  YYUSE (yyvaluep);
1082
978
  YYUSE (result);
1083
 
 
1084
979
  if (!yymsg)
1085
980
    yymsg = "Deleting";
1086
981
  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1087
982
 
1088
 
  switch (yytype)
1089
 
    {
1090
 
 
1091
 
      default:
1092
 
        break;
1093
 
    }
 
983
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
 
984
  YYUSE (yytype);
 
985
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1094
986
}
1095
987
 
1096
988
 
1097
 
/* Prevent warnings from -Wmissing-prototypes.  */
1098
 
#ifdef YYPARSE_PARAM
1099
 
#if defined __STDC__ || defined __cplusplus
1100
 
int yyparse (void *YYPARSE_PARAM);
1101
 
#else
1102
 
int yyparse ();
1103
 
#endif
1104
 
#else /* ! YYPARSE_PARAM */
1105
 
#if defined __STDC__ || defined __cplusplus
1106
 
int yyparse (NDBOX **result);
1107
 
#else
1108
 
int yyparse ();
1109
 
#endif
1110
 
#endif /* ! YYPARSE_PARAM */
1111
989
 
1112
990
 
1113
991
/* The lookahead symbol.  */
1115
993
 
1116
994
/* The semantic value of the lookahead symbol.  */
1117
995
YYSTYPE yylval;
1118
 
 
1119
996
/* Number of syntax errors so far.  */
1120
997
int yynerrs;
1121
998
 
1124
1001
| yyparse.  |
1125
1002
`----------*/
1126
1003
 
1127
 
#ifdef YYPARSE_PARAM
1128
 
#if (defined __STDC__ || defined __C99__FUNC__ \
1129
 
     || defined __cplusplus || defined _MSC_VER)
1130
 
int
1131
 
yyparse (void *YYPARSE_PARAM)
1132
 
#else
1133
 
int
1134
 
yyparse (YYPARSE_PARAM)
1135
 
    void *YYPARSE_PARAM;
1136
 
#endif
1137
 
#else /* ! YYPARSE_PARAM */
1138
 
#if (defined __STDC__ || defined __C99__FUNC__ \
1139
 
     || defined __cplusplus || defined _MSC_VER)
1140
1004
int
1141
1005
yyparse (NDBOX **result)
1142
 
#else
1143
 
int
1144
 
yyparse (result)
1145
 
    NDBOX **result;
1146
 
#endif
1147
 
#endif
1148
1006
{
1149
1007
    int yystate;
1150
1008
    /* Number of tokens to shift before error messages enabled.  */
1151
1009
    int yyerrstatus;
1152
1010
 
1153
1011
    /* The stacks and their tools:
1154
 
       `yyss': related to states.
1155
 
       `yyvs': related to semantic values.
 
1012
       'yyss': related to states.
 
1013
       'yyvs': related to semantic values.
1156
1014
 
1157
 
       Refer to the stacks thru separate pointers, to allow yyoverflow
 
1015
       Refer to the stacks through separate pointers, to allow yyoverflow
1158
1016
       to reallocate them elsewhere.  */
1159
1017
 
1160
1018
    /* The state stack.  */
1172
1030
  int yyn;
1173
1031
  int yyresult;
1174
1032
  /* Lookahead token as an internal (translated) token number.  */
1175
 
  int yytoken;
 
1033
  int yytoken = 0;
1176
1034
  /* The variables used to return semantic value and location from the
1177
1035
     action routines.  */
1178
1036
  YYSTYPE yyval;
1190
1048
     Keep to zero when no symbol should be popped.  */
1191
1049
  int yylen = 0;
1192
1050
 
1193
 
  yytoken = 0;
1194
 
  yyss = yyssa;
1195
 
  yyvs = yyvsa;
 
1051
  yyssp = yyss = yyssa;
 
1052
  yyvsp = yyvs = yyvsa;
1196
1053
  yystacksize = YYINITDEPTH;
1197
1054
 
1198
1055
  YYDPRINTF ((stderr, "Starting parse\n"));
1201
1058
  yyerrstatus = 0;
1202
1059
  yynerrs = 0;
1203
1060
  yychar = YYEMPTY; /* Cause a token to be read.  */
1204
 
 
1205
 
  /* Initialize stack pointers.
1206
 
     Waste one element of value and location stack
1207
 
     so that they stay on the same level as the state stack.
1208
 
     The wasted elements are never initialized.  */
1209
 
  yyssp = yyss;
1210
 
  yyvsp = yyvs;
1211
 
 
1212
1061
  goto yysetstate;
1213
1062
 
1214
1063
/*------------------------------------------------------------.
1229
1078
 
1230
1079
#ifdef yyoverflow
1231
1080
      {
1232
 
        /* Give user a chance to reallocate the stack.  Use copies of
1233
 
           these so that the &'s don't force the real ones into
1234
 
           memory.  */
1235
 
        YYSTYPE *yyvs1 = yyvs;
1236
 
        yytype_int16 *yyss1 = yyss;
1237
 
 
1238
 
        /* Each stack pointer address is followed by the size of the
1239
 
           data in use in that stack, in bytes.  This used to be a
1240
 
           conditional around just the two extra args, but that might
1241
 
           be undefined if yyoverflow is a macro.  */
1242
 
        yyoverflow (YY_("memory exhausted"),
1243
 
                    &yyss1, yysize * sizeof (*yyssp),
1244
 
                    &yyvs1, yysize * sizeof (*yyvsp),
1245
 
                    &yystacksize);
1246
 
 
1247
 
        yyss = yyss1;
1248
 
        yyvs = yyvs1;
 
1081
        /* Give user a chance to reallocate the stack.  Use copies of
 
1082
           these so that the &'s don't force the real ones into
 
1083
           memory.  */
 
1084
        YYSTYPE *yyvs1 = yyvs;
 
1085
        yytype_int16 *yyss1 = yyss;
 
1086
 
 
1087
        /* Each stack pointer address is followed by the size of the
 
1088
           data in use in that stack, in bytes.  This used to be a
 
1089
           conditional around just the two extra args, but that might
 
1090
           be undefined if yyoverflow is a macro.  */
 
1091
        yyoverflow (YY_("memory exhausted"),
 
1092
                    &yyss1, yysize * sizeof (*yyssp),
 
1093
                    &yyvs1, yysize * sizeof (*yyvsp),
 
1094
                    &yystacksize);
 
1095
 
 
1096
        yyss = yyss1;
 
1097
        yyvs = yyvs1;
1249
1098
      }
1250
1099
#else /* no yyoverflow */
1251
1100
# ifndef YYSTACK_RELOCATE
1253
1102
# else
1254
1103
      /* Extend the stack our own way.  */
1255
1104
      if (YYMAXDEPTH <= yystacksize)
1256
 
        goto yyexhaustedlab;
 
1105
        goto yyexhaustedlab;
1257
1106
      yystacksize *= 2;
1258
1107
      if (YYMAXDEPTH < yystacksize)
1259
 
        yystacksize = YYMAXDEPTH;
 
1108
        yystacksize = YYMAXDEPTH;
1260
1109
 
1261
1110
      {
1262
 
        yytype_int16 *yyss1 = yyss;
1263
 
        union yyalloc *yyptr =
1264
 
          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1265
 
        if (! yyptr)
1266
 
          goto yyexhaustedlab;
1267
 
        YYSTACK_RELOCATE (yyss_alloc, yyss);
1268
 
        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
 
1111
        yytype_int16 *yyss1 = yyss;
 
1112
        union yyalloc *yyptr =
 
1113
          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
 
1114
        if (! yyptr)
 
1115
          goto yyexhaustedlab;
 
1116
        YYSTACK_RELOCATE (yyss_alloc, yyss);
 
1117
        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1269
1118
#  undef YYSTACK_RELOCATE
1270
 
        if (yyss1 != yyssa)
1271
 
          YYSTACK_FREE (yyss1);
 
1119
        if (yyss1 != yyssa)
 
1120
          YYSTACK_FREE (yyss1);
1272
1121
      }
1273
1122
# endif
1274
1123
#endif /* no yyoverflow */
1277
1126
      yyvsp = yyvs + yysize - 1;
1278
1127
 
1279
1128
      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1280
 
                  (unsigned long int) yystacksize));
 
1129
                  (unsigned long int) yystacksize));
1281
1130
 
1282
1131
      if (yyss + yystacksize - 1 <= yyssp)
1283
 
        YYABORT;
 
1132
        YYABORT;
1284
1133
    }
1285
1134
 
1286
1135
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1309
1158
  if (yychar == YYEMPTY)
1310
1159
    {
1311
1160
      YYDPRINTF ((stderr, "Reading a token: "));
1312
 
      yychar = YYLEX;
 
1161
      yychar = yylex ();
1313
1162
    }
1314
1163
 
1315
1164
  if (yychar <= YYEOF)
1349
1198
  yychar = YYEMPTY;
1350
1199
 
1351
1200
  yystate = yyn;
 
1201
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1352
1202
  *++yyvsp = yylval;
 
1203
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1353
1204
 
1354
1205
  goto yynewstate;
1355
1206
 
1372
1223
  yylen = yyr2[yyn];
1373
1224
 
1374
1225
  /* If YYLEN is nonzero, implement the default value of the action:
1375
 
     `$$ = $1'.
 
1226
     '$$ = $1'.
1376
1227
 
1377
1228
     Otherwise, the following line sets YYVAL to garbage.
1378
1229
     This behavior is undocumented and Bison
1386
1237
  switch (yyn)
1387
1238
    {
1388
1239
        case 2:
1389
 
 
1390
 
/* Line 1806 of yacc.c  */
1391
 
#line 51 "cubeparse.y"
 
1240
#line 51 "cubeparse.y" /* yacc.c:1646  */
1392
1241
    {
1393
1242
                int dim;
1394
1243
 
1395
 
                dim = delim_count((yyvsp[(2) - (5)]), ',') + 1;
1396
 
                if ((delim_count((yyvsp[(4) - (5)]), ',') + 1) != dim)
 
1244
                dim = delim_count((yyvsp[-3]), ',') + 1;
 
1245
                if ((delim_count((yyvsp[-1]), ',') + 1) != dim)
1397
1246
                {
1398
1247
                        ereport(ERROR,
1399
1248
                                        (errcode(ERRCODE_SYNTAX_ERROR),
1400
1249
                                         errmsg("bad cube representation"),
1401
1250
                                         errdetail("Different point dimensions in (%s) and (%s).",
1402
 
                                                           (yyvsp[(2) - (5)]), (yyvsp[(4) - (5)]))));
 
1251
                                                           (yyvsp[-3]), (yyvsp[-1]))));
1403
1252
                        YYABORT;
1404
1253
                }
1405
1254
                if (dim > CUBE_MAX_DIM) {
1411
1260
                        YYABORT;
1412
1261
                }
1413
1262
 
1414
 
                *result = write_box( dim, (yyvsp[(2) - (5)]), (yyvsp[(4) - (5)]) );
 
1263
                *result = write_box( dim, (yyvsp[-3]), (yyvsp[-1]) );
1415
1264
 
1416
1265
        }
 
1266
#line 1267 "cubeparse.c" /* yacc.c:1646  */
1417
1267
    break;
1418
1268
 
1419
1269
  case 3:
1420
 
 
1421
 
/* Line 1806 of yacc.c  */
1422
 
#line 78 "cubeparse.y"
 
1270
#line 78 "cubeparse.y" /* yacc.c:1646  */
1423
1271
    {
1424
1272
                int dim;
1425
1273
 
1426
 
                dim = delim_count((yyvsp[(1) - (3)]), ',') + 1;
 
1274
                dim = delim_count((yyvsp[-2]), ',') + 1;
1427
1275
 
1428
 
                if ( (delim_count((yyvsp[(3) - (3)]), ',') + 1) != dim ) {
 
1276
                if ( (delim_count((yyvsp[0]), ',') + 1) != dim ) {
1429
1277
                        ereport(ERROR,
1430
1278
                                        (errcode(ERRCODE_SYNTAX_ERROR),
1431
1279
                                         errmsg("bad cube representation"),
1432
1280
                                         errdetail("Different point dimensions in (%s) and (%s).",
1433
 
                                                           (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]))));
 
1281
                                                           (yyvsp[-2]), (yyvsp[0]))));
1434
1282
                        YYABORT;
1435
1283
                }
1436
1284
                if (dim > CUBE_MAX_DIM) {
1442
1290
                        YYABORT;
1443
1291
                }
1444
1292
 
1445
 
                *result = write_box( dim, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]) );
 
1293
                *result = write_box( dim, (yyvsp[-2]), (yyvsp[0]) );
1446
1294
        }
 
1295
#line 1296 "cubeparse.c" /* yacc.c:1646  */
1447
1296
    break;
1448
1297
 
1449
1298
  case 4:
1450
 
 
1451
 
/* Line 1806 of yacc.c  */
1452
 
#line 104 "cubeparse.y"
 
1299
#line 104 "cubeparse.y" /* yacc.c:1646  */
1453
1300
    {
1454
1301
                int dim;
1455
1302
 
1456
 
                dim = delim_count((yyvsp[(1) - (1)]), ',') + 1;
 
1303
                dim = delim_count((yyvsp[0]), ',') + 1;
1457
1304
                if (dim > CUBE_MAX_DIM) {
1458
1305
                        ereport(ERROR,
1459
1306
                                        (errcode(ERRCODE_SYNTAX_ERROR),
1463
1310
                        YYABORT;
1464
1311
                }
1465
1312
 
1466
 
                *result = write_point_as_box((yyvsp[(1) - (1)]), dim);
 
1313
                *result = write_point_as_box((yyvsp[0]), dim);
1467
1314
        }
 
1315
#line 1316 "cubeparse.c" /* yacc.c:1646  */
1468
1316
    break;
1469
1317
 
1470
1318
  case 5:
1471
 
 
1472
 
/* Line 1806 of yacc.c  */
1473
 
#line 121 "cubeparse.y"
 
1319
#line 121 "cubeparse.y" /* yacc.c:1646  */
1474
1320
    {
1475
1321
                int dim;
1476
1322
 
1477
 
                dim = delim_count((yyvsp[(1) - (1)]), ',') + 1;
 
1323
                dim = delim_count((yyvsp[0]), ',') + 1;
1478
1324
                if (dim > CUBE_MAX_DIM) {
1479
1325
                        ereport(ERROR,
1480
1326
                                        (errcode(ERRCODE_SYNTAX_ERROR),
1483
1329
                                                           CUBE_MAX_DIM)));
1484
1330
                        YYABORT;
1485
1331
                }
1486
 
                *result = write_point_as_box((yyvsp[(1) - (1)]), dim);
 
1332
                *result = write_point_as_box((yyvsp[0]), dim);
1487
1333
        }
 
1334
#line 1335 "cubeparse.c" /* yacc.c:1646  */
1488
1335
    break;
1489
1336
 
1490
1337
  case 6:
1491
 
 
1492
 
/* Line 1806 of yacc.c  */
1493
 
#line 138 "cubeparse.y"
 
1338
#line 138 "cubeparse.y" /* yacc.c:1646  */
1494
1339
    {
1495
 
                (yyval) = (yyvsp[(2) - (3)]);
 
1340
                (yyval) = (yyvsp[-1]);
1496
1341
        }
 
1342
#line 1343 "cubeparse.c" /* yacc.c:1646  */
1497
1343
    break;
1498
1344
 
1499
1345
  case 7:
1500
 
 
1501
 
/* Line 1806 of yacc.c  */
1502
 
#line 144 "cubeparse.y"
 
1346
#line 144 "cubeparse.y" /* yacc.c:1646  */
1503
1347
    {
1504
1348
                /* alloc enough space to be sure whole list will fit */
1505
1349
                (yyval) = palloc(scanbuflen + 1);
1506
 
                strcpy((yyval), (yyvsp[(1) - (1)]));
 
1350
                strcpy((yyval), (yyvsp[0]));
1507
1351
        }
 
1352
#line 1353 "cubeparse.c" /* yacc.c:1646  */
1508
1353
    break;
1509
1354
 
1510
1355
  case 8:
1511
 
 
1512
 
/* Line 1806 of yacc.c  */
1513
 
#line 150 "cubeparse.y"
 
1356
#line 150 "cubeparse.y" /* yacc.c:1646  */
1514
1357
    {
1515
 
                (yyval) = (yyvsp[(1) - (3)]);
 
1358
                (yyval) = (yyvsp[-2]);
1516
1359
                strcat((yyval), ",");
1517
 
                strcat((yyval), (yyvsp[(3) - (3)]));
 
1360
                strcat((yyval), (yyvsp[0]));
1518
1361
        }
 
1362
#line 1363 "cubeparse.c" /* yacc.c:1646  */
1519
1363
    break;
1520
1364
 
1521
1365
 
1522
 
 
1523
 
/* Line 1806 of yacc.c  */
1524
 
#line 1525 "cubeparse.c"
 
1366
#line 1367 "cubeparse.c" /* yacc.c:1646  */
1525
1367
      default: break;
1526
1368
    }
1527
1369
  /* User semantic actions sometimes alter yychar, and that requires
1543
1385
 
1544
1386
  *++yyvsp = yyval;
1545
1387
 
1546
 
  /* Now `shift' the result of the reduction.  Determine what state
 
1388
  /* Now 'shift' the result of the reduction.  Determine what state
1547
1389
     that goes to, based on the state we popped back to and the rule
1548
1390
     number reduced by.  */
1549
1391
 
1558
1400
  goto yynewstate;
1559
1401
 
1560
1402
 
1561
 
/*------------------------------------.
1562
 
| yyerrlab -- here on detecting error |
1563
 
`------------------------------------*/
 
1403
/*--------------------------------------.
 
1404
| yyerrlab -- here on detecting error.  |
 
1405
`--------------------------------------*/
1564
1406
yyerrlab:
1565
1407
  /* Make sure we have latest lookahead translation.  See comments at
1566
1408
     user semantic actions for why this is necessary.  */
1611
1453
  if (yyerrstatus == 3)
1612
1454
    {
1613
1455
      /* If just tried and failed to reuse lookahead token after an
1614
 
         error, discard it.  */
 
1456
         error, discard it.  */
1615
1457
 
1616
1458
      if (yychar <= YYEOF)
1617
 
        {
1618
 
          /* Return failure if at end of input.  */
1619
 
          if (yychar == YYEOF)
1620
 
            YYABORT;
1621
 
        }
 
1459
        {
 
1460
          /* Return failure if at end of input.  */
 
1461
          if (yychar == YYEOF)
 
1462
            YYABORT;
 
1463
        }
1622
1464
      else
1623
 
        {
1624
 
          yydestruct ("Error: discarding",
1625
 
                      yytoken, &yylval, result);
1626
 
          yychar = YYEMPTY;
1627
 
        }
 
1465
        {
 
1466
          yydestruct ("Error: discarding",
 
1467
                      yytoken, &yylval, result);
 
1468
          yychar = YYEMPTY;
 
1469
        }
1628
1470
    }
1629
1471
 
1630
1472
  /* Else will try to reuse lookahead token after shifting the error
1643
1485
  if (/*CONSTCOND*/ 0)
1644
1486
     goto yyerrorlab;
1645
1487
 
1646
 
  /* Do not reclaim the symbols of the rule which action triggered
 
1488
  /* Do not reclaim the symbols of the rule whose action triggered
1647
1489
     this YYERROR.  */
1648
1490
  YYPOPSTACK (yylen);
1649
1491
  yylen = 0;
1656
1498
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
1657
1499
`-------------------------------------------------------------*/
1658
1500
yyerrlab1:
1659
 
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
 
1501
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
1660
1502
 
1661
1503
  for (;;)
1662
1504
    {
1663
1505
      yyn = yypact[yystate];
1664
1506
      if (!yypact_value_is_default (yyn))
1665
 
        {
1666
 
          yyn += YYTERROR;
1667
 
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1668
 
            {
1669
 
              yyn = yytable[yyn];
1670
 
              if (0 < yyn)
1671
 
                break;
1672
 
            }
1673
 
        }
 
1507
        {
 
1508
          yyn += YYTERROR;
 
1509
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
 
1510
            {
 
1511
              yyn = yytable[yyn];
 
1512
              if (0 < yyn)
 
1513
                break;
 
1514
            }
 
1515
        }
1674
1516
 
1675
1517
      /* Pop the current state because it cannot handle the error token.  */
1676
1518
      if (yyssp == yyss)
1677
 
        YYABORT;
 
1519
        YYABORT;
1678
1520
 
1679
1521
 
1680
1522
      yydestruct ("Error: popping",
1681
 
                  yystos[yystate], yyvsp, result);
 
1523
                  yystos[yystate], yyvsp, result);
1682
1524
      YYPOPSTACK (1);
1683
1525
      yystate = *yyssp;
1684
1526
      YY_STACK_PRINT (yyss, yyssp);
1685
1527
    }
1686
1528
 
 
1529
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1687
1530
  *++yyvsp = yylval;
 
1531
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1688
1532
 
1689
1533
 
1690
1534
  /* Shift the error token.  */
1708
1552
  yyresult = 1;
1709
1553
  goto yyreturn;
1710
1554
 
1711
 
#if !defined(yyoverflow) || YYERROR_VERBOSE
 
1555
#if !defined yyoverflow || YYERROR_VERBOSE
1712
1556
/*-------------------------------------------------.
1713
1557
| yyexhaustedlab -- memory exhaustion comes here.  |
1714
1558
`-------------------------------------------------*/
1727
1571
      yydestruct ("Cleanup: discarding lookahead",
1728
1572
                  yytoken, &yylval, result);
1729
1573
    }
1730
 
  /* Do not reclaim the symbols of the rule which action triggered
 
1574
  /* Do not reclaim the symbols of the rule whose action triggered
1731
1575
     this YYABORT or YYACCEPT.  */
1732
1576
  YYPOPSTACK (yylen);
1733
1577
  YY_STACK_PRINT (yyss, yyssp);
1734
1578
  while (yyssp != yyss)
1735
1579
    {
1736
1580
      yydestruct ("Cleanup: popping",
1737
 
                  yystos[*yyssp], yyvsp, result);
 
1581
                  yystos[*yyssp], yyvsp, result);
1738
1582
      YYPOPSTACK (1);
1739
1583
    }
1740
1584
#ifndef yyoverflow
1745
1589
  if (yymsg != yymsgbuf)
1746
1590
    YYSTACK_FREE (yymsg);
1747
1591
#endif
1748
 
  /* Make sure YYID is used.  */
1749
 
  return YYID (yyresult);
 
1592
  return yyresult;
1750
1593
}
1751
 
 
1752
 
 
1753
 
 
1754
 
/* Line 2067 of yacc.c  */
1755
 
#line 157 "cubeparse.y"
 
1594
#line 157 "cubeparse.y" /* yacc.c:1906  */
1756
1595
 
1757
1596
 
1758
1597
static int
1830
1669
}
1831
1670
 
1832
1671
#include "cubescan.c"
1833