1
/* A Bison parser, made by GNU Bison 1.875. */
3
/* Skeleton parser for Yacc-like parsing with Bison,
4
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
6
This program is free software; you can redistribute it and/or modify
2
/* A Bison parser, made by GNU Bison 2.4.1. */
4
/* Skeleton implementation for Bison's Yacc-like parsers in C
6
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7
Free Software Foundation, Inc.
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)
11
the Free Software Foundation, either version 3 of the License, or
12
(at your option) any later version.
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.
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. */
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. */
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/>. */
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.
32
This special exception was added by the Free Software Foundation in
33
version 2.2 of Bison. */
35
/* C LALR(1) parser skeleton written by Richard Stallman, by
36
simplifying the original so-called "semantic" parser. */
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. */
49
#define YYBISON_VERSION "2.4.1"
39
51
/* Skeleton name. */
40
52
#define YYSKELETON_NAME "yacc.c"
42
54
/* Pure parsers. */
45
63
/* Using locations. */
46
64
#define YYLSP_NEEDED 0
48
/* If NAME_PREFIX is specified substitute the variables and functions
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
62
/* Put the tokens into the symbol table, so that GDB and other debuggers
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
83
76
/* Copy the first part of user declarations. */
78
/* Line 189 of yacc.c */
84
79
#line 1 "cubeparse.y"
86
81
/* NdBox = [(lowerleft),(upperright)] */
134
132
# define YYERROR_VERBOSE 0
137
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
135
/* Enabling the token table. */
136
#ifndef YYTOKEN_TABLE
137
# define YYTOKEN_TABLE 0
144
/* Put the tokens into the symbol table, so that GDB and other debuggers
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
146
166
/* Copy the second part of user declarations. */
149
/* Line 214 of yacc.c. */
150
#line 150 "cubeparse.c"
152
#if ! defined (yyoverflow) || YYERROR_VERBOSE
169
/* Line 264 of yacc.c */
170
#line 171 "cubeparse.c"
177
typedef YYTYPE_UINT8 yytype_uint8;
179
typedef unsigned char yytype_uint8;
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;
188
typedef short int yytype_int8;
192
typedef YYTYPE_UINT16 yytype_uint16;
194
typedef unsigned short int yytype_uint16;
198
typedef YYTYPE_INT16 yytype_int16;
200
typedef short int yytype_int16;
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
213
# define YYSIZE_T unsigned int
217
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
222
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
223
# define YY_(msgid) dgettext ("bison-runtime", msgid)
227
# define YY_(msgid) msgid
231
/* Suppress unused-variable warnings by "using" E. */
232
#if ! defined lint || defined __GNUC__
233
# define YYUSE(e) ((void) (e))
235
# define YYUSE(e) /* empty */
238
/* Identity function, used to suppress warnings about constant conditions. */
242
#if (defined __STDC__ || defined __C99__FUNC__ \
243
|| defined __cplusplus || defined _MSC_VER)
256
#if ! defined yyoverflow || YYERROR_VERBOSE
154
258
/* The parser invokes alloca or malloc; define the necessary symbols. */
156
# if YYSTACK_USE_ALLOCA
157
# define YYSTACK_ALLOC alloca
159
# ifndef YYSTACK_USE_ALLOCA
160
# if defined (alloca) || defined (_ALLOCA_H)
260
# ifdef YYSTACK_USE_ALLOCA
261
# if YYSTACK_USE_ALLOCA
263
# define YYSTACK_ALLOC __builtin_alloca
264
# elif defined __BUILTIN_VA_ARG_INCR
265
# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
267
# define YYSTACK_ALLOC __alloca
268
# elif defined _MSC_VER
269
# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
270
# define alloca _alloca
161
272
# define YYSTACK_ALLOC alloca
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 */
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 */
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
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
178
# define YYSTACK_ALLOC malloc
179
# define YYSTACK_FREE free
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 */
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 */
181
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
184
#if (! defined (yyoverflow) \
185
&& (! defined (__cplusplus) \
186
|| (YYSTYPE_IS_TRIVIAL)))
323
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
326
#if (! defined yyoverflow \
327
&& (! defined __cplusplus \
328
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
188
330
/* A type that is properly aligned for any stack member. */
333
yytype_int16 yyss_alloc;
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)
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
227
# define YYSTACK_RELOCATE(Stack) \
369
# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
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); \
240
#if defined (__STDC__) || defined (__cplusplus)
241
typedef signed char yysigned_char;
243
typedef short yysigned_char;
246
/* YYFINAL -- State number of the termination state. */
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
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. */
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
260
396
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
261
397
#define YYUNDEFTOK 2
262
398
#define YYMAXUTOK 263
264
#define YYTRANSLATE(YYX) \
400
#define YYTRANSLATE(YYX) \
265
401
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
267
403
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
268
static const unsigned char yytranslate[] =
404
static const yytype_uint8 yytranslate[] =
270
406
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
271
407
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
300
436
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
302
static const unsigned char yyprhs[] =
438
static const yytype_uint8 yyprhs[] =
304
440
0, 0, 3, 9, 13, 15, 17, 21, 23
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[] =
310
446
10, 0, -1, 6, 11, 8, 11, 7, -1, 11,
311
447
8, 11, -1, 11, -1, 12, -1, 4, 12, 5,
315
451
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
316
static const unsigned char yyrline[] =
452
static const yytype_uint8 yyrline[] =
318
454
0, 51, 51, 77, 103, 121, 138, 144, 150
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[] =
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",
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[] =
338
474
0, 256, 257, 258, 259, 260, 261, 262, 263
342
478
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
343
static const unsigned char yyr1[] =
479
static const yytype_uint8 yyr1[] =
345
481
0, 9, 10, 10, 10, 10, 11, 12, 12
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[] =
351
487
0, 2, 5, 3, 1, 1, 3, 1, 3
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[] =
391
527
8, 1, 2, 2, 3, 12, 1, 14, 11, 9,
392
528
16, 15, 10, 11, 13, 7, 0, 17
395
static const yysigned_char yycheck[] =
531
static const yytype_int8 yycheck[] =
397
533
3, 3, 4, 4, 6, 5, 3, 10, 8, 0,
398
534
13, 3, 8, 8, 8, 2, -1, 7
446
567
yychar = (Token); \
447
568
yylval = (Value); \
448
569
yytoken = YYTRANSLATE (yychar); \
454
yyerror ("syntax error: cannot back up");\
575
yyerror (YY_("syntax error: cannot back up")); \
459
581
#define YYTERROR 1
460
582
#define YYERRCODE 256
462
/* YYLLOC_DEFAULT -- Compute the default location (before the actions
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). */
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;
591
# define YYLLOC_DEFAULT(Current, Rhs, N) \
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; \
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; \
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. */
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)
622
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
473
627
/* YYLEX -- calling `yylex' with the right arguments. */
492
646
YYFPRINTF Args; \
495
# define YYDSYMPRINT(Args) \
501
# define YYDSYMPRINTF(Title, Token, Value, Location) \
505
YYFPRINTF (stderr, "%s ", Title); \
506
yysymprint (stderr, \
508
YYFPRINTF (stderr, "\n"); \
649
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
653
YYFPRINTF (stderr, "%s ", Title); \
654
yy_symbol_print (stderr, \
656
YYFPRINTF (stderr, "\n"); \
661
/*--------------------------------.
662
| Print this symbol on YYOUTPUT. |
663
`--------------------------------*/
666
#if (defined __STDC__ || defined __C99__FUNC__ \
667
|| defined __cplusplus || defined _MSC_VER)
669
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
672
yy_symbol_value_print (yyoutput, yytype, yyvaluep)
675
YYSTYPE const * const yyvaluep;
681
if (yytype < YYNTOKENS)
682
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
694
/*--------------------------------.
695
| Print this symbol on YYOUTPUT. |
696
`--------------------------------*/
698
#if (defined __STDC__ || defined __C99__FUNC__ \
699
|| defined __cplusplus || defined _MSC_VER)
701
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
704
yy_symbol_print (yyoutput, yytype, yyvaluep)
707
YYSTYPE const * const yyvaluep;
710
if (yytype < YYNTOKENS)
711
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
713
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
715
yy_symbol_value_print (yyoutput, yytype, yyvaluep);
716
YYFPRINTF (yyoutput, ")");
512
719
/*------------------------------------------------------------------.
513
720
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
515
722
`------------------------------------------------------------------*/
517
#if defined (__STDC__) || defined (__cplusplus)
724
#if (defined __STDC__ || defined __C99__FUNC__ \
725
|| defined __cplusplus || defined _MSC_VER)
519
yy_stack_print (short *bottom, short *top)
727
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
522
yy_stack_print (bottom, top)
730
yy_stack_print (yybottom, yytop)
731
yytype_int16 *yybottom;
527
735
YYFPRINTF (stderr, "Stack now");
528
for (/* Nothing. */; bottom <= top; ++bottom)
529
YYFPRINTF (stderr, " %d", *bottom);
736
for (; yybottom <= yytop; yybottom++)
738
int yybot = *yybottom;
739
YYFPRINTF (stderr, " %d", yybot);
530
741
YYFPRINTF (stderr, "\n");
536
747
yy_stack_print ((Bottom), (Top)); \
540
751
/*------------------------------------------------.
541
752
| Report that the YYRULE is going to be reduced. |
542
753
`------------------------------------------------*/
544
#if defined (__STDC__) || defined (__cplusplus)
755
#if (defined __STDC__ || defined __C99__FUNC__ \
756
|| defined __cplusplus || defined _MSC_VER)
546
yy_reduce_print (int yyrule)
758
yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
549
yy_reduce_print (yyrule)
761
yy_reduce_print (yyvsp, yyrule)
766
int yynrhs = yyr2[yyrule];
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",
771
/* The symbols being reduced. */
772
for (yyi = 0; yyi < yynrhs; yyi++)
774
YYFPRINTF (stderr, " $%d = ", yyi + 1);
775
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
776
&(yyvsp[(yyi + 1) - (yynrhs)])
778
YYFPRINTF (stderr, "\n");
563
782
# define YY_REDUCE_PRINT(Rule) \
566
yy_reduce_print (Rule); \
785
yy_reduce_print (yyvsp, Rule); \
569
788
/* Nonzero means print parse trace. It is left uninitialized so that
570
789
multiple parsers can coexist. */
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 */
603
817
#if YYERROR_VERBOSE
605
819
# ifndef yystrlen
606
# if defined (__GLIBC__) && defined (_STRING_H)
820
# if defined __GLIBC__ && defined _STRING_H
607
821
# define yystrlen strlen
609
823
/* Return the length of YYSTR. */
824
#if (defined __STDC__ || defined __C99__FUNC__ \
825
|| defined __cplusplus || defined _MSC_VER)
611
# if defined (__STDC__) || defined (__cplusplus)
612
827
yystrlen (const char *yystr)
618
register const char *yys = yystr;
620
while (*yys++ != '\0')
835
for (yylen = 0; yystr[yylen]; yylen++)
623
return yys - yystr - 1;
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
632
846
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
848
#if (defined __STDC__ || defined __C99__FUNC__ \
849
|| defined __cplusplus || defined _MSC_VER)
635
# if defined (__STDC__) || defined (__cplusplus)
636
851
yystpcpy (char *yydest, const char *yysrc)
638
854
yystpcpy (yydest, yysrc)
643
register char *yyd = yydest;
644
register const char *yys = yysrc;
860
const char *yys = yysrc;
646
862
while ((*yyd++ = *yys++) != '\0')
654
#endif /* !YYERROR_VERBOSE */
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
879
yytnamerr (char *yyres, const char *yystr)
884
char const *yyp = yystr;
891
goto do_not_strip_quotes;
895
goto do_not_strip_quotes;
908
do_not_strip_quotes: ;
912
return yystrlen (yystr);
914
return yystpcpy (yyres, yystr) - yyres;
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
926
yysyntax_error (char *yyresult, int yystate, int yychar)
928
int yyn = yypact[yystate];
930
if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
934
int yytype = YYTRANSLATE (yychar);
935
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
936
YYSIZE_T yysize = yysize0;
938
int yysize_overflow = 0;
939
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
940
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
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");
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;
963
/* Start YYX at -YYN if negative to avoid negative indexes in
965
int yyxbegin = yyn < 0 ? -yyn : 0;
967
/* Stay within bounds of both yycheck and yytname. */
968
int yychecklim = YYLAST - yyn + 1;
969
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
972
yyarg[0] = yytname[yytype];
973
yyfmt = yystpcpy (yyformat, yyunexpected);
975
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
976
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
978
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
982
yyformat[sizeof yyunexpected - 1] = '\0';
985
yyarg[yycount++] = yytname[yyx];
986
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
987
yysize_overflow |= (yysize1 < yysize);
989
yyfmt = yystpcpy (yyfmt, yyprefix);
994
yysize1 = yysize + yystrlen (yyf);
995
yysize_overflow |= (yysize1 < yysize);
999
return YYSIZE_MAXIMUM;
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;
1008
while ((*yyp = *yyf) != '\0')
1010
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1012
yyp += yytnamerr (yyp, yyarg[yyi++]);
1025
#endif /* YYERROR_VERBOSE */
659
/*--------------------------------.
660
| Print this symbol on YYOUTPUT. |
661
`--------------------------------*/
663
#if defined (__STDC__) || defined (__cplusplus)
665
yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
668
yysymprint (yyoutput, yytype, yyvaluep)
674
/* Pacify ``unused variable'' warnings. */
677
if (yytype < YYNTOKENS)
679
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
681
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
685
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
692
YYFPRINTF (yyoutput, ")");
695
#endif /* ! YYDEBUG */
696
1028
/*-----------------------------------------------.
697
1029
| Release the memory associated to this symbol. |
698
1030
`-----------------------------------------------*/
700
#if defined (__STDC__) || defined (__cplusplus)
1033
#if (defined __STDC__ || defined __C99__FUNC__ \
1034
|| defined __cplusplus || defined _MSC_VER)
702
yydestruct (int yytype, YYSTYPE *yyvaluep)
1036
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
705
yydestruct (yytype, yyvaluep)
1039
yydestruct (yymsg, yytype, yyvaluep)
707
1042
YYSTYPE *yyvaluep;
710
/* Pacify ``unused variable'' warnings. */
1049
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
722
1059
/* Prevent warnings from -Wmissing-prototypes. */
724
1060
#ifdef YYPARSE_PARAM
725
# if defined (__STDC__) || defined (__cplusplus)
1061
#if defined __STDC__ || defined __cplusplus
726
1062
int yyparse (void *YYPARSE_PARAM);
730
1066
#else /* ! YYPARSE_PARAM */
731
#if defined (__STDC__) || defined (__cplusplus)
1067
#if defined __STDC__ || defined __cplusplus
732
1068
int yyparse (void);
774
register int yystate;
1115
/* Number of tokens to shift before error messages enabled. */
1118
/* The stacks and their tools:
1119
`yyss': related to states.
1120
`yyvs': related to semantic values.
1122
Refer to the stacks thru separate pointers, to allow yyoverflow
1123
to reallocate them elsewhere. */
1125
/* The state stack. */
1126
yytype_int16 yyssa[YYINITDEPTH];
1128
yytype_int16 *yyssp;
1130
/* The semantic value stack. */
1131
YYSTYPE yyvsa[YYINITDEPTH];
1135
YYSIZE_T yystacksize;
777
/* Number of tokens to shift before error messages enabled. */
779
1139
/* Lookahead token as an internal (translated) token number. */
782
/* Three stacks and their tools:
783
`yyss': related to states,
784
`yyvs': related to semantic values,
785
`yyls': related to locations.
787
Refer to the stacks thru separate pointers, to allow yyoverflow
788
to reallocate them elsewhere. */
790
/* The state stack. */
791
short yyssa[YYINITDEPTH];
793
register short *yyssp;
795
/* The semantic value stack. */
796
YYSTYPE yyvsa[YYINITDEPTH];
797
YYSTYPE *yyvs = yyvsa;
798
register YYSTYPE *yyvsp;
802
#define YYPOPSTACK (yyvsp--, yyssp--)
804
YYSIZE_T yystacksize = YYINITDEPTH;
806
1141
/* The variables used to return semantic value and location from the
807
1142
action routines. */
811
/* When reducing, the number of symbols on the RHS of the reduced
1146
/* Buffer for error messages, and its allocated size. */
1148
char *yymsg = yymsgbuf;
1149
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1152
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1154
/* The number of symbols on the RHS of the reduced rule.
1155
Keep to zero when no symbol should be popped. */
1161
yystacksize = YYINITDEPTH;
815
1163
YYDPRINTF ((stderr, "Starting parse\n"));
818
1166
yyerrstatus = 0;
820
yychar = YYEMPTY; /* Cause a token to be read. */
1168
yychar = YYEMPTY; /* Cause a token to be read. */
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. */
1102
1448
CUBE_MAX_DIM)));
1105
*((void **)result) = write_point_as_box(yyvsp[0], dim);
1451
*((void **)result) = write_point_as_box((yyvsp[(1) - (1)]), dim);
1457
/* Line 1455 of yacc.c */
1110
1458
#line 138 "cubeparse.y"
1460
(yyval) = (yyvsp[(2) - (3)]);
1466
/* Line 1455 of yacc.c */
1117
1467
#line 144 "cubeparse.y"
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)]));
1477
/* Line 1455 of yacc.c */
1126
1478
#line 150 "cubeparse.y"
1130
strcat(yyval, yyvsp[0]);
1480
(yyval) = (yyvsp[(1) - (3)]);
1481
strcat((yyval), ",");
1482
strcat((yyval), (yyvsp[(3) - (3)]));
1488
/* Line 1455 of yacc.c */
1489
#line 1490 "cubeparse.c"
1137
/* Line 991 of yacc.c. */
1138
#line 1138 "cubeparse.c"
1492
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1144
1496
YY_STACK_PRINT (yyss, yyssp);
1146
1498
*++yyvsp = yyval;
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)
1173
yyn = yypact[yystate];
1175
if (YYPACT_NINF < yyn && yyn < YYLAST)
1177
YYSIZE_T yysize = 0;
1178
int yytype = YYTRANSLATE (yychar);
1183
/* Start YYX at -YYN if negative to avoid negative indexes in
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);
1194
char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
1195
yyp = yystpcpy (yyp, yytname[yytype]);
1200
for (yyx = yyn < 0 ? -yyn : 0;
1201
yyx < (int) (sizeof (yytname) / sizeof (char *));
1203
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1205
const char *yyq = ! yycount ? ", expecting " : " or ";
1206
yyp = yystpcpy (yyp, yyq);
1207
yyp = yystpcpy (yyp, yytname[yyx]);
1523
#if ! YYERROR_VERBOSE
1524
yyerror (YY_("syntax error"));
1527
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1528
if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
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);
1215
yyerror ("syntax error; also virtual memory exhausted");
1218
#endif /* YYERROR_VERBOSE */
1219
yyerror ("syntax error");
1535
yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1537
yymsg_alloc = yyalloc;
1541
yymsg_alloc = sizeof yymsgbuf;
1545
if (0 < yysize && yysize <= yymsg_alloc)
1547
(void) yysyntax_error (yymsg, yystate, yychar);
1552
yyerror (YY_("syntax error"));
1554
goto yyexhaustedlab;
1226
1564
/* If just tried and failed to reuse lookahead token after an
1227
1565
error, discard it. */
1229
/* Return failure if at end of input. */
1230
if (yychar == YYEOF)
1232
/* Pop the error token. */
1234
/* Pop the rest of the stack. */
1235
while (yyss < yyssp)
1237
YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1238
yydestruct (yystos[*yyssp], yyvsp);
1244
YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
1245
yydestruct (yytoken, &yylval);
1567
if (yychar <= YYEOF)
1569
/* Return failure if at end of input. */
1570
if (yychar == YYEOF)
1575
yydestruct ("Error: discarding",
1250
1581
/* Else will try to reuse lookahead token after shifting the error
1255
/*----------------------------------------------------.
1256
| yyerrlab1 -- error raised explicitly by an action. |
1257
`----------------------------------------------------*/
1586
/*---------------------------------------------------.
1587
| yyerrorlab -- error raised explicitly by YYERROR. |
1588
`---------------------------------------------------*/
1591
/* Pacify compilers like GCC when the user code never invokes
1592
YYERROR and the label yyerrorlab therefore never appears in user
1594
if (/*CONSTCOND*/ 0)
1597
/* Do not reclaim the symbols of the rule which action triggered
1601
YY_STACK_PRINT (yyss, yyssp);
1606
/*-------------------------------------------------------------.
1607
| yyerrlab1 -- common code for both syntax error and YYERROR. |
1608
`-------------------------------------------------------------*/
1260
/* Suppress GCC warning that yyerrlab1 is unused when no action
1262
#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
1263
__attribute__ ((__unused__))
1270
/*---------------------------------------------------------------.
1271
| yyerrlab2 -- pop states until the error token can be shifted. |
1272
`---------------------------------------------------------------*/
1274
1610
yyerrstatus = 3; /* Each real token shifted decrements this. */