~ubuntu-branches/ubuntu/maverick/postgresql-8.4/maverick-updates

« back to all changes in this revision

Viewing changes to contrib/cube/cubeparse.c

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2012-02-27 15:13:58 UTC
  • mfrom: (1.3.5) (14.1.4 maverick-proposed)
  • Revision ID: package-import@ubuntu.com-20120227151358-5ervkskoqkkbwq51
Tags: 8.4.11-0ubuntu0.10.10
* New upstream bug fix/security release: (LP: #941912)
  - Require execute permission on the trigger function for "CREATE
    TRIGGER".
    This missing check could allow another user to execute a trigger
    function with forged input data, by installing it on a table he
    owns. This is only of significance for trigger functions marked
    SECURITY DEFINER, since otherwise trigger functions run as the
    table owner anyway. (CVE-2012-0866)
  - Remove arbitrary limitation on length of common name in SSL
    certificates.
    Both libpq and the server truncated the common name extracted from
    an SSL certificate at 32 bytes. Normally this would cause nothing
    worse than an unexpected verification failure, but there are some
    rather-implausible scenarios in which it might allow one
    certificate holder to impersonate another. The victim would have to
    have a common name exactly 32 bytes long, and the attacker would
    have to persuade a trusted CA to issue a certificate in which the
    common name has that string as a prefix. Impersonating a server
    would also require some additional exploit to redirect client
    connections. (CVE-2012-0867)
  - Convert newlines to spaces in names written in pg_dump comments.
    pg_dump was incautious about sanitizing object names that are
    emitted within SQL comments in its output script. A name containing
    a newline would at least render the script syntactically incorrect.
    Maliciously crafted object names could present a SQL injection risk
    when the script is reloaded. (CVE-2012-0868)
  - Fix btree index corruption from insertions concurrent with
    vacuuming.
    An index page split caused by an insertion could sometimes cause a
    concurrently-running "VACUUM" to miss removing index entries that
    it should remove. After the corresponding table rows are removed,
    the dangling index entries would cause errors (such as "could not
    read block N in file ...") or worse, silently wrong query results
    after unrelated rows are re-inserted at the now-free table
    locations. This bug has been present since release 8.2, but occurs
    so infrequently that it was not diagnosed until now. If you have
    reason to suspect that it has happened in your database, reindexing
    the affected index will fix things.
  - Update per-column permissions, not only per-table permissions, when
    changing table owner.
    Failure to do this meant that any previously granted column
    permissions were still shown as having been granted by the old
    owner. This meant that neither the new owner nor a superuser could
    revoke the now-untraceable-to-table-owner permissions.
  - Allow non-existent values for some settings in "ALTER USER/DATABASE
    SET".
    Allow default_text_search_config, default_tablespace, and
    temp_tablespaces to be set to names that are not known. This is
    because they might be known in another database where the setting
    is intended to be used, or for the tablespace cases because the
    tablespace might not be created yet. The same issue was previously
    recognized for search_path, and these settings now act like that
    one.
  - Avoid crashing when we have problems deleting table files
    post-commit.
    Dropping a table should lead to deleting the underlying disk files
    only after the transaction commits. In event of failure then (for
    instance, because of wrong file permissions) the code is supposed
    to just emit a warning message and go on, since it's too late to
    abort the transaction. This logic got broken as of release 8.4,
    causing such situations to result in a PANIC and an unrestartable
    database.
  - Track the OID counter correctly during WAL replay, even when it
    wraps around.
    Previously the OID counter would remain stuck at a high value until
    the system exited replay mode. The practical consequences of that
    are usually nil, but there are scenarios wherein a standby server
    that's been promoted to master might take a long time to advance
    the OID counter to a reasonable value once values are needed.
  - Fix regular expression back-references with - attached.
    Rather than enforcing an exact string match, the code would
    effectively accept any string that satisfies the pattern
    sub-expression referenced by the back-reference symbol.
    A similar problem still afflicts back-references that are embedded
    in a larger quantified expression, rather than being the immediate
    subject of the quantifier. This will be addressed in a future
    PostgreSQL release.
  - Fix recently-introduced memory leak in processing of inet/cidr
    values.
  - Fix dangling pointer after "CREATE TABLE AS"/"SELECT INTO" in a
    SQL-language function.
    In most cases this only led to an assertion failure in
    assert-enabled builds, but worse consequences seem possible.
  - Fix I/O-conversion-related memory leaks in plpgsql.
  - Improve pg_dump's handling of inherited table columns.
    pg_dump mishandled situations where a child column has a different
    default expression than its parent column. If the default is
    textually identical to the parent's default, but not actually the
    same (for instance, because of schema search path differences) it
    would not be recognized as different, so that after dump and
    restore the child would be allowed to inherit the parent's default.
    Child columns that are NOT NULL where their parent is not could
    also be restored subtly incorrectly.
  - Fix pg_restore's direct-to-database mode for INSERT-style table
    data.
    Direct-to-database restores from archive files made with
    "--inserts" or "--column-inserts" options fail when using
    pg_restore from a release dated September or December 2011, as a
    result of an oversight in a fix for another problem. The archive
    file itself is not at fault, and text-mode output is okay.
  - Allow AT option in ecpg DEALLOCATE statements.
    The infrastructure to support this has been there for awhile, but
    through an oversight there was still an error check rejecting the
    case.
  - Fix error in "contrib/intarray"'s int[] & int[] operator.
    If the smallest integer the two input arrays have in common is 1,
    and there are smaller values in either array, then 1 would be
    incorrectly omitted from the result.
  - Fix error detection in "contrib/pgcrypto"'s encrypt_iv() and
    decrypt_iv().
    These functions failed to report certain types of invalid-input
    errors, and would instead return random garbage values for
    incorrect input.
  - Fix one-byte buffer overrun in "contrib/test_parser".
    The code would try to read one more byte than it should, which
    would crash in corner cases. Since "contrib/test_parser" is only
    example code, this is not a security issue in itself, but bad
    example code is still bad.
  - Use __sync_lock_test_and_set() for spinlocks on ARM, if available.
    This function replaces our previous use of the SWPB instruction,
    which is deprecated and not available on ARMv6 and later. Reports
    suggest that the old code doesn't fail in an obvious way on recent
    ARM boards, but simply doesn't interlock concurrent accesses,
    leading to bizarre failures in multiprocess operation.
  - Use "-fexcess-precision=standard" option when building with gcc
    versions that accept it.
    This prevents assorted scenarios wherein recent versions of gcc
    will produce creative results.
  - Allow use of threaded Python on FreeBSD.
    Our configure script previously believed that this combination
    wouldn't work; but FreeBSD fixed the problem, so remove that error
    check.
* Drop 00git_inet_cidr_unpack.patch, 04-armel-tas.patch: applied upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* A Bison parser, made by GNU Bison 1.875.  */
2
 
 
3
 
/* Skeleton parser for Yacc-like parsing with Bison,
4
 
   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
5
 
 
6
 
   This program is free software; you can redistribute it and/or modify
 
1
 
 
2
/* A Bison parser, made by GNU Bison 2.4.1.  */
 
3
 
 
4
/* Skeleton implementation for Bison's Yacc-like parsers in C
 
5
   
 
6
      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
 
7
   Free Software Foundation, Inc.
 
8
   
 
9
   This program is free software: you can redistribute it and/or modify
7
10
   it under the terms of the GNU General Public License as published by
8
 
   the Free Software Foundation; either version 2, or (at your option)
9
 
   any later version.
10
 
 
 
11
   the Free Software Foundation, either version 3 of the License, or
 
12
   (at your option) any later version.
 
13
   
11
14
   This program is distributed in the hope that it will be useful,
12
15
   but WITHOUT ANY WARRANTY; without even the implied warranty of
13
16
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
17
   GNU General Public License for more details.
15
 
 
 
18
   
16
19
   You should have received a copy of the GNU General Public License
17
 
   along with this program; if not, write to the Free Software
18
 
   Foundation, Inc., 59 Temple Place - Suite 330,
19
 
   Boston, MA 02111-1307, USA.  */
20
 
 
21
 
/* As a special exception, when this file is copied by Bison into a
22
 
   Bison output file, you may use that output file without restriction.
23
 
   This special exception was added by the Free Software Foundation
24
 
   in version 1.24 of Bison.  */
25
 
 
26
 
/* Written by Richard Stallman by simplifying the original so called
27
 
   ``semantic'' parser.  */
 
20
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
21
 
 
22
/* As a special exception, you may create a larger work that contains
 
23
   part or all of the Bison parser skeleton and distribute that work
 
24
   under terms of your choice, so long as that work isn't itself a
 
25
   parser generator using the skeleton or a modified version thereof
 
26
   as a parser skeleton.  Alternatively, if you modify or redistribute
 
27
   the parser skeleton itself, you may (at your option) remove this
 
28
   special exception, which will cause the skeleton and the resulting
 
29
   Bison output files to be licensed under the GNU General Public
 
30
   License without this special exception.
 
31
   
 
32
   This special exception was added by the Free Software Foundation in
 
33
   version 2.2 of Bison.  */
 
34
 
 
35
/* C LALR(1) parser skeleton written by Richard Stallman, by
 
36
   simplifying the original so-called "semantic" parser.  */
28
37
 
29
38
/* All symbols defined below should begin with yy or YY, to avoid
30
39
   infringing on user name space.  This should be done even for local
36
45
/* Identify Bison output.  */
37
46
#define YYBISON 1
38
47
 
 
48
/* Bison version.  */
 
49
#define YYBISON_VERSION "2.4.1"
 
50
 
39
51
/* Skeleton name.  */
40
52
#define YYSKELETON_NAME "yacc.c"
41
53
 
42
54
/* Pure parsers.  */
43
55
#define YYPURE 0
44
56
 
 
57
/* Push parsers.  */
 
58
#define YYPUSH 0
 
59
 
 
60
/* Pull parsers.  */
 
61
#define YYPULL 1
 
62
 
45
63
/* Using locations.  */
46
64
#define YYLSP_NEEDED 0
47
65
 
48
 
/* If NAME_PREFIX is specified substitute the variables and functions
49
 
   names.  */
50
 
#define yyparse cube_yyparse
51
 
#define yylex   cube_yylex
52
 
#define yyerror cube_yyerror
53
 
#define yylval  cube_yylval
54
 
#define yychar  cube_yychar
55
 
#define yydebug cube_yydebug
56
 
#define yynerrs cube_yynerrs
57
 
 
58
 
 
59
 
/* Tokens.  */
60
 
#ifndef YYTOKENTYPE
61
 
# define YYTOKENTYPE
62
 
   /* Put the tokens into the symbol table, so that GDB and other debuggers
63
 
      know about them.  */
64
 
   enum yytokentype {
65
 
     CUBEFLOAT = 258,
66
 
     O_PAREN = 259,
67
 
     C_PAREN = 260,
68
 
     O_BRACKET = 261,
69
 
     C_BRACKET = 262,
70
 
     COMMA = 263
71
 
   };
72
 
#endif
73
 
#define CUBEFLOAT 258
74
 
#define O_PAREN 259
75
 
#define C_PAREN 260
76
 
#define O_BRACKET 261
77
 
#define C_BRACKET 262
78
 
#define COMMA 263
79
 
 
80
 
 
 
66
/* Substitute the variable and function names.  */
 
67
#define yyparse         cube_yyparse
 
68
#define yylex           cube_yylex
 
69
#define yyerror         cube_yyerror
 
70
#define yylval          cube_yylval
 
71
#define yychar          cube_yychar
 
72
#define yydebug         cube_yydebug
 
73
#define yynerrs         cube_yynerrs
81
74
 
82
75
 
83
76
/* Copy the first part of user declarations.  */
 
77
 
 
78
/* Line 189 of yacc.c  */
84
79
#line 1 "cubeparse.y"
85
80
 
86
81
/* NdBox = [(lowerleft),(upperright)] */
121
116
 
122
117
 
123
118
 
 
119
/* Line 189 of yacc.c  */
 
120
#line 121 "cubeparse.c"
 
121
 
124
122
/* Enabling traces.  */
125
123
#ifndef YYDEBUG
126
124
# define YYDEBUG 0
134
132
# define YYERROR_VERBOSE 0
135
133
#endif
136
134
 
137
 
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
 
135
/* Enabling the token table.  */
 
136
#ifndef YYTOKEN_TABLE
 
137
# define YYTOKEN_TABLE 0
 
138
#endif
 
139
 
 
140
 
 
141
/* Tokens.  */
 
142
#ifndef YYTOKENTYPE
 
143
# define YYTOKENTYPE
 
144
   /* Put the tokens into the symbol table, so that GDB and other debuggers
 
145
      know about them.  */
 
146
   enum yytokentype {
 
147
     CUBEFLOAT = 258,
 
148
     O_PAREN = 259,
 
149
     C_PAREN = 260,
 
150
     O_BRACKET = 261,
 
151
     C_BRACKET = 262,
 
152
     COMMA = 263
 
153
   };
 
154
#endif
 
155
 
 
156
 
 
157
 
 
158
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
138
159
typedef int YYSTYPE;
 
160
# define YYSTYPE_IS_TRIVIAL 1
139
161
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
140
162
# define YYSTYPE_IS_DECLARED 1
141
 
# define YYSTYPE_IS_TRIVIAL 1
142
163
#endif
143
164
 
144
165
 
145
 
 
146
166
/* Copy the second part of user declarations.  */
147
167
 
148
168
 
149
 
/* Line 214 of yacc.c.  */
150
 
#line 150 "cubeparse.c"
151
 
 
152
 
#if ! defined (yyoverflow) || YYERROR_VERBOSE
 
169
/* Line 264 of yacc.c  */
 
170
#line 171 "cubeparse.c"
 
171
 
 
172
#ifdef short
 
173
# undef short
 
174
#endif
 
175
 
 
176
#ifdef YYTYPE_UINT8
 
177
typedef YYTYPE_UINT8 yytype_uint8;
 
178
#else
 
179
typedef unsigned char yytype_uint8;
 
180
#endif
 
181
 
 
182
#ifdef YYTYPE_INT8
 
183
typedef YYTYPE_INT8 yytype_int8;
 
184
#elif (defined __STDC__ || defined __C99__FUNC__ \
 
185
     || defined __cplusplus || defined _MSC_VER)
 
186
typedef signed char yytype_int8;
 
187
#else
 
188
typedef short int yytype_int8;
 
189
#endif
 
190
 
 
191
#ifdef YYTYPE_UINT16
 
192
typedef YYTYPE_UINT16 yytype_uint16;
 
193
#else
 
194
typedef unsigned short int yytype_uint16;
 
195
#endif
 
196
 
 
197
#ifdef YYTYPE_INT16
 
198
typedef YYTYPE_INT16 yytype_int16;
 
199
#else
 
200
typedef short int yytype_int16;
 
201
#endif
 
202
 
 
203
#ifndef YYSIZE_T
 
204
# ifdef __SIZE_TYPE__
 
205
#  define YYSIZE_T __SIZE_TYPE__
 
206
# elif defined size_t
 
207
#  define YYSIZE_T size_t
 
208
# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
 
209
     || defined __cplusplus || defined _MSC_VER)
 
210
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
 
211
#  define YYSIZE_T size_t
 
212
# else
 
213
#  define YYSIZE_T unsigned int
 
214
# endif
 
215
#endif
 
216
 
 
217
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
 
218
 
 
219
#ifndef YY_
 
220
# if YYENABLE_NLS
 
221
#  if ENABLE_NLS
 
222
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
 
223
#   define YY_(msgid) dgettext ("bison-runtime", msgid)
 
224
#  endif
 
225
# endif
 
226
# ifndef YY_
 
227
#  define YY_(msgid) msgid
 
228
# endif
 
229
#endif
 
230
 
 
231
/* Suppress unused-variable warnings by "using" E.  */
 
232
#if ! defined lint || defined __GNUC__
 
233
# define YYUSE(e) ((void) (e))
 
234
#else
 
235
# define YYUSE(e) /* empty */
 
236
#endif
 
237
 
 
238
/* Identity function, used to suppress warnings about constant conditions.  */
 
239
#ifndef lint
 
240
# define YYID(n) (n)
 
241
#else
 
242
#if (defined __STDC__ || defined __C99__FUNC__ \
 
243
     || defined __cplusplus || defined _MSC_VER)
 
244
static int
 
245
YYID (int yyi)
 
246
#else
 
247
static int
 
248
YYID (yyi)
 
249
    int yyi;
 
250
#endif
 
251
{
 
252
  return yyi;
 
253
}
 
254
#endif
 
255
 
 
256
#if ! defined yyoverflow || YYERROR_VERBOSE
153
257
 
154
258
/* The parser invokes alloca or malloc; define the necessary symbols.  */
155
259
 
156
 
# if YYSTACK_USE_ALLOCA
157
 
#  define YYSTACK_ALLOC alloca
158
 
# else
159
 
#  ifndef YYSTACK_USE_ALLOCA
160
 
#   if defined (alloca) || defined (_ALLOCA_H)
 
260
# ifdef YYSTACK_USE_ALLOCA
 
261
#  if YYSTACK_USE_ALLOCA
 
262
#   ifdef __GNUC__
 
263
#    define YYSTACK_ALLOC __builtin_alloca
 
264
#   elif defined __BUILTIN_VA_ARG_INCR
 
265
#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
 
266
#   elif defined _AIX
 
267
#    define YYSTACK_ALLOC __alloca
 
268
#   elif defined _MSC_VER
 
269
#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
 
270
#    define alloca _alloca
 
271
#   else
161
272
#    define YYSTACK_ALLOC alloca
162
 
#   else
163
 
#    ifdef __GNUC__
164
 
#     define YYSTACK_ALLOC __builtin_alloca
 
273
#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
 
274
     || defined __cplusplus || defined _MSC_VER)
 
275
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 
276
#     ifndef _STDLIB_H
 
277
#      define _STDLIB_H 1
 
278
#     endif
165
279
#    endif
166
280
#   endif
167
281
#  endif
168
282
# endif
169
283
 
170
284
# ifdef YYSTACK_ALLOC
171
 
   /* Pacify GCC's `empty if-body' warning. */
172
 
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
 
285
   /* Pacify GCC's `empty if-body' warning.  */
 
286
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
 
287
#  ifndef YYSTACK_ALLOC_MAXIMUM
 
288
    /* The OS might guarantee only one guard page at the bottom of the stack,
 
289
       and a page size can be as small as 4096 bytes.  So we cannot safely
 
290
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
 
291
       to allow for a few compiler-allocated temporary stack slots.  */
 
292
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
 
293
#  endif
173
294
# else
174
 
#  if defined (__STDC__) || defined (__cplusplus)
 
295
#  define YYSTACK_ALLOC YYMALLOC
 
296
#  define YYSTACK_FREE YYFREE
 
297
#  ifndef YYSTACK_ALLOC_MAXIMUM
 
298
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
 
299
#  endif
 
300
#  if (defined __cplusplus && ! defined _STDLIB_H \
 
301
       && ! ((defined YYMALLOC || defined malloc) \
 
302
             && (defined YYFREE || defined free)))
175
303
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
176
 
#   define YYSIZE_T size_t
177
 
#  endif
178
 
#  define YYSTACK_ALLOC malloc
179
 
#  define YYSTACK_FREE free
 
304
#   ifndef _STDLIB_H
 
305
#    define _STDLIB_H 1
 
306
#   endif
 
307
#  endif
 
308
#  ifndef YYMALLOC
 
309
#   define YYMALLOC malloc
 
310
#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
 
311
     || defined __cplusplus || defined _MSC_VER)
 
312
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
 
313
#   endif
 
314
#  endif
 
315
#  ifndef YYFREE
 
316
#   define YYFREE free
 
317
#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
 
318
     || defined __cplusplus || defined _MSC_VER)
 
319
void free (void *); /* INFRINGES ON USER NAME SPACE */
 
320
#   endif
 
321
#  endif
180
322
# endif
181
 
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
182
 
 
183
 
 
184
 
#if (! defined (yyoverflow) \
185
 
     && (! defined (__cplusplus) \
186
 
         || (YYSTYPE_IS_TRIVIAL)))
 
323
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
 
324
 
 
325
 
 
326
#if (! defined yyoverflow \
 
327
     && (! defined __cplusplus \
 
328
         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
187
329
 
188
330
/* A type that is properly aligned for any stack member.  */
189
331
union yyalloc
190
332
{
191
 
  short yyss;
192
 
  YYSTYPE yyvs;
193
 
  };
 
333
  yytype_int16 yyss_alloc;
 
334
  YYSTYPE yyvs_alloc;
 
335
};
194
336
 
195
337
/* The size of the maximum gap between one aligned stack and the next.  */
196
338
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
198
340
/* The size of an array large to enough to hold all stacks, each with
199
341
   N elements.  */
200
342
# define YYSTACK_BYTES(N) \
201
 
     ((N) * (sizeof (short) + sizeof (YYSTYPE))                         \
 
343
     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
202
344
      + YYSTACK_GAP_MAXIMUM)
203
345
 
204
346
/* Copy COUNT objects from FROM to TO.  The source and destination do
205
347
   not overlap.  */
206
348
# ifndef YYCOPY
207
 
#  if 1 < __GNUC__
 
349
#  if defined __GNUC__ && 1 < __GNUC__
208
350
#   define YYCOPY(To, From, Count) \
209
351
      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
210
352
#  else
211
353
#   define YYCOPY(To, From, Count)              \
212
354
      do                                        \
213
355
        {                                       \
214
 
          register YYSIZE_T yyi;                \
 
356
          YYSIZE_T yyi;                         \
215
357
          for (yyi = 0; yyi < (Count); yyi++)   \
216
358
            (To)[yyi] = (From)[yyi];            \
217
359
        }                                       \
218
 
      while (0)
 
360
      while (YYID (0))
219
361
#  endif
220
362
# endif
221
363
 
224
366
   elements in the stack, and YYPTR gives the new location of the
225
367
   stack.  Advance YYPTR to a properly aligned location for the next
226
368
   stack.  */
227
 
# define YYSTACK_RELOCATE(Stack)                                        \
 
369
# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
228
370
    do                                                                  \
229
371
      {                                                                 \
230
372
        YYSIZE_T yynewbytes;                                            \
231
 
        YYCOPY (&yyptr->Stack, Stack, yysize);                          \
232
 
        Stack = &yyptr->Stack;                                          \
 
373
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
 
374
        Stack = &yyptr->Stack_alloc;                                    \
233
375
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
234
376
        yyptr += yynewbytes / sizeof (*yyptr);                          \
235
377
      }                                                                 \
236
 
    while (0)
237
 
 
238
 
#endif
239
 
 
240
 
#if defined (__STDC__) || defined (__cplusplus)
241
 
   typedef signed char yysigned_char;
242
 
#else
243
 
   typedef short yysigned_char;
244
 
#endif
245
 
 
246
 
/* YYFINAL -- State number of the termination state. */
 
378
    while (YYID (0))
 
379
 
 
380
#endif
 
381
 
 
382
/* YYFINAL -- State number of the termination state.  */
247
383
#define YYFINAL  9
248
384
/* YYLAST -- Last index in YYTABLE.  */
249
385
#define YYLAST   17
250
386
 
251
 
/* YYNTOKENS -- Number of terminals. */
 
387
/* YYNTOKENS -- Number of terminals.  */
252
388
#define YYNTOKENS  9
253
 
/* YYNNTS -- Number of nonterminals. */
 
389
/* YYNNTS -- Number of nonterminals.  */
254
390
#define YYNNTS  4
255
 
/* YYNRULES -- Number of rules. */
 
391
/* YYNRULES -- Number of rules.  */
256
392
#define YYNRULES  8
257
 
/* YYNRULES -- Number of states. */
 
393
/* YYNRULES -- Number of states.  */
258
394
#define YYNSTATES  18
259
395
 
260
396
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
261
397
#define YYUNDEFTOK  2
262
398
#define YYMAXUTOK   263
263
399
 
264
 
#define YYTRANSLATE(YYX)                                                \
 
400
#define YYTRANSLATE(YYX)                                                \
265
401
  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
266
402
 
267
403
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
268
 
static const unsigned char yytranslate[] =
 
404
static const yytype_uint8 yytranslate[] =
269
405
{
270
406
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
271
407
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
299
435
#if YYDEBUG
300
436
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
301
437
   YYRHS.  */
302
 
static const unsigned char yyprhs[] =
 
438
static const yytype_uint8 yyprhs[] =
303
439
{
304
440
       0,     0,     3,     9,    13,    15,    17,    21,    23
305
441
};
306
442
 
307
 
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
308
 
static const yysigned_char yyrhs[] =
 
443
/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
 
444
static const yytype_int8 yyrhs[] =
309
445
{
310
446
      10,     0,    -1,     6,    11,     8,    11,     7,    -1,    11,
311
447
       8,    11,    -1,    11,    -1,    12,    -1,     4,    12,     5,
313
449
};
314
450
 
315
451
/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
316
 
static const unsigned char yyrline[] =
 
452
static const yytype_uint8 yyrline[] =
317
453
{
318
454
       0,    51,    51,    77,   103,   121,   138,   144,   150
319
455
};
320
456
#endif
321
457
 
322
 
#if YYDEBUG || YYERROR_VERBOSE
323
 
/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
324
 
   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
 
458
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
 
459
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
 
460
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
325
461
static const char *const yytname[] =
326
462
{
327
 
  "$end", "error", "$undefined", "CUBEFLOAT", "O_PAREN", "C_PAREN", 
328
 
  "O_BRACKET", "C_BRACKET", "COMMA", "$accept", "box", "paren_list", 
 
463
  "$end", "error", "$undefined", "CUBEFLOAT", "O_PAREN", "C_PAREN",
 
464
  "O_BRACKET", "C_BRACKET", "COMMA", "$accept", "box", "paren_list",
329
465
  "list", 0
330
466
};
331
467
#endif
333
469
# ifdef YYPRINT
334
470
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
335
471
   token YYLEX-NUM.  */
336
 
static const unsigned short yytoknum[] =
 
472
static const yytype_uint16 yytoknum[] =
337
473
{
338
474
       0,   256,   257,   258,   259,   260,   261,   262,   263
339
475
};
340
476
# endif
341
477
 
342
478
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
343
 
static const unsigned char yyr1[] =
 
479
static const yytype_uint8 yyr1[] =
344
480
{
345
481
       0,     9,    10,    10,    10,    10,    11,    12,    12
346
482
};
347
483
 
348
484
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
349
 
static const unsigned char yyr2[] =
 
485
static const yytype_uint8 yyr2[] =
350
486
{
351
487
       0,     2,     5,     3,     1,     1,     3,     1,     3
352
488
};
354
490
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
355
491
   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
356
492
   means the default is an error.  */
357
 
static const unsigned char yydefact[] =
 
493
static const yytype_uint8 yydefact[] =
358
494
{
359
495
       0,     7,     0,     0,     0,     4,     5,     0,     0,     1,
360
496
       0,     0,     6,     0,     3,     8,     0,     2
361
497
};
362
498
 
363
 
/* YYDEFGOTO[NTERM-NUM]. */
364
 
static const yysigned_char yydefgoto[] =
 
499
/* YYDEFGOTO[NTERM-NUM].  */
 
500
static const yytype_int8 yydefgoto[] =
365
501
{
366
502
      -1,     4,     5,     6
367
503
};
369
505
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
370
506
   STATE-NUM.  */
371
507
#define YYPACT_NINF -4
372
 
static const yysigned_char yypact[] =
 
508
static const yytype_int8 yypact[] =
373
509
{
374
510
      -2,    -4,     3,    -1,     9,     4,     5,     0,     6,    -4,
375
511
      -1,     8,    -4,    -1,    -4,    -4,    10,    -4
376
512
};
377
513
 
378
514
/* YYPGOTO[NTERM-NUM].  */
379
 
static const yysigned_char yypgoto[] =
 
515
static const yytype_int8 yypgoto[] =
380
516
{
381
517
      -4,    -4,    -3,    13
382
518
};
386
522
   number is the opposite.  If zero, do what YYDEFACT says.
387
523
   If YYTABLE_NINF, syntax error.  */
388
524
#define YYTABLE_NINF -1
389
 
static const unsigned char yytable[] =
 
525
static const yytype_uint8 yytable[] =
390
526
{
391
527
       8,     1,     2,     2,     3,    12,     1,    14,    11,     9,
392
528
      16,    15,    10,    11,    13,     7,     0,    17
393
529
};
394
530
 
395
 
static const yysigned_char yycheck[] =
 
531
static const yytype_int8 yycheck[] =
396
532
{
397
533
       3,     3,     4,     4,     6,     5,     3,    10,     8,     0,
398
534
      13,     3,     8,     8,     8,     2,    -1,     7
400
536
 
401
537
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
402
538
   symbol of state STATE-NUM.  */
403
 
static const unsigned char yystos[] =
 
539
static const yytype_uint8 yystos[] =
404
540
{
405
541
       0,     3,     4,     6,    10,    11,    12,    12,    11,     0,
406
542
       8,     8,     5,     8,    11,     3,    11,     7
407
543
};
408
544
 
409
 
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
410
 
# define YYSIZE_T __SIZE_TYPE__
411
 
#endif
412
 
#if ! defined (YYSIZE_T) && defined (size_t)
413
 
# define YYSIZE_T size_t
414
 
#endif
415
 
#if ! defined (YYSIZE_T)
416
 
# if defined (__STDC__) || defined (__cplusplus)
417
 
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
418
 
#  define YYSIZE_T size_t
419
 
# endif
420
 
#endif
421
 
#if ! defined (YYSIZE_T)
422
 
# define YYSIZE_T unsigned int
423
 
#endif
424
 
 
425
545
#define yyerrok         (yyerrstatus = 0)
426
546
#define yyclearin       (yychar = YYEMPTY)
427
547
#define YYEMPTY         (-2)
429
549
 
430
550
#define YYACCEPT        goto yyacceptlab
431
551
#define YYABORT         goto yyabortlab
432
 
#define YYERROR         goto yyerrlab1
 
552
#define YYERROR         goto yyerrorlab
 
553
 
433
554
 
434
555
/* Like YYERROR except do call yyerror.  This remains here temporarily
435
556
   to ease the transition to the new meaning of YYERROR, for GCC.
446
567
      yychar = (Token);                                         \
447
568
      yylval = (Value);                                         \
448
569
      yytoken = YYTRANSLATE (yychar);                           \
449
 
      YYPOPSTACK;                                               \
 
570
      YYPOPSTACK (1);                                           \
450
571
      goto yybackup;                                            \
451
572
    }                                                           \
452
573
  else                                                          \
453
 
    {                                                           \
454
 
      yyerror ("syntax error: cannot back up");\
 
574
    {                                                           \
 
575
      yyerror (YY_("syntax error: cannot back up")); \
455
576
      YYERROR;                                                  \
456
577
    }                                                           \
457
 
while (0)
 
578
while (YYID (0))
 
579
 
458
580
 
459
581
#define YYTERROR        1
460
582
#define YYERRCODE       256
461
583
 
462
 
/* YYLLOC_DEFAULT -- Compute the default location (before the actions
463
 
   are run).  */
464
 
 
 
584
 
 
585
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
 
586
   If N is 0, then set CURRENT to the empty location which ends
 
587
   the previous symbol: RHS[0] (always defined).  */
 
588
 
 
589
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
465
590
#ifndef YYLLOC_DEFAULT
466
 
# define YYLLOC_DEFAULT(Current, Rhs, N)         \
467
 
  Current.first_line   = Rhs[1].first_line;      \
468
 
  Current.first_column = Rhs[1].first_column;    \
469
 
  Current.last_line    = Rhs[N].last_line;       \
470
 
  Current.last_column  = Rhs[N].last_column;
471
 
#endif
 
591
# define YYLLOC_DEFAULT(Current, Rhs, N)                                \
 
592
    do                                                                  \
 
593
      if (YYID (N))                                                    \
 
594
        {                                                               \
 
595
          (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
 
596
          (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
 
597
          (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
 
598
          (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
 
599
        }                                                               \
 
600
      else                                                              \
 
601
        {                                                               \
 
602
          (Current).first_line   = (Current).last_line   =              \
 
603
            YYRHSLOC (Rhs, 0).last_line;                                \
 
604
          (Current).first_column = (Current).last_column =              \
 
605
            YYRHSLOC (Rhs, 0).last_column;                              \
 
606
        }                                                               \
 
607
    while (YYID (0))
 
608
#endif
 
609
 
 
610
 
 
611
/* YY_LOCATION_PRINT -- Print the location on the stream.
 
612
   This macro was not mandated originally: define only if we know
 
613
   we won't break user code: when these are the locations we know.  */
 
614
 
 
615
#ifndef YY_LOCATION_PRINT
 
616
# if YYLTYPE_IS_TRIVIAL
 
617
#  define YY_LOCATION_PRINT(File, Loc)                  \
 
618
     fprintf (File, "%d.%d-%d.%d",                      \
 
619
              (Loc).first_line, (Loc).first_column,     \
 
620
              (Loc).last_line,  (Loc).last_column)
 
621
# else
 
622
#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
 
623
# endif
 
624
#endif
 
625
 
472
626
 
473
627
/* YYLEX -- calling `yylex' with the right arguments.  */
474
628
 
490
644
do {                                            \
491
645
  if (yydebug)                                  \
492
646
    YYFPRINTF Args;                             \
493
 
} while (0)
494
 
 
495
 
# define YYDSYMPRINT(Args)                      \
496
 
do {                                            \
497
 
  if (yydebug)                                  \
498
 
    yysymprint Args;                            \
499
 
} while (0)
500
 
 
501
 
# define YYDSYMPRINTF(Title, Token, Value, Location)            \
502
 
do {                                                            \
503
 
  if (yydebug)                                                  \
504
 
    {                                                           \
505
 
      YYFPRINTF (stderr, "%s ", Title);                         \
506
 
      yysymprint (stderr,                                       \
507
 
                  Token, Value);        \
508
 
      YYFPRINTF (stderr, "\n");                                 \
509
 
    }                                                           \
510
 
} while (0)
 
647
} while (YYID (0))
 
648
 
 
649
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
 
650
do {                                                                      \
 
651
  if (yydebug)                                                            \
 
652
    {                                                                     \
 
653
      YYFPRINTF (stderr, "%s ", Title);                                   \
 
654
      yy_symbol_print (stderr,                                            \
 
655
                  Type, Value); \
 
656
      YYFPRINTF (stderr, "\n");                                           \
 
657
    }                                                                     \
 
658
} while (YYID (0))
 
659
 
 
660
 
 
661
/*--------------------------------.
 
662
| Print this symbol on YYOUTPUT.  |
 
663
`--------------------------------*/
 
664
 
 
665
/*ARGSUSED*/
 
666
#if (defined __STDC__ || defined __C99__FUNC__ \
 
667
     || defined __cplusplus || defined _MSC_VER)
 
668
static void
 
669
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
 
670
#else
 
671
static void
 
672
yy_symbol_value_print (yyoutput, yytype, yyvaluep)
 
673
    FILE *yyoutput;
 
674
    int yytype;
 
675
    YYSTYPE const * const yyvaluep;
 
676
#endif
 
677
{
 
678
  if (!yyvaluep)
 
679
    return;
 
680
# ifdef YYPRINT
 
681
  if (yytype < YYNTOKENS)
 
682
    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
 
683
# else
 
684
  YYUSE (yyoutput);
 
685
# endif
 
686
  switch (yytype)
 
687
    {
 
688
      default:
 
689
        break;
 
690
    }
 
691
}
 
692
 
 
693
 
 
694
/*--------------------------------.
 
695
| Print this symbol on YYOUTPUT.  |
 
696
`--------------------------------*/
 
697
 
 
698
#if (defined __STDC__ || defined __C99__FUNC__ \
 
699
     || defined __cplusplus || defined _MSC_VER)
 
700
static void
 
701
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
 
702
#else
 
703
static void
 
704
yy_symbol_print (yyoutput, yytype, yyvaluep)
 
705
    FILE *yyoutput;
 
706
    int yytype;
 
707
    YYSTYPE const * const yyvaluep;
 
708
#endif
 
709
{
 
710
  if (yytype < YYNTOKENS)
 
711
    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
 
712
  else
 
713
    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
 
714
 
 
715
  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
 
716
  YYFPRINTF (yyoutput, ")");
 
717
}
511
718
 
512
719
/*------------------------------------------------------------------.
513
720
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
514
 
| TOP (cinluded).                                                   |
 
721
| TOP (included).                                                   |
515
722
`------------------------------------------------------------------*/
516
723
 
517
 
#if defined (__STDC__) || defined (__cplusplus)
 
724
#if (defined __STDC__ || defined __C99__FUNC__ \
 
725
     || defined __cplusplus || defined _MSC_VER)
518
726
static void
519
 
yy_stack_print (short *bottom, short *top)
 
727
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
520
728
#else
521
729
static void
522
 
yy_stack_print (bottom, top)
523
 
    short *bottom;
524
 
    short *top;
 
730
yy_stack_print (yybottom, yytop)
 
731
    yytype_int16 *yybottom;
 
732
    yytype_int16 *yytop;
525
733
#endif
526
734
{
527
735
  YYFPRINTF (stderr, "Stack now");
528
 
  for (/* Nothing. */; bottom <= top; ++bottom)
529
 
    YYFPRINTF (stderr, " %d", *bottom);
 
736
  for (; yybottom <= yytop; yybottom++)
 
737
    {
 
738
      int yybot = *yybottom;
 
739
      YYFPRINTF (stderr, " %d", yybot);
 
740
    }
530
741
  YYFPRINTF (stderr, "\n");
531
742
}
532
743
 
534
745
do {                                                            \
535
746
  if (yydebug)                                                  \
536
747
    yy_stack_print ((Bottom), (Top));                           \
537
 
} while (0)
 
748
} while (YYID (0))
538
749
 
539
750
 
540
751
/*------------------------------------------------.
541
752
| Report that the YYRULE is going to be reduced.  |
542
753
`------------------------------------------------*/
543
754
 
544
 
#if defined (__STDC__) || defined (__cplusplus)
 
755
#if (defined __STDC__ || defined __C99__FUNC__ \
 
756
     || defined __cplusplus || defined _MSC_VER)
545
757
static void
546
 
yy_reduce_print (int yyrule)
 
758
yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
547
759
#else
548
760
static void
549
 
yy_reduce_print (yyrule)
 
761
yy_reduce_print (yyvsp, yyrule)
 
762
    YYSTYPE *yyvsp;
550
763
    int yyrule;
551
764
#endif
552
765
{
 
766
  int yynrhs = yyr2[yyrule];
553
767
  int yyi;
554
 
  unsigned int yylineno = yyrline[yyrule];
555
 
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
556
 
             yyrule - 1, yylineno);
557
 
  /* Print the symbols being reduced, and their result.  */
558
 
  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
559
 
    YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
560
 
  YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
 
768
  unsigned long int yylno = yyrline[yyrule];
 
769
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
 
770
             yyrule - 1, yylno);
 
771
  /* The symbols being reduced.  */
 
772
  for (yyi = 0; yyi < yynrhs; yyi++)
 
773
    {
 
774
      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
 
775
      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
 
776
                       &(yyvsp[(yyi + 1) - (yynrhs)])
 
777
                                       );
 
778
      YYFPRINTF (stderr, "\n");
 
779
    }
561
780
}
562
781
 
563
782
# define YY_REDUCE_PRINT(Rule)          \
564
783
do {                                    \
565
784
  if (yydebug)                          \
566
 
    yy_reduce_print (Rule);             \
567
 
} while (0)
 
785
    yy_reduce_print (yyvsp, Rule); \
 
786
} while (YYID (0))
568
787
 
569
788
/* Nonzero means print parse trace.  It is left uninitialized so that
570
789
   multiple parsers can coexist.  */
571
790
int yydebug;
572
791
#else /* !YYDEBUG */
573
792
# define YYDPRINTF(Args)
574
 
# define YYDSYMPRINT(Args)
575
 
# define YYDSYMPRINTF(Title, Token, Value, Location)
 
793
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
576
794
# define YY_STACK_PRINT(Bottom, Top)
577
795
# define YY_REDUCE_PRINT(Rule)
578
796
#endif /* !YYDEBUG */
587
805
   if the built-in stack extension method is used).
588
806
 
589
807
   Do not make this value too large; the results are undefined if
590
 
   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
 
808
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
591
809
   evaluated with infinite-precision integer arithmetic.  */
592
810
 
593
 
#if YYMAXDEPTH == 0
594
 
# undef YYMAXDEPTH
595
 
#endif
596
 
 
597
811
#ifndef YYMAXDEPTH
598
812
# define YYMAXDEPTH 10000
599
813
#endif
603
817
#if YYERROR_VERBOSE
604
818
 
605
819
# ifndef yystrlen
606
 
#  if defined (__GLIBC__) && defined (_STRING_H)
 
820
#  if defined __GLIBC__ && defined _STRING_H
607
821
#   define yystrlen strlen
608
822
#  else
609
823
/* Return the length of YYSTR.  */
 
824
#if (defined __STDC__ || defined __C99__FUNC__ \
 
825
     || defined __cplusplus || defined _MSC_VER)
610
826
static YYSIZE_T
611
 
#   if defined (__STDC__) || defined (__cplusplus)
612
827
yystrlen (const char *yystr)
613
 
#   else
 
828
#else
 
829
static YYSIZE_T
614
830
yystrlen (yystr)
615
 
     const char *yystr;
616
 
#   endif
 
831
    const char *yystr;
 
832
#endif
617
833
{
618
 
  register const char *yys = yystr;
619
 
 
620
 
  while (*yys++ != '\0')
 
834
  YYSIZE_T yylen;
 
835
  for (yylen = 0; yystr[yylen]; yylen++)
621
836
    continue;
622
 
 
623
 
  return yys - yystr - 1;
 
837
  return yylen;
624
838
}
625
839
#  endif
626
840
# endif
627
841
 
628
842
# ifndef yystpcpy
629
 
#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
 
843
#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
630
844
#   define yystpcpy stpcpy
631
845
#  else
632
846
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
633
847
   YYDEST.  */
 
848
#if (defined __STDC__ || defined __C99__FUNC__ \
 
849
     || defined __cplusplus || defined _MSC_VER)
634
850
static char *
635
 
#   if defined (__STDC__) || defined (__cplusplus)
636
851
yystpcpy (char *yydest, const char *yysrc)
637
 
#   else
 
852
#else
 
853
static char *
638
854
yystpcpy (yydest, yysrc)
639
 
     char *yydest;
640
 
     const char *yysrc;
641
 
#   endif
 
855
    char *yydest;
 
856
    const char *yysrc;
 
857
#endif
642
858
{
643
 
  register char *yyd = yydest;
644
 
  register const char *yys = yysrc;
 
859
  char *yyd = yydest;
 
860
  const char *yys = yysrc;
645
861
 
646
862
  while ((*yyd++ = *yys++) != '\0')
647
863
    continue;
651
867
#  endif
652
868
# endif
653
869
 
654
 
#endif /* !YYERROR_VERBOSE */
655
 
 
 
870
# ifndef yytnamerr
 
871
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
 
872
   quotes and backslashes, so that it's suitable for yyerror.  The
 
873
   heuristic is that double-quoting is unnecessary unless the string
 
874
   contains an apostrophe, a comma, or backslash (other than
 
875
   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
 
876
   null, do not copy; instead, return the length of what the result
 
877
   would have been.  */
 
878
static YYSIZE_T
 
879
yytnamerr (char *yyres, const char *yystr)
 
880
{
 
881
  if (*yystr == '"')
 
882
    {
 
883
      YYSIZE_T yyn = 0;
 
884
      char const *yyp = yystr;
 
885
 
 
886
      for (;;)
 
887
        switch (*++yyp)
 
888
          {
 
889
          case '\'':
 
890
          case ',':
 
891
            goto do_not_strip_quotes;
 
892
 
 
893
          case '\\':
 
894
            if (*++yyp != '\\')
 
895
              goto do_not_strip_quotes;
 
896
            /* Fall through.  */
 
897
          default:
 
898
            if (yyres)
 
899
              yyres[yyn] = *yyp;
 
900
            yyn++;
 
901
            break;
 
902
 
 
903
          case '"':
 
904
            if (yyres)
 
905
              yyres[yyn] = '\0';
 
906
            return yyn;
 
907
          }
 
908
    do_not_strip_quotes: ;
 
909
    }
 
910
 
 
911
  if (! yyres)
 
912
    return yystrlen (yystr);
 
913
 
 
914
  return yystpcpy (yyres, yystr) - yyres;
 
915
}
 
916
# endif
 
917
 
 
918
/* Copy into YYRESULT an error message about the unexpected token
 
919
   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
 
920
   including the terminating null byte.  If YYRESULT is null, do not
 
921
   copy anything; just return the number of bytes that would be
 
922
   copied.  As a special case, return 0 if an ordinary "syntax error"
 
923
   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
 
924
   size calculation.  */
 
925
static YYSIZE_T
 
926
yysyntax_error (char *yyresult, int yystate, int yychar)
 
927
{
 
928
  int yyn = yypact[yystate];
 
929
 
 
930
  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
 
931
    return 0;
 
932
  else
 
933
    {
 
934
      int yytype = YYTRANSLATE (yychar);
 
935
      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
 
936
      YYSIZE_T yysize = yysize0;
 
937
      YYSIZE_T yysize1;
 
938
      int yysize_overflow = 0;
 
939
      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
 
940
      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
 
941
      int yyx;
 
942
 
 
943
# if 0
 
944
      /* This is so xgettext sees the translatable formats that are
 
945
         constructed on the fly.  */
 
946
      YY_("syntax error, unexpected %s");
 
947
      YY_("syntax error, unexpected %s, expecting %s");
 
948
      YY_("syntax error, unexpected %s, expecting %s or %s");
 
949
      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
 
950
      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
 
951
# endif
 
952
      char *yyfmt;
 
953
      char const *yyf;
 
954
      static char const yyunexpected[] = "syntax error, unexpected %s";
 
955
      static char const yyexpecting[] = ", expecting %s";
 
956
      static char const yyor[] = " or %s";
 
957
      char yyformat[sizeof yyunexpected
 
958
                    + sizeof yyexpecting - 1
 
959
                    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
 
960
                       * (sizeof yyor - 1))];
 
961
      char const *yyprefix = yyexpecting;
 
962
 
 
963
      /* Start YYX at -YYN if negative to avoid negative indexes in
 
964
         YYCHECK.  */
 
965
      int yyxbegin = yyn < 0 ? -yyn : 0;
 
966
 
 
967
      /* Stay within bounds of both yycheck and yytname.  */
 
968
      int yychecklim = YYLAST - yyn + 1;
 
969
      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
 
970
      int yycount = 1;
 
971
 
 
972
      yyarg[0] = yytname[yytype];
 
973
      yyfmt = yystpcpy (yyformat, yyunexpected);
 
974
 
 
975
      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
 
976
        if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
 
977
          {
 
978
            if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
 
979
              {
 
980
                yycount = 1;
 
981
                yysize = yysize0;
 
982
                yyformat[sizeof yyunexpected - 1] = '\0';
 
983
                break;
 
984
              }
 
985
            yyarg[yycount++] = yytname[yyx];
 
986
            yysize1 = yysize + yytnamerr (0, yytname[yyx]);
 
987
            yysize_overflow |= (yysize1 < yysize);
 
988
            yysize = yysize1;
 
989
            yyfmt = yystpcpy (yyfmt, yyprefix);
 
990
            yyprefix = yyor;
 
991
          }
 
992
 
 
993
      yyf = YY_(yyformat);
 
994
      yysize1 = yysize + yystrlen (yyf);
 
995
      yysize_overflow |= (yysize1 < yysize);
 
996
      yysize = yysize1;
 
997
 
 
998
      if (yysize_overflow)
 
999
        return YYSIZE_MAXIMUM;
 
1000
 
 
1001
      if (yyresult)
 
1002
        {
 
1003
          /* Avoid sprintf, as that infringes on the user's name space.
 
1004
             Don't have undefined behavior even if the translation
 
1005
             produced a string with the wrong number of "%s"s.  */
 
1006
          char *yyp = yyresult;
 
1007
          int yyi = 0;
 
1008
          while ((*yyp = *yyf) != '\0')
 
1009
            {
 
1010
              if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
 
1011
                {
 
1012
                  yyp += yytnamerr (yyp, yyarg[yyi++]);
 
1013
                  yyf += 2;
 
1014
                }
 
1015
              else
 
1016
                {
 
1017
                  yyp++;
 
1018
                  yyf++;
 
1019
                }
 
1020
            }
 
1021
        }
 
1022
      return yysize;
 
1023
    }
 
1024
}
 
1025
#endif /* YYERROR_VERBOSE */
656
1026
 
657
1027
 
658
 
#if YYDEBUG
659
 
/*--------------------------------.
660
 
| Print this symbol on YYOUTPUT.  |
661
 
`--------------------------------*/
662
 
 
663
 
#if defined (__STDC__) || defined (__cplusplus)
664
 
static void
665
 
yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
666
 
#else
667
 
static void
668
 
yysymprint (yyoutput, yytype, yyvaluep)
669
 
    FILE *yyoutput;
670
 
    int yytype;
671
 
    YYSTYPE *yyvaluep;
672
 
#endif
673
 
{
674
 
  /* Pacify ``unused variable'' warnings.  */
675
 
  (void) yyvaluep;
676
 
 
677
 
  if (yytype < YYNTOKENS)
678
 
    {
679
 
      YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
680
 
# ifdef YYPRINT
681
 
      YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
682
 
# endif
683
 
    }
684
 
  else
685
 
    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
686
 
 
687
 
  switch (yytype)
688
 
    {
689
 
      default:
690
 
        break;
691
 
    }
692
 
  YYFPRINTF (yyoutput, ")");
693
 
}
694
 
 
695
 
#endif /* ! YYDEBUG */
696
1028
/*-----------------------------------------------.
697
1029
| Release the memory associated to this symbol.  |
698
1030
`-----------------------------------------------*/
699
1031
 
700
 
#if defined (__STDC__) || defined (__cplusplus)
 
1032
/*ARGSUSED*/
 
1033
#if (defined __STDC__ || defined __C99__FUNC__ \
 
1034
     || defined __cplusplus || defined _MSC_VER)
701
1035
static void
702
 
yydestruct (int yytype, YYSTYPE *yyvaluep)
 
1036
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
703
1037
#else
704
1038
static void
705
 
yydestruct (yytype, yyvaluep)
 
1039
yydestruct (yymsg, yytype, yyvaluep)
 
1040
    const char *yymsg;
706
1041
    int yytype;
707
1042
    YYSTYPE *yyvaluep;
708
1043
#endif
709
1044
{
710
 
  /* Pacify ``unused variable'' warnings.  */
711
 
  (void) yyvaluep;
 
1045
  YYUSE (yyvaluep);
 
1046
 
 
1047
  if (!yymsg)
 
1048
    yymsg = "Deleting";
 
1049
  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
712
1050
 
713
1051
  switch (yytype)
714
1052
    {
715
1053
 
716
1054
      default:
717
 
        break;
 
1055
        break;
718
1056
    }
719
1057
}
720
 
 
721
1058
 
722
1059
/* Prevent warnings from -Wmissing-prototypes.  */
723
 
 
724
1060
#ifdef YYPARSE_PARAM
725
 
# if defined (__STDC__) || defined (__cplusplus)
 
1061
#if defined __STDC__ || defined __cplusplus
726
1062
int yyparse (void *YYPARSE_PARAM);
727
 
# else
 
1063
#else
728
1064
int yyparse ();
729
 
# endif
 
1065
#endif
730
1066
#else /* ! YYPARSE_PARAM */
731
 
#if defined (__STDC__) || defined (__cplusplus)
 
1067
#if defined __STDC__ || defined __cplusplus
732
1068
int yyparse (void);
733
1069
#else
734
1070
int yyparse ();
736
1072
#endif /* ! YYPARSE_PARAM */
737
1073
 
738
1074
 
739
 
 
740
1075
/* The lookahead symbol.  */
741
1076
int yychar;
742
1077
 
748
1083
 
749
1084
 
750
1085
 
751
 
/*----------.
752
 
| yyparse.  |
753
 
`----------*/
 
1086
/*-------------------------.
 
1087
| yyparse or yypush_parse.  |
 
1088
`-------------------------*/
754
1089
 
755
1090
#ifdef YYPARSE_PARAM
756
 
# if defined (__STDC__) || defined (__cplusplus)
757
 
int yyparse (void *YYPARSE_PARAM)
758
 
# else
759
 
int yyparse (YYPARSE_PARAM)
760
 
  void *YYPARSE_PARAM;
761
 
# endif
 
1091
#if (defined __STDC__ || defined __C99__FUNC__ \
 
1092
     || defined __cplusplus || defined _MSC_VER)
 
1093
int
 
1094
yyparse (void *YYPARSE_PARAM)
 
1095
#else
 
1096
int
 
1097
yyparse (YYPARSE_PARAM)
 
1098
    void *YYPARSE_PARAM;
 
1099
#endif
762
1100
#else /* ! YYPARSE_PARAM */
763
 
#if defined (__STDC__) || defined (__cplusplus)
 
1101
#if (defined __STDC__ || defined __C99__FUNC__ \
 
1102
     || defined __cplusplus || defined _MSC_VER)
764
1103
int
765
1104
yyparse (void)
766
1105
#else
770
1109
#endif
771
1110
#endif
772
1111
{
773
 
  
774
 
  register int yystate;
775
 
  register int yyn;
 
1112
 
 
1113
 
 
1114
    int yystate;
 
1115
    /* Number of tokens to shift before error messages enabled.  */
 
1116
    int yyerrstatus;
 
1117
 
 
1118
    /* The stacks and their tools:
 
1119
       `yyss': related to states.
 
1120
       `yyvs': related to semantic values.
 
1121
 
 
1122
       Refer to the stacks thru separate pointers, to allow yyoverflow
 
1123
       to reallocate them elsewhere.  */
 
1124
 
 
1125
    /* The state stack.  */
 
1126
    yytype_int16 yyssa[YYINITDEPTH];
 
1127
    yytype_int16 *yyss;
 
1128
    yytype_int16 *yyssp;
 
1129
 
 
1130
    /* The semantic value stack.  */
 
1131
    YYSTYPE yyvsa[YYINITDEPTH];
 
1132
    YYSTYPE *yyvs;
 
1133
    YYSTYPE *yyvsp;
 
1134
 
 
1135
    YYSIZE_T yystacksize;
 
1136
 
 
1137
  int yyn;
776
1138
  int yyresult;
777
 
  /* Number of tokens to shift before error messages enabled.  */
778
 
  int yyerrstatus;
779
1139
  /* Lookahead token as an internal (translated) token number.  */
780
 
  int yytoken = 0;
781
 
 
782
 
  /* Three stacks and their tools:
783
 
     `yyss': related to states,
784
 
     `yyvs': related to semantic values,
785
 
     `yyls': related to locations.
786
 
 
787
 
     Refer to the stacks thru separate pointers, to allow yyoverflow
788
 
     to reallocate them elsewhere.  */
789
 
 
790
 
  /* The state stack.  */
791
 
  short yyssa[YYINITDEPTH];
792
 
  short *yyss = yyssa;
793
 
  register short *yyssp;
794
 
 
795
 
  /* The semantic value stack.  */
796
 
  YYSTYPE yyvsa[YYINITDEPTH];
797
 
  YYSTYPE *yyvs = yyvsa;
798
 
  register YYSTYPE *yyvsp;
799
 
 
800
 
 
801
 
 
802
 
#define YYPOPSTACK   (yyvsp--, yyssp--)
803
 
 
804
 
  YYSIZE_T yystacksize = YYINITDEPTH;
805
 
 
 
1140
  int yytoken;
806
1141
  /* The variables used to return semantic value and location from the
807
1142
     action routines.  */
808
1143
  YYSTYPE yyval;
809
1144
 
810
 
 
811
 
  /* When reducing, the number of symbols on the RHS of the reduced
812
 
     rule.  */
813
 
  int yylen;
 
1145
#if YYERROR_VERBOSE
 
1146
  /* Buffer for error messages, and its allocated size.  */
 
1147
  char yymsgbuf[128];
 
1148
  char *yymsg = yymsgbuf;
 
1149
  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
 
1150
#endif
 
1151
 
 
1152
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
 
1153
 
 
1154
  /* The number of symbols on the RHS of the reduced rule.
 
1155
     Keep to zero when no symbol should be popped.  */
 
1156
  int yylen = 0;
 
1157
 
 
1158
  yytoken = 0;
 
1159
  yyss = yyssa;
 
1160
  yyvs = yyvsa;
 
1161
  yystacksize = YYINITDEPTH;
814
1162
 
815
1163
  YYDPRINTF ((stderr, "Starting parse\n"));
816
1164
 
817
1165
  yystate = 0;
818
1166
  yyerrstatus = 0;
819
1167
  yynerrs = 0;
820
 
  yychar = YYEMPTY;             /* Cause a token to be read.  */
 
1168
  yychar = YYEMPTY; /* Cause a token to be read.  */
821
1169
 
822
1170
  /* Initialize stack pointers.
823
1171
     Waste one element of value and location stack
824
1172
     so that they stay on the same level as the state stack.
825
1173
     The wasted elements are never initialized.  */
826
 
 
827
1174
  yyssp = yyss;
828
1175
  yyvsp = yyvs;
829
1176
 
834
1181
`------------------------------------------------------------*/
835
1182
 yynewstate:
836
1183
  /* In all cases, when you get here, the value and location stacks
837
 
     have just been pushed. so pushing a state here evens the stacks.
838
 
     */
 
1184
     have just been pushed.  So pushing a state here evens the stacks.  */
839
1185
  yyssp++;
840
1186
 
841
1187
 yysetstate:
848
1194
 
849
1195
#ifdef yyoverflow
850
1196
      {
851
 
        /* Give user a chance to reallocate the stack. Use copies of
 
1197
        /* Give user a chance to reallocate the stack.  Use copies of
852
1198
           these so that the &'s don't force the real ones into
853
1199
           memory.  */
854
1200
        YYSTYPE *yyvs1 = yyvs;
855
 
        short *yyss1 = yyss;
856
 
 
 
1201
        yytype_int16 *yyss1 = yyss;
857
1202
 
858
1203
        /* Each stack pointer address is followed by the size of the
859
1204
           data in use in that stack, in bytes.  This used to be a
860
1205
           conditional around just the two extra args, but that might
861
1206
           be undefined if yyoverflow is a macro.  */
862
 
        yyoverflow ("parser stack overflow",
 
1207
        yyoverflow (YY_("memory exhausted"),
863
1208
                    &yyss1, yysize * sizeof (*yyssp),
864
1209
                    &yyvs1, yysize * sizeof (*yyvsp),
865
 
 
866
1210
                    &yystacksize);
867
1211
 
868
1212
        yyss = yyss1;
870
1214
      }
871
1215
#else /* no yyoverflow */
872
1216
# ifndef YYSTACK_RELOCATE
873
 
      goto yyoverflowlab;
 
1217
      goto yyexhaustedlab;
874
1218
# else
875
1219
      /* Extend the stack our own way.  */
876
1220
      if (YYMAXDEPTH <= yystacksize)
877
 
        goto yyoverflowlab;
 
1221
        goto yyexhaustedlab;
878
1222
      yystacksize *= 2;
879
1223
      if (YYMAXDEPTH < yystacksize)
880
1224
        yystacksize = YYMAXDEPTH;
881
1225
 
882
1226
      {
883
 
        short *yyss1 = yyss;
 
1227
        yytype_int16 *yyss1 = yyss;
884
1228
        union yyalloc *yyptr =
885
1229
          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
886
1230
        if (! yyptr)
887
 
          goto yyoverflowlab;
888
 
        YYSTACK_RELOCATE (yyss);
889
 
        YYSTACK_RELOCATE (yyvs);
890
 
 
 
1231
          goto yyexhaustedlab;
 
1232
        YYSTACK_RELOCATE (yyss_alloc, yyss);
 
1233
        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
891
1234
#  undef YYSTACK_RELOCATE
892
1235
        if (yyss1 != yyssa)
893
1236
          YYSTACK_FREE (yyss1);
898
1241
      yyssp = yyss + yysize - 1;
899
1242
      yyvsp = yyvs + yysize - 1;
900
1243
 
901
 
 
902
1244
      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
903
1245
                  (unsigned long int) yystacksize));
904
1246
 
908
1250
 
909
1251
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
910
1252
 
 
1253
  if (yystate == YYFINAL)
 
1254
    YYACCEPT;
 
1255
 
911
1256
  goto yybackup;
912
1257
 
913
1258
/*-----------.
915
1260
`-----------*/
916
1261
yybackup:
917
1262
 
918
 
/* Do appropriate processing given the current state.  */
919
 
/* Read a lookahead token if we need one and don't already have one.  */
920
 
/* yyresume: */
 
1263
  /* Do appropriate processing given the current state.  Read a
 
1264
     lookahead token if we need one and don't already have one.  */
921
1265
 
922
1266
  /* First try to decide what to do without reference to lookahead token.  */
923
 
 
924
1267
  yyn = yypact[yystate];
925
1268
  if (yyn == YYPACT_NINF)
926
1269
    goto yydefault;
942
1285
  else
943
1286
    {
944
1287
      yytoken = YYTRANSLATE (yychar);
945
 
      YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
 
1288
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
946
1289
    }
947
1290
 
948
1291
  /* If the proper action on seeing token YYTOKEN is to reduce or to
959
1302
      goto yyreduce;
960
1303
    }
961
1304
 
962
 
  if (yyn == YYFINAL)
963
 
    YYACCEPT;
964
 
 
965
 
  /* Shift the lookahead token.  */
966
 
  YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
967
 
 
968
 
  /* Discard the token being shifted unless it is eof.  */
969
 
  if (yychar != YYEOF)
970
 
    yychar = YYEMPTY;
971
 
 
972
 
  *++yyvsp = yylval;
973
 
 
974
 
 
975
1305
  /* Count tokens shifted since error; after three, turn off error
976
1306
     status.  */
977
1307
  if (yyerrstatus)
978
1308
    yyerrstatus--;
979
1309
 
 
1310
  /* Shift the lookahead token.  */
 
1311
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
 
1312
 
 
1313
  /* Discard the shifted token.  */
 
1314
  yychar = YYEMPTY;
 
1315
 
980
1316
  yystate = yyn;
 
1317
  *++yyvsp = yylval;
 
1318
 
981
1319
  goto yynewstate;
982
1320
 
983
1321
 
1013
1351
  switch (yyn)
1014
1352
    {
1015
1353
        case 2:
 
1354
 
 
1355
/* Line 1455 of yacc.c  */
1016
1356
#line 51 "cubeparse.y"
1017
1357
    {
1018
1358
 
1019
1359
            int dim;
1020
1360
            
1021
 
            dim = delim_count(yyvsp[-3], ',') + 1;
1022
 
            if ( (delim_count(yyvsp[-1], ',') + 1) != dim ) {
 
1361
            dim = delim_count((yyvsp[(2) - (5)]), ',') + 1;
 
1362
            if ( (delim_count((yyvsp[(4) - (5)]), ',') + 1) != dim ) {
1023
1363
          ereport(ERROR,
1024
1364
                  (errcode(ERRCODE_SYNTAX_ERROR),
1025
1365
                   errmsg("bad cube representation"),
1026
1366
                   errdetail("Different point dimensions in (%s) and (%s).",
1027
 
                             yyvsp[-3], yyvsp[-1])));
 
1367
                             (yyvsp[(2) - (5)]), (yyvsp[(4) - (5)]))));
1028
1368
              YYABORT;
1029
1369
            }
1030
1370
            if (dim > CUBE_MAX_DIM) {
1036
1376
              YYABORT;
1037
1377
            }
1038
1378
            
1039
 
            *((void **)result) = write_box( dim, yyvsp[-3], yyvsp[-1] );
 
1379
            *((void **)result) = write_box( dim, (yyvsp[(2) - (5)]), (yyvsp[(4) - (5)]) );
1040
1380
    
1041
1381
          ;}
1042
1382
    break;
1043
1383
 
1044
1384
  case 3:
 
1385
 
 
1386
/* Line 1455 of yacc.c  */
1045
1387
#line 77 "cubeparse.y"
1046
1388
    {
1047
1389
            int dim;
1048
1390
 
1049
 
            dim = delim_count(yyvsp[-2], ',') + 1;
 
1391
            dim = delim_count((yyvsp[(1) - (3)]), ',') + 1;
1050
1392
            
1051
 
            if ( (delim_count(yyvsp[0], ',') + 1) != dim ) {
 
1393
            if ( (delim_count((yyvsp[(3) - (3)]), ',') + 1) != dim ) {
1052
1394
          ereport(ERROR,
1053
1395
                  (errcode(ERRCODE_SYNTAX_ERROR),
1054
1396
                   errmsg("bad cube representation"),
1055
1397
                   errdetail("Different point dimensions in (%s) and (%s).",
1056
 
                             yyvsp[-2], yyvsp[0])));
 
1398
                             (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]))));
1057
1399
              YYABORT;
1058
1400
            }
1059
1401
            if (dim > CUBE_MAX_DIM) {
1065
1407
              YYABORT;
1066
1408
            }
1067
1409
            
1068
 
            *((void **)result) = write_box( dim, yyvsp[-2], yyvsp[0] );
 
1410
            *((void **)result) = write_box( dim, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]) );
1069
1411
          ;}
1070
1412
    break;
1071
1413
 
1072
1414
  case 4:
 
1415
 
 
1416
/* Line 1455 of yacc.c  */
1073
1417
#line 103 "cubeparse.y"
1074
1418
    {
1075
1419
            int dim;
1076
1420
 
1077
 
            dim = delim_count(yyvsp[0], ',') + 1;
 
1421
            dim = delim_count((yyvsp[(1) - (1)]), ',') + 1;
1078
1422
            if (dim > CUBE_MAX_DIM) {
1079
1423
              ereport(ERROR,
1080
1424
                      (errcode(ERRCODE_SYNTAX_ERROR),
1084
1428
              YYABORT;
1085
1429
            }
1086
1430
 
1087
 
            *((void **)result) = write_point_as_box(yyvsp[0], dim);
 
1431
            *((void **)result) = write_point_as_box((yyvsp[(1) - (1)]), dim);
1088
1432
          ;}
1089
1433
    break;
1090
1434
 
1091
1435
  case 5:
 
1436
 
 
1437
/* Line 1455 of yacc.c  */
1092
1438
#line 121 "cubeparse.y"
1093
1439
    {
1094
1440
            int dim;
1095
1441
 
1096
 
            dim = delim_count(yyvsp[0], ',') + 1;
 
1442
            dim = delim_count((yyvsp[(1) - (1)]), ',') + 1;
1097
1443
            if (dim > CUBE_MAX_DIM) {
1098
1444
              ereport(ERROR,
1099
1445
                      (errcode(ERRCODE_SYNTAX_ERROR),
1102
1448
                                 CUBE_MAX_DIM)));
1103
1449
              YYABORT;
1104
1450
            }
1105
 
            *((void **)result) = write_point_as_box(yyvsp[0], dim);
 
1451
            *((void **)result) = write_point_as_box((yyvsp[(1) - (1)]), dim);
1106
1452
          ;}
1107
1453
    break;
1108
1454
 
1109
1455
  case 6:
 
1456
 
 
1457
/* Line 1455 of yacc.c  */
1110
1458
#line 138 "cubeparse.y"
1111
1459
    {
1112
 
             yyval = yyvsp[-1];
 
1460
             (yyval) = (yyvsp[(2) - (3)]);
1113
1461
          ;}
1114
1462
    break;
1115
1463
 
1116
1464
  case 7:
 
1465
 
 
1466
/* Line 1455 of yacc.c  */
1117
1467
#line 144 "cubeparse.y"
1118
1468
    {
1119
1469
                         /* alloc enough space to be sure whole list will fit */
1120
 
             yyval = palloc(scanbuflen + 1);
1121
 
                         strcpy(yyval, yyvsp[0]);
 
1470
             (yyval) = palloc(scanbuflen + 1);
 
1471
                         strcpy((yyval), (yyvsp[(1) - (1)]));
1122
1472
          ;}
1123
1473
    break;
1124
1474
 
1125
1475
  case 8:
 
1476
 
 
1477
/* Line 1455 of yacc.c  */
1126
1478
#line 150 "cubeparse.y"
1127
1479
    {
1128
 
             yyval = yyvsp[-2];
1129
 
             strcat(yyval, ",");
1130
 
             strcat(yyval, yyvsp[0]);
 
1480
             (yyval) = (yyvsp[(1) - (3)]);
 
1481
             strcat((yyval), ",");
 
1482
             strcat((yyval), (yyvsp[(3) - (3)]));
1131
1483
          ;}
1132
1484
    break;
1133
1485
 
1134
1486
 
 
1487
 
 
1488
/* Line 1455 of yacc.c  */
 
1489
#line 1490 "cubeparse.c"
 
1490
      default: break;
1135
1491
    }
1136
 
 
1137
 
/* Line 991 of yacc.c.  */
1138
 
#line 1138 "cubeparse.c"
1139
 
 
1140
 
  yyvsp -= yylen;
1141
 
  yyssp -= yylen;
1142
 
 
1143
 
 
 
1492
  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
 
1493
 
 
1494
  YYPOPSTACK (yylen);
 
1495
  yylen = 0;
1144
1496
  YY_STACK_PRINT (yyss, yyssp);
1145
1497
 
1146
1498
  *++yyvsp = yyval;
1147
1499
 
1148
 
 
1149
1500
  /* Now `shift' the result of the reduction.  Determine what state
1150
1501
     that goes to, based on the state we popped back to and the rule
1151
1502
     number reduced by.  */
1169
1520
  if (!yyerrstatus)
1170
1521
    {
1171
1522
      ++yynerrs;
1172
 
#if YYERROR_VERBOSE
1173
 
      yyn = yypact[yystate];
1174
 
 
1175
 
      if (YYPACT_NINF < yyn && yyn < YYLAST)
1176
 
        {
1177
 
          YYSIZE_T yysize = 0;
1178
 
          int yytype = YYTRANSLATE (yychar);
1179
 
          char *yymsg;
1180
 
          int yyx, yycount;
1181
 
 
1182
 
          yycount = 0;
1183
 
          /* Start YYX at -YYN if negative to avoid negative indexes in
1184
 
             YYCHECK.  */
1185
 
          for (yyx = yyn < 0 ? -yyn : 0;
1186
 
               yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1187
 
            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1188
 
              yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1189
 
          yysize += yystrlen ("syntax error, unexpected ") + 1;
1190
 
          yysize += yystrlen (yytname[yytype]);
1191
 
          yymsg = (char *) YYSTACK_ALLOC (yysize);
1192
 
          if (yymsg != 0)
1193
 
            {
1194
 
              char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
1195
 
              yyp = yystpcpy (yyp, yytname[yytype]);
1196
 
 
1197
 
              if (yycount < 5)
1198
 
                {
1199
 
                  yycount = 0;
1200
 
                  for (yyx = yyn < 0 ? -yyn : 0;
1201
 
                       yyx < (int) (sizeof (yytname) / sizeof (char *));
1202
 
                       yyx++)
1203
 
                    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1204
 
                      {
1205
 
                        const char *yyq = ! yycount ? ", expecting " : " or ";
1206
 
                        yyp = yystpcpy (yyp, yyq);
1207
 
                        yyp = yystpcpy (yyp, yytname[yyx]);
1208
 
                        yycount++;
1209
 
                      }
1210
 
                }
1211
 
              yyerror (yymsg);
 
1523
#if ! YYERROR_VERBOSE
 
1524
      yyerror (YY_("syntax error"));
 
1525
#else
 
1526
      {
 
1527
        YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
 
1528
        if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
 
1529
          {
 
1530
            YYSIZE_T yyalloc = 2 * yysize;
 
1531
            if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
 
1532
              yyalloc = YYSTACK_ALLOC_MAXIMUM;
 
1533
            if (yymsg != yymsgbuf)
1212
1534
              YYSTACK_FREE (yymsg);
1213
 
            }
1214
 
          else
1215
 
            yyerror ("syntax error; also virtual memory exhausted");
1216
 
        }
1217
 
      else
1218
 
#endif /* YYERROR_VERBOSE */
1219
 
        yyerror ("syntax error");
 
1535
            yymsg = (char *) YYSTACK_ALLOC (yyalloc);
 
1536
            if (yymsg)
 
1537
              yymsg_alloc = yyalloc;
 
1538
            else
 
1539
              {
 
1540
                yymsg = yymsgbuf;
 
1541
                yymsg_alloc = sizeof yymsgbuf;
 
1542
              }
 
1543
          }
 
1544
 
 
1545
        if (0 < yysize && yysize <= yymsg_alloc)
 
1546
          {
 
1547
            (void) yysyntax_error (yymsg, yystate, yychar);
 
1548
            yyerror (yymsg);
 
1549
          }
 
1550
        else
 
1551
          {
 
1552
            yyerror (YY_("syntax error"));
 
1553
            if (yysize != 0)
 
1554
              goto yyexhaustedlab;
 
1555
          }
 
1556
      }
 
1557
#endif
1220
1558
    }
1221
1559
 
1222
1560
 
1226
1564
      /* If just tried and failed to reuse lookahead token after an
1227
1565
         error, discard it.  */
1228
1566
 
1229
 
      /* Return failure if at end of input.  */
1230
 
      if (yychar == YYEOF)
1231
 
        {
1232
 
          /* Pop the error token.  */
1233
 
          YYPOPSTACK;
1234
 
          /* Pop the rest of the stack.  */
1235
 
          while (yyss < yyssp)
1236
 
            {
1237
 
              YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1238
 
              yydestruct (yystos[*yyssp], yyvsp);
1239
 
              YYPOPSTACK;
1240
 
            }
1241
 
          YYABORT;
1242
 
        }
1243
 
 
1244
 
      YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
1245
 
      yydestruct (yytoken, &yylval);
1246
 
      yychar = YYEMPTY;
1247
 
 
 
1567
      if (yychar <= YYEOF)
 
1568
        {
 
1569
          /* Return failure if at end of input.  */
 
1570
          if (yychar == YYEOF)
 
1571
            YYABORT;
 
1572
        }
 
1573
      else
 
1574
        {
 
1575
          yydestruct ("Error: discarding",
 
1576
                      yytoken, &yylval);
 
1577
          yychar = YYEMPTY;
 
1578
        }
1248
1579
    }
1249
1580
 
1250
1581
  /* Else will try to reuse lookahead token after shifting the error
1251
1582
     token.  */
1252
 
  goto yyerrlab2;
1253
 
 
1254
 
 
1255
 
/*----------------------------------------------------.
1256
 
| yyerrlab1 -- error raised explicitly by an action.  |
1257
 
`----------------------------------------------------*/
 
1583
  goto yyerrlab1;
 
1584
 
 
1585
 
 
1586
/*---------------------------------------------------.
 
1587
| yyerrorlab -- error raised explicitly by YYERROR.  |
 
1588
`---------------------------------------------------*/
 
1589
yyerrorlab:
 
1590
 
 
1591
  /* Pacify compilers like GCC when the user code never invokes
 
1592
     YYERROR and the label yyerrorlab therefore never appears in user
 
1593
     code.  */
 
1594
  if (/*CONSTCOND*/ 0)
 
1595
     goto yyerrorlab;
 
1596
 
 
1597
  /* Do not reclaim the symbols of the rule which action triggered
 
1598
     this YYERROR.  */
 
1599
  YYPOPSTACK (yylen);
 
1600
  yylen = 0;
 
1601
  YY_STACK_PRINT (yyss, yyssp);
 
1602
  yystate = *yyssp;
 
1603
  goto yyerrlab1;
 
1604
 
 
1605
 
 
1606
/*-------------------------------------------------------------.
 
1607
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
 
1608
`-------------------------------------------------------------*/
1258
1609
yyerrlab1:
1259
 
 
1260
 
  /* Suppress GCC warning that yyerrlab1 is unused when no action
1261
 
     invokes YYERROR.  */
1262
 
#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
1263
 
  __attribute__ ((__unused__))
1264
 
#endif
1265
 
 
1266
 
 
1267
 
  goto yyerrlab2;
1268
 
 
1269
 
 
1270
 
/*---------------------------------------------------------------.
1271
 
| yyerrlab2 -- pop states until the error token can be shifted.  |
1272
 
`---------------------------------------------------------------*/
1273
 
yyerrlab2:
1274
1610
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
1275
1611
 
1276
1612
  for (;;)
1291
1627
      if (yyssp == yyss)
1292
1628
        YYABORT;
1293
1629
 
1294
 
      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1295
 
      yydestruct (yystos[yystate], yyvsp);
1296
 
      yyvsp--;
1297
 
      yystate = *--yyssp;
1298
1630
 
 
1631
      yydestruct ("Error: popping",
 
1632
                  yystos[yystate], yyvsp);
 
1633
      YYPOPSTACK (1);
 
1634
      yystate = *yyssp;
1299
1635
      YY_STACK_PRINT (yyss, yyssp);
1300
1636
    }
1301
1637
 
1302
 
  if (yyn == YYFINAL)
1303
 
    YYACCEPT;
1304
 
 
1305
 
  YYDPRINTF ((stderr, "Shifting error token, "));
1306
 
 
1307
1638
  *++yyvsp = yylval;
1308
1639
 
1309
1640
 
 
1641
  /* Shift the error token.  */
 
1642
  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
 
1643
 
1310
1644
  yystate = yyn;
1311
1645
  goto yynewstate;
1312
1646
 
1325
1659
  yyresult = 1;
1326
1660
  goto yyreturn;
1327
1661
 
1328
 
#ifndef yyoverflow
1329
 
/*----------------------------------------------.
1330
 
| yyoverflowlab -- parser overflow comes here.  |
1331
 
`----------------------------------------------*/
1332
 
yyoverflowlab:
1333
 
  yyerror ("parser stack overflow");
 
1662
#if !defined(yyoverflow) || YYERROR_VERBOSE
 
1663
/*-------------------------------------------------.
 
1664
| yyexhaustedlab -- memory exhaustion comes here.  |
 
1665
`-------------------------------------------------*/
 
1666
yyexhaustedlab:
 
1667
  yyerror (YY_("memory exhausted"));
1334
1668
  yyresult = 2;
1335
1669
  /* Fall through.  */
1336
1670
#endif
1337
1671
 
1338
1672
yyreturn:
 
1673
  if (yychar != YYEMPTY)
 
1674
     yydestruct ("Cleanup: discarding lookahead",
 
1675
                 yytoken, &yylval);
 
1676
  /* Do not reclaim the symbols of the rule which action triggered
 
1677
     this YYABORT or YYACCEPT.  */
 
1678
  YYPOPSTACK (yylen);
 
1679
  YY_STACK_PRINT (yyss, yyssp);
 
1680
  while (yyssp != yyss)
 
1681
    {
 
1682
      yydestruct ("Cleanup: popping",
 
1683
                  yystos[*yyssp], yyvsp);
 
1684
      YYPOPSTACK (1);
 
1685
    }
1339
1686
#ifndef yyoverflow
1340
1687
  if (yyss != yyssa)
1341
1688
    YYSTACK_FREE (yyss);
1342
1689
#endif
1343
 
  return yyresult;
 
1690
#if YYERROR_VERBOSE
 
1691
  if (yymsg != yymsgbuf)
 
1692
    YYSTACK_FREE (yymsg);
 
1693
#endif
 
1694
  /* Make sure YYID is used.  */
 
1695
  return YYID (yyresult);
1344
1696
}
1345
1697
 
1346
1698
 
 
1699
 
 
1700
/* Line 1675 of yacc.c  */
1347
1701
#line 157 "cubeparse.y"
1348
1702
 
1349
1703
 
1420
1774
 
1421
1775
#include "cubescan.c"
1422
1776
 
1423