Grammar.cpp
Go to the documentation of this file.
1/* A Bison parser, made by GNU Bison 2.7. */
2
3/* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
6
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20/* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
29
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
32
33/* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
35
36/* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
42
43/* Identify Bison output. */
44#define YYBISON 1
45
46/* Bison version. */
47#define YYBISON_VERSION "2.7"
48
49/* Skeleton name. */
50#define YYSKELETON_NAME "yacc.c"
51
52/* Pure parsers. */
53#define YYPURE 1
54
55/* Push parsers. */
56#define YYPUSH 0
57
58/* Pull parsers. */
59#define YYPULL 1
60
61
62/* Copy the first part of user declarations. */
63/* Line 371 of yacc.c */
64#line 1 "src/IceStorm/Grammar.y"
65
66
67// **********************************************************************
68//
69// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
70//
71// This copy of Ice is licensed to you under the terms described in the
72// ICE_LICENSE file included in this distribution.
73//
74// **********************************************************************
75
76#include <Ice/Ice.h>
77#include <IceStorm/Parser.h>
78
79#ifdef _MSC_VER
80// I get these warnings from some bison versions:
81// warning C4102: 'yyoverflowlab' : unreferenced label
82#pragma warning(disable : 4102)
83// warning C4065: switch statement contains 'default' but no 'case' labels
84#pragma warning(disable : 4065)
85#endif
86
87//
88// Avoid old style cast warnings in generated grammar
89//
90#ifdef __GNUC__
91#pragma GCC diagnostic ignored "-Wold-style-cast"
92#endif
93
94using namespace std;
95using namespace Ice;
96using namespace IceStorm;
97
98void
99yyerror(const char* s)
100{
101 parser->error(s);
102}
103
104/* Line 371 of yacc.c */
105#line 109 "src/IceStorm/Grammar.cpp"
106
107#ifndef YY_NULL
108#if defined __cplusplus && 201103L <= __cplusplus
109#define YY_NULL nullptr
110#else
111#define YY_NULL 0
112#endif
113#endif
114
115/* Enabling verbose error messages. */
116#ifdef YYERROR_VERBOSE
117#undef YYERROR_VERBOSE
118#define YYERROR_VERBOSE 1
119#else
120#define YYERROR_VERBOSE 0
121#endif
122
123/* In a future release of Bison, this section will be replaced
124 by #include "Grammar.hpp". */
125#ifndef YY_YY_SRC_ICESTORM_GRAMMAR_HPP_INCLUDED
126#define YY_YY_SRC_ICESTORM_GRAMMAR_HPP_INCLUDED
127/* Enabling traces. */
128#ifndef YYDEBUG
129#define YYDEBUG 1
130#endif
131#if YYDEBUG
132extern int yydebug;
133#endif
134
135/* Tokens. */
136#ifndef YYTOKENTYPE
137#define YYTOKENTYPE
138
139/* Put the tokens into the symbol table, so that GDB and other debuggers
140 know about them. */
156#endif
157
158
159#if !defined YYSTYPE && !defined YYSTYPE_IS_DECLARED
160typedef int YYSTYPE;
161#define YYSTYPE_IS_TRIVIAL 1
162#define yystype YYSTYPE /* obsolescent; will be withdrawn */
163#define YYSTYPE_IS_DECLARED 1
164#endif
165
166
167#ifdef YYPARSE_PARAM
168#if defined __STDC__ || defined __cplusplus
169int yyparse(void* YYPARSE_PARAM);
170#else
171int yyparse();
172#endif
173#else /* ! YYPARSE_PARAM */
174#if defined __STDC__ || defined __cplusplus
175int yyparse(void);
176#else
177int yyparse();
178#endif
179#endif /* ! YYPARSE_PARAM */
180
181#endif /* !YY_YY_SRC_ICESTORM_GRAMMAR_HPP_INCLUDED */
182
183/* Copy the second part of user declarations. */
184
185/* Line 390 of yacc.c */
186#line 188 "src/IceStorm/Grammar.cpp"
187
188#ifdef short
189#undef short
190#endif
191
192#ifdef YYTYPE_UINT8
193typedef YYTYPE_UINT8 yytype_uint8;
194#else
195typedef unsigned char yytype_uint8;
196#endif
197
198#ifdef YYTYPE_INT8
199typedef YYTYPE_INT8 yytype_int8;
200#elif (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER)
201typedef signed char yytype_int8;
202#else
203typedef short int yytype_int8;
204#endif
205
206#ifdef YYTYPE_UINT16
207typedef YYTYPE_UINT16 yytype_uint16;
208#else
209typedef unsigned short int yytype_uint16;
210#endif
211
212#ifdef YYTYPE_INT16
213typedef YYTYPE_INT16 yytype_int16;
214#else
215typedef short int yytype_int16;
216#endif
217
218#ifndef YYSIZE_T
219#ifdef __SIZE_TYPE__
220#define YYSIZE_T __SIZE_TYPE__
221#elif defined size_t
222#define YYSIZE_T size_t
223#elif !defined YYSIZE_T && \
224 (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER)
225#include <stddef.h> /* INFRINGES ON USER NAME SPACE */
226#define YYSIZE_T size_t
227#else
228#define YYSIZE_T unsigned int
229#endif
230#endif
231
232#define YYSIZE_MAXIMUM ((YYSIZE_T)-1)
233
234#ifndef YY_
235#if defined YYENABLE_NLS && YYENABLE_NLS
236#if ENABLE_NLS
237#include <libintl.h> /* INFRINGES ON USER NAME SPACE */
238#define YY_(Msgid) dgettext("bison-runtime", Msgid)
239#endif
240#endif
241#ifndef YY_
242#define YY_(Msgid) Msgid
243#endif
244#endif
245
246/* Suppress unused-variable warnings by "using" E. */
247#if !defined lint || defined __GNUC__
248#define YYUSE(E) ((void)(E))
249#else
250#define YYUSE(E) /* empty */
251#endif
252
253/* Identity function, used to suppress warnings about constant conditions. */
254#ifndef lint
255#define YYID(N) (N)
256#else
257#if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER)
258static int
259YYID(int yyi)
260#else
261static int
262YYID(yyi)
263int yyi;
264#endif
265{
266 return yyi;
267}
268#endif
269
270#if !defined yyoverflow || YYERROR_VERBOSE
271
272/* The parser invokes alloca or malloc; define the necessary symbols. */
273
274#ifdef YYSTACK_USE_ALLOCA
275#if YYSTACK_USE_ALLOCA
276#ifdef __GNUC__
277#define YYSTACK_ALLOC __builtin_alloca
278#elif defined __BUILTIN_VA_ARG_INCR
279#include <alloca.h> /* INFRINGES ON USER NAME SPACE */
280#elif defined _AIX
281#define YYSTACK_ALLOC __alloca
282#elif defined _MSC_VER
283#include <malloc.h> /* INFRINGES ON USER NAME SPACE */
284#define alloca _alloca
285#else
286#define YYSTACK_ALLOC alloca
287#if !defined _ALLOCA_H && !defined EXIT_SUCCESS && \
288 (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER)
289#include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
290/* Use EXIT_SUCCESS as a witness for stdlib.h. */
291#ifndef EXIT_SUCCESS
292#define EXIT_SUCCESS 0
293#endif
294#endif
295#endif
296#endif
297#endif
298
299#ifdef YYSTACK_ALLOC
300/* Pacify GCC's `empty if-body' warning. */
301#define YYSTACK_FREE(Ptr) \
302 do \
303 { /* empty */ \
304 ; \
305 } while (YYID(0))
306#ifndef YYSTACK_ALLOC_MAXIMUM
307/* The OS might guarantee only one guard page at the bottom of the stack,
308 and a page size can be as small as 4096 bytes. So we cannot safely
309 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
310 to allow for a few compiler-allocated temporary stack slots. */
311#define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
312#endif
313#else
314#define YYSTACK_ALLOC YYMALLOC
315#define YYSTACK_FREE YYFREE
316#ifndef YYSTACK_ALLOC_MAXIMUM
317#define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
318#endif
319#if (defined __cplusplus && !defined EXIT_SUCCESS && \
320 !((defined YYMALLOC || defined malloc) && (defined YYFREE || defined free)))
321#include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
322#ifndef EXIT_SUCCESS
323#define EXIT_SUCCESS 0
324#endif
325#endif
326#ifndef YYMALLOC
327#define YYMALLOC malloc
328#if !defined malloc && !defined EXIT_SUCCESS && \
329 (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER)
330void* malloc(YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
331#endif
332#endif
333#ifndef YYFREE
334#define YYFREE free
335#if !defined free && !defined EXIT_SUCCESS && \
336 (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER)
337void free(void*); /* INFRINGES ON USER NAME SPACE */
338#endif
339#endif
340#endif
341#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
342
343
344#if (!defined yyoverflow && \
345 (!defined __cplusplus || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
346
347/* A type that is properly aligned for any stack member. */
353
354/* The size of the maximum gap between one aligned stack and the next. */
355#define YYSTACK_GAP_MAXIMUM (sizeof(union yyalloc) - 1)
356
357/* The size of an array large to enough to hold all stacks, each with
358 N elements. */
359#define YYSTACK_BYTES(N) ((N) * (sizeof(yytype_int16) + sizeof(YYSTYPE)) + YYSTACK_GAP_MAXIMUM)
360
361#define YYCOPY_NEEDED 1
362
363/* Relocate STACK from its old location to the new one. The
364 local variables YYSIZE and YYSTACKSIZE give the old and new number of
365 elements in the stack, and YYPTR gives the new location of the
366 stack. Advance YYPTR to a properly aligned location for the next
367 stack. */
368#define YYSTACK_RELOCATE(Stack_alloc, Stack) \
369 do \
370 { \
371 YYSIZE_T yynewbytes; \
372 YYCOPY(&yyptr->Stack_alloc, Stack, yysize); \
373 Stack = &yyptr->Stack_alloc; \
374 yynewbytes = yystacksize * sizeof(*Stack) + YYSTACK_GAP_MAXIMUM; \
375 yyptr += yynewbytes / sizeof(*yyptr); \
376 } while (YYID(0))
377
378#endif
379
380#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
381/* Copy COUNT objects from SRC to DST. The source and destination do
382 not overlap. */
383#ifndef YYCOPY
384#if defined __GNUC__ && 1 < __GNUC__
385#define YYCOPY(Dst, Src, Count) __builtin_memcpy(Dst, Src, (Count) * sizeof(*(Src)))
386#else
387#define YYCOPY(Dst, Src, Count) \
388 do \
389 { \
390 YYSIZE_T yyi; \
391 for (yyi = 0; yyi < (Count); yyi++) \
392 (Dst)[yyi] = (Src)[yyi]; \
393 } while (YYID(0))
394#endif
395#endif
396#endif /* !YYCOPY_NEEDED */
397
398/* YYFINAL -- State number of the termination state. */
399#define YYFINAL 42
400/* YYLAST -- Last index in YYTABLE. */
401#define YYLAST 65
402
403/* YYNTOKENS -- Number of terminals. */
404#define YYNTOKENS 16
405/* YYNNTS -- Number of nonterminals. */
406#define YYNNTS 6
407/* YYNRULES -- Number of rules. */
408#define YYNRULES 31
409/* YYNRULES -- Number of states. */
410#define YYNSTATES 56
411
412/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
413#define YYUNDEFTOK 2
414#define YYMAXUTOK 269
415
416#define YYTRANSLATE(YYX) ((unsigned int)(YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
417
418/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
419static const yytype_uint8 yytranslate[] = {
420 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
421 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 15,
422 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
424 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
425 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
426 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
427 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
428 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14};
429
430#if YYDEBUG
431/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
432 YYRHS. */
433static const yytype_uint8 yyprhs[] = {0, 0, 3, 5, 6, 9, 11, 14, 17, 21, 25,
434 29, 33, 37, 41, 45, 49, 53, 57, 60, 62, 65,
435 68, 69, 71, 73, 75, 77, 79, 81, 83, 85};
436
437/* YYRHS -- A `-1'-separated list of the rules' RHS. */
438static const yytype_int8 yyrhs[] = {
439 17, 0, -1, 18, -1, -1, 18, 19, -1, 19, -1, 3, 15, -1, 4, 15, -1, 6, 20, 15, -1, 5,
440 20, 15, -1, 7, 20, 15, -1, 8, 20, 15, -1, 9, 20, 15, -1, 10, 20, 15, -1, 11, 20, 15,
441 -1, 12, 20, 15, -1, 13, 20, 15, -1, 14, 1, 15, -1, 1, 15, -1, 15, -1, 14, 20, -1, 21,
442 20, -1, -1, 3, -1, 4, -1, 5, -1, 6, -1, 7, -1, 8, -1, 9, -1, 10, -1, 11, -1};
443
444/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
445static const yytype_uint8 yyrline[] = {0, 67, 67, 71, 78, 81, 89, 93, 97, 101, 105,
446 109, 113, 117, 121, 125, 129, 133, 137, 141, 149, 154,
447 160, 168, 171, 174, 177, 180, 183, 186, 189, 192};
448#endif
449
450#if YYDEBUG || YYERROR_VERBOSE || 0
451/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
452 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
453static const char* const yytname[] = {"$end",
454 "error",
455 "$undefined",
456 "ICE_STORM_HELP",
457 "ICE_STORM_EXIT",
458 "ICE_STORM_CURRENT",
459 "ICE_STORM_CREATE",
460 "ICE_STORM_DESTROY",
461 "ICE_STORM_LINK",
462 "ICE_STORM_UNLINK",
463 "ICE_STORM_LINKS",
464 "ICE_STORM_TOPICS",
465 "ICE_STORM_REPLICA",
466 "ICE_STORM_SUBSCRIBERS",
467 "ICE_STORM_STRING",
468 "';'",
469 "$accept",
470 "start",
471 "commands",
472 "command",
473 "strings",
474 "keyword",
475 YY_NULL};
476#endif
477
478#ifdef YYPRINT
479/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
480 token YYLEX-NUM. */
481static const yytype_uint16 yytoknum[] =
482 {0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 59};
483#endif
484
485/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
486static const yytype_uint8 yyr1[] = {0, 16, 17, 17, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
487 19, 19, 19, 19, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21};
488
489/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
490static const yytype_uint8 yyr2[] = {0, 2, 1, 0, 2, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
491 3, 3, 2, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1};
492
493/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
494 Performed when YYTABLE doesn't specify something else to do. Zero
495 means the default is an error. */
496static const yytype_uint8 yydefact[] = {0, 0, 0, 0, 22, 22, 22, 22, 22, 22, 22, 22, 22, 0,
497 19, 0, 0, 5, 18, 6, 7, 23, 24, 25, 26, 27, 28, 29,
498 30, 31, 22, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0,
499 1, 4, 20, 9, 21, 8, 10, 11, 12, 13, 14, 15, 16, 17};
500
501/* YYDEFGOTO[NTERM-NUM]. */
502static const yytype_int8 yydefgoto[] = {-1, 15, 16, 17, 31, 32};
503
504/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
505 STATE-NUM. */
506#define YYPACT_NINF -6
507static const yytype_int8 yypact[] = {8, 9, 11, 15, 41, 41, 41, 41, 41, 41, 41, 41, 41, 52,
508 -6, 10, 28, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
509 -6, -6, 41, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
510 -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6};
511
512/* YYPGOTO[NTERM-NUM]. */
513static const yytype_int8 yypgoto[] = {-6, -6, -6, 40, -5, -6};
514
515/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
516 positive, shift that token. If negative, reduce the rule which
517 number is the opposite. If YYTABLE_NINF, syntax error. */
518#define YYTABLE_NINF -4
519static const yytype_int8 yytable[] = {
520 33, 34, 35, 36, 37, 38, 39, 40, -3, 1, 42, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
521 13, 14, 18, 44, 19, 46, -2, 1, 20, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
522 21, 22, 23, 24, 25, 26, 27, 28, 29, 41, 45, 30, 43, 47, 48, 49, 50, 51, 52, 53, 54, 55};
523
524#define yypact_value_is_default(Yystate) (!!((Yystate) == (-6)))
525
526#define yytable_value_is_error(Yytable_value) YYID(0)
527
528static const yytype_uint8 yycheck[] = {
529 5, 6, 7, 8, 9, 10, 11, 12, 0, 1, 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
530 14, 15, 15, 30, 15, 32, 0, 1, 15, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
531 3, 4, 5, 6, 7, 8, 9, 10, 11, 1, 15, 14, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15};
532
533/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
534 symbol of state STATE-NUM. */
535static const yytype_uint8 yystos[] = {0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
536 15, 17, 18, 19, 15, 15, 15, 3, 4, 5, 6, 7, 8, 9,
537 10, 11, 14, 20, 21, 20, 20, 20, 20, 20, 20, 20, 20, 1,
538 0, 19, 20, 15, 20, 15, 15, 15, 15, 15, 15, 15, 15, 15};
539
540#define yyerrok (yyerrstatus = 0)
541#define yyclearin (yychar = YYEMPTY)
542#define YYEMPTY (-2)
543#define YYEOF 0
544
545#define YYACCEPT goto yyacceptlab
546#define YYABORT goto yyabortlab
547#define YYERROR goto yyerrorlab
548
549
550/* Like YYERROR except do call yyerror. This remains here temporarily
551 to ease the transition to the new meaning of YYERROR, for GCC.
552 Once GCC version 2 has supplanted version 1, this can go. However,
553 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
554 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
555 discussed. */
556
557#define YYFAIL goto yyerrlab
558#if defined YYFAIL
559/* This is here to suppress warnings from the GCC cpp's
560 -Wunused-macros. Normally we don't worry about that warning, but
561 some users do, and we want to make it easy for users to remove
562 YYFAIL uses, which will produce warnings from Bison 2.5. */
563#endif
564
565#define YYRECOVERING() (!!yyerrstatus)
566
567#define YYBACKUP(Token, Value) \
568 do \
569 if (yychar == YYEMPTY) \
570 { \
571 yychar = (Token); \
572 yylval = (Value); \
573 YYPOPSTACK(yylen); \
574 yystate = *yyssp; \
575 goto yybackup; \
576 } \
577 else \
578 { \
579 yyerror(YY_("syntax error: cannot back up")); \
580 YYERROR; \
581 } \
582 while (YYID(0))
583
584/* Error token number */
585#define YYTERROR 1
586#define YYERRCODE 256
587
588
589/* This macro is provided for backward compatibility. */
590#ifndef YY_LOCATION_PRINT
591#define YY_LOCATION_PRINT(File, Loc) ((void)0)
592#endif
593
594
595/* YYLEX -- calling `yylex' with the right arguments. */
596#ifdef YYLEX_PARAM
597#define YYLEX yylex(&yylval, YYLEX_PARAM)
598#else
599#define YYLEX yylex(&yylval)
600#endif
601
602/* Enable debugging if requested. */
603#if YYDEBUG
604
605#ifndef YYFPRINTF
606#include <stdio.h> /* INFRINGES ON USER NAME SPACE */
607#define YYFPRINTF fprintf
608#endif
609
610#define YYDPRINTF(Args) \
611 do \
612 { \
613 if (yydebug) \
614 YYFPRINTF Args; \
615 } while (YYID(0))
616
617#define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
618 do \
619 { \
620 if (yydebug) \
621 { \
622 YYFPRINTF(stderr, "%s ", Title); \
623 yy_symbol_print(stderr, Type, Value); \
624 YYFPRINTF(stderr, "\n"); \
625 } \
626 } while (YYID(0))
627
628
629/*--------------------------------.
630| Print this symbol on YYOUTPUT. |
631`--------------------------------*/
632
633/*ARGSUSED*/
634#if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER)
635static void
636yy_symbol_value_print(FILE* yyoutput, int yytype, YYSTYPE const* const yyvaluep)
637#else
638static void yy_symbol_value_print(yyoutput, yytype, yyvaluep) FILE* yyoutput;
640YYSTYPE const* const yyvaluep;
641#endif
642{
643 FILE* yyo = yyoutput;
644 YYUSE(yyo);
646 {
647 return;
648 }
649#ifdef YYPRINT
650 if (yytype < YYNTOKENS)
651 {
652 YYPRINT(yyoutput, yytoknum[yytype], *yyvaluep);
653 }
654#else
655 YYUSE(yyoutput);
656#endif
657 switch (yytype)
658 {
659 default:
660 break;
661 }
662}
663
664
665/*--------------------------------.
666| Print this symbol on YYOUTPUT. |
667`--------------------------------*/
668
669#if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER)
670static void
671yy_symbol_print(FILE* yyoutput, int yytype, YYSTYPE const* const yyvaluep)
672#else
673static void yy_symbol_print(yyoutput, yytype, yyvaluep) FILE* yyoutput;
674int yytype;
675YYSTYPE const* const yyvaluep;
676#endif
677{
678 if (yytype < YYNTOKENS)
679 {
680 YYFPRINTF(yyoutput, "token %s (", yytname[yytype]);
681 }
682 else
683 {
684 YYFPRINTF(yyoutput, "nterm %s (", yytname[yytype]);
685 }
686
687 yy_symbol_value_print(yyoutput, yytype, yyvaluep);
688 YYFPRINTF(yyoutput, ")");
689}
690
691/*------------------------------------------------------------------.
692| yy_stack_print -- Print the state stack from its BOTTOM up to its |
693| TOP (included). |
694`------------------------------------------------------------------*/
695
696#if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER)
697static void
698yy_stack_print(yytype_int16* yybottom, yytype_int16* yytop)
699#else
700static void yy_stack_print(yybottom, yytop) yytype_int16* yybottom;
702#endif
703{
704 YYFPRINTF(stderr, "Stack now");
705 for (; yybottom <= yytop; yybottom++)
706 {
707 int yybot = *yybottom;
708 YYFPRINTF(stderr, " %d", yybot);
709 }
710 YYFPRINTF(stderr, "\n");
711}
712
713#define YY_STACK_PRINT(Bottom, Top) \
714 do \
715 { \
716 if (yydebug) \
717 yy_stack_print((Bottom), (Top)); \
718 } while (YYID(0))
719
720
721/*------------------------------------------------.
722| Report that the YYRULE is going to be reduced. |
723`------------------------------------------------*/
724
725#if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER)
726static void
727yy_reduce_print(YYSTYPE* yyvsp, int yyrule)
728#else
729static void yy_reduce_print(yyvsp, yyrule) YYSTYPE* yyvsp;
731#endif
732{
733 int yynrhs = yyr2[yyrule];
734 int yyi;
735 unsigned long int yylno = yyrline[yyrule];
736 YYFPRINTF(stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno);
737 /* The symbols being reduced. */
738 for (yyi = 0; yyi < yynrhs; yyi++)
739 {
740 YYFPRINTF(stderr, " $%d = ", yyi + 1);
741 yy_symbol_print(stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]));
742 YYFPRINTF(stderr, "\n");
743 }
744}
745
746#define YY_REDUCE_PRINT(Rule) \
747 do \
748 { \
749 if (yydebug) \
750 yy_reduce_print(yyvsp, Rule); \
751 } while (YYID(0))
752
753/* Nonzero means print parse trace. It is left uninitialized so that
754 multiple parsers can coexist. */
756#else /* !YYDEBUG */
757#define YYDPRINTF(Args)
758#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
759#define YY_STACK_PRINT(Bottom, Top)
760#define YY_REDUCE_PRINT(Rule)
761#endif /* !YYDEBUG */
762
763
764/* YYINITDEPTH -- initial size of the parser's stacks. */
765#ifndef YYINITDEPTH
766#define YYINITDEPTH 200
767#endif
768
769/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
770 if the built-in stack extension method is used).
771
772 Do not make this value too large; the results are undefined if
773 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
774 evaluated with infinite-precision integer arithmetic. */
775
776#ifndef YYMAXDEPTH
777#define YYMAXDEPTH 10000
778#endif
779
780
781#if YYERROR_VERBOSE
782
783#ifndef yystrlen
784#if defined __GLIBC__ && defined _STRING_H
785#define yystrlen strlen
786#else
787/* Return the length of YYSTR. */
788#if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER)
789static YYSIZE_T
790yystrlen(const char* yystr)
791#else
792static YYSIZE_T yystrlen(yystr) const char* yystr;
793#endif
794{
795 YYSIZE_T yylen;
796 for (yylen = 0; yystr[yylen]; yylen++)
797 {
798 continue;
799 }
800 return yylen;
801}
802#endif
803#endif
804
805#ifndef yystpcpy
806#if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
807#define yystpcpy stpcpy
808#else
809/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
810 YYDEST. */
811#if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER)
812static char*
813yystpcpy(char* yydest, const char* yysrc)
814#else
815static char*
816yystpcpy(yydest, yysrc)
817char* yydest;
818const char* yysrc;
819#endif
820{
821 char* yyd = yydest;
822 const char* yys = yysrc;
823
824 while ((*yyd++ = *yys++) != '\0')
825 {
826 continue;
827 }
828
829 return yyd - 1;
830}
831#endif
832#endif
833
834#ifndef yytnamerr
835/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
836 quotes and backslashes, so that it's suitable for yyerror. The
837 heuristic is that double-quoting is unnecessary unless the string
838 contains an apostrophe, a comma, or backslash (other than
839 backslash-backslash). YYSTR is taken from yytname. If YYRES is
840 null, do not copy; instead, return the length of what the result
841 would have been. */
842static YYSIZE_T
843yytnamerr(char* yyres, const char* yystr)
844{
845 if (*yystr == '"')
846 {
847 YYSIZE_T yyn = 0;
848 char const* yyp = yystr;
849
850 for (;;)
851 switch (*++yyp)
852 {
853 case '\'':
854 case ',':
855 goto do_not_strip_quotes;
856
857 case '\\':
858 if (*++yyp != '\\')
859 {
860 goto do_not_strip_quotes;
861 }
862 /* Fall through. */
863 default:
864 if (yyres)
865 {
866 yyres[yyn] = *yyp;
867 }
868 yyn++;
869 break;
870
871 case '"':
872 if (yyres)
873 {
874 yyres[yyn] = '\0';
875 }
876 return yyn;
877 }
878 do_not_strip_quotes:;
879 }
880
881 if (!yyres)
882 {
883 return yystrlen(yystr);
884 }
885
886 return yystpcpy(yyres, yystr) - yyres;
887}
888#endif
889
890/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
891 about the unexpected token YYTOKEN for the state stack whose top is
892 YYSSP.
893
894 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
895 not large enough to hold the message. In that case, also set
896 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
897 required number of bytes is too large to store. */
898static int
899yysyntax_error(YYSIZE_T* yymsg_alloc, char** yymsg, yytype_int16* yyssp, int yytoken)
900{
901 YYSIZE_T yysize0 = yytnamerr(YY_NULL, yytname[yytoken]);
902 YYSIZE_T yysize = yysize0;
903
904 enum
905 {
906 YYERROR_VERBOSE_ARGS_MAXIMUM = 5
907 };
908
909 /* Internationalized format string. */
910 const char* yyformat = YY_NULL;
911 /* Arguments of yyformat. */
912 char const* yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
913 /* Number of reported tokens (one for the "unexpected", one per
914 "expected"). */
915 int yycount = 0;
916
917 /* There are many possibilities here to consider:
918 - Assume YYFAIL is not used. It's too flawed to consider. See
919 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
920 for details. YYERROR is fine as it does not invoke this
921 function.
922 - If this state is a consistent state with a default action, then
923 the only way this function was invoked is if the default action
924 is an error action. In that case, don't check for expected
925 tokens because there are none.
926 - The only way there can be no lookahead present (in yychar) is if
927 this state is a consistent state with a default action. Thus,
928 detecting the absence of a lookahead is sufficient to determine
929 that there is no unexpected or expected token to report. In that
930 case, just report a simple "syntax error".
931 - Don't assume there isn't a lookahead just because this state is a
932 consistent state with a default action. There might have been a
933 previous inconsistent state, consistent state with a non-default
934 action, or user semantic action that manipulated yychar.
935 - Of course, the expected token list depends on states to have
936 correct lookahead information, and it depends on the parser not
937 to perform extra reductions after fetching a lookahead from the
938 scanner and before detecting a syntax error. Thus, state merging
939 (from LALR or IELR) and default reductions corrupt the expected
940 token list. However, the list is correct for canonical LR with
941 one exception: it will still contain any token that will not be
942 accepted due to an error action in a later state.
943 */
944 if (yytoken != YYEMPTY)
945 {
946 int yyn = yypact[*yyssp];
947 yyarg[yycount++] = yytname[yytoken];
948 if (!yypact_value_is_default(yyn))
949 {
950 /* Start YYX at -YYN if negative to avoid negative indexes in
951 YYCHECK. In other words, skip the first -YYN actions for
952 this state because they are default actions. */
953 int yyxbegin = yyn < 0 ? -yyn : 0;
954 /* Stay within bounds of both yycheck and yytname. */
955 int yychecklim = YYLAST - yyn + 1;
956 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
957 int yyx;
958
959 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
960 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR &&
961 !yytable_value_is_error(yytable[yyx + yyn]))
962 {
963 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
964 {
965 yycount = 1;
966 yysize = yysize0;
967 break;
968 }
969 yyarg[yycount++] = yytname[yyx];
970 {
971 YYSIZE_T yysize1 = yysize + yytnamerr(YY_NULL, yytname[yyx]);
972 if (!(yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
973 {
974 return 2;
975 }
976 yysize = yysize1;
977 }
978 }
979 }
980 }
981
982 switch (yycount)
983 {
984#define YYCASE_(N, S) \
985 case N: \
986 yyformat = S; \
987 break
988 YYCASE_(0, YY_("syntax error"));
989 YYCASE_(1, YY_("syntax error, unexpected %s"));
990 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
991 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
992 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
993 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
994#undef YYCASE_
995 }
996
997 {
998 YYSIZE_T yysize1 = yysize + yystrlen(yyformat);
999 if (!(yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1000 {
1001 return 2;
1002 }
1003 yysize = yysize1;
1004 }
1005
1006 if (*yymsg_alloc < yysize)
1007 {
1008 *yymsg_alloc = 2 * yysize;
1009 if (!(yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1010 {
1011 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1012 }
1013 return 1;
1014 }
1015
1016 /* Avoid sprintf, as that infringes on the user's name space.
1017 Don't have undefined behavior even if the translation
1018 produced a string with the wrong number of "%s"s. */
1019 {
1020 char* yyp = *yymsg;
1021 int yyi = 0;
1022 while ((*yyp = *yyformat) != '\0')
1023 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1024 {
1025 yyp += yytnamerr(yyp, yyarg[yyi++]);
1026 yyformat += 2;
1027 }
1028 else
1029 {
1030 yyp++;
1031 yyformat++;
1032 }
1033 }
1034 return 0;
1035}
1036#endif /* YYERROR_VERBOSE */
1037
1038/*-----------------------------------------------.
1039| Release the memory associated to this symbol. |
1040`-----------------------------------------------*/
1041
1042/*ARGSUSED*/
1043#if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER)
1044static void
1045yydestruct(const char* yymsg, int yytype, YYSTYPE* yyvaluep)
1046#else
1047static void yydestruct(yymsg, yytype, yyvaluep) const char* yymsg;
1048int yytype;
1050#endif
1051{
1052 YYUSE(yyvaluep);
1053
1054 if (!yymsg)
1055 {
1056 yymsg = "Deleting";
1057 }
1058 YY_SYMBOL_PRINT(yymsg, yytype, yyvaluep, yylocationp);
1059
1060 switch (yytype)
1061 {
1062
1063 default:
1064 break;
1065 }
1066}
1067
1068
1069/*----------.
1070| yyparse. |
1071`----------*/
1072
1073#ifdef YYPARSE_PARAM
1074#if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER)
1075int
1076yyparse(void* YYPARSE_PARAM)
1077#else
1078int yyparse(YYPARSE_PARAM) void* YYPARSE_PARAM;
1079#endif
1080#else /* ! YYPARSE_PARAM */
1081#if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER)
1082int
1083yyparse(void)
1084#else
1085int
1087
1088#endif
1089#endif
1090{
1091 /* The lookahead symbol. */
1092 int yychar;
1093
1094
1095#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
1096 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
1097#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1098 _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wuninitialized\"") \
1099 _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1100#define YY_IGNORE_MAYBE_UNINITIALIZED_END _Pragma("GCC diagnostic pop")
1101#else
1102 /* Default value used for initialization, for pacifying older GCCs
1103 or non-GCC compilers. */
1104 static YYSTYPE yyval_default;
1105#define YY_INITIAL_VALUE(Value) = Value
1106#endif
1107#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1108#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1109#define YY_IGNORE_MAYBE_UNINITIALIZED_END
1110#endif
1111#ifndef YY_INITIAL_VALUE
1112#define YY_INITIAL_VALUE(Value) /* Nothing. */
1113#endif
1114
1115 /* The semantic value of the lookahead symbol. */
1116 YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
1117
1118 /* Number of syntax errors so far. */
1119 int yynerrs;
1120
1121 int yystate;
1122 /* Number of tokens to shift before error messages enabled. */
1123 int yyerrstatus;
1124
1125 /* The stacks and their tools:
1126 `yyss': related to states.
1127 `yyvs': related to semantic values.
1128
1129 Refer to the stacks through separate pointers, to allow yyoverflow
1130 to reallocate them elsewhere. */
1131
1132 /* The state stack. */
1134 yytype_int16* yyss;
1135 yytype_int16* yyssp;
1136
1137 /* The semantic value stack. */
1138 YYSTYPE yyvsa[YYINITDEPTH];
1139 YYSTYPE* yyvs;
1140 YYSTYPE* yyvsp;
1141
1142 YYSIZE_T yystacksize;
1143
1144 int yyn;
1145 int yyresult;
1146 /* Lookahead token as an internal (translated) token number. */
1147 int yytoken = 0;
1148 /* The variables used to return semantic value and location from the
1149 action routines. */
1150 YYSTYPE yyval;
1151
1152#if YYERROR_VERBOSE
1153 /* Buffer for error messages, and its allocated size. */
1154 char yymsgbuf[128];
1155 char* yymsg = yymsgbuf;
1156 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1157#endif
1158
1159#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1160
1161 /* The number of symbols on the RHS of the reduced rule.
1162 Keep to zero when no symbol should be popped. */
1163 int yylen = 0;
1164
1165 yyssp = yyss = yyssa;
1166 yyvsp = yyvs = yyvsa;
1167 yystacksize = YYINITDEPTH;
1168
1169 YYDPRINTF((stderr, "Starting parse\n"));
1170
1171 yystate = 0;
1172 yyerrstatus = 0;
1173 yynerrs = 0;
1174 yychar = YYEMPTY; /* Cause a token to be read. */
1175 goto yysetstate;
1176
1177 /*------------------------------------------------------------.
1178 | yynewstate -- Push a new state, which is found in yystate. |
1179 `------------------------------------------------------------*/
1180yynewstate:
1181 /* In all cases, when you get here, the value and location stacks
1182 have just been pushed. So pushing a state here evens the stacks. */
1183 yyssp++;
1184
1185yysetstate:
1186 *yyssp = yystate;
1187
1188 if (yyss + yystacksize - 1 <= yyssp)
1189 {
1190 /* Get the current used size of the three stacks, in elements. */
1191 YYSIZE_T yysize = yyssp - yyss + 1;
1192
1193#ifdef yyoverflow
1194 {
1195 /* Give user a chance to reallocate the stack. Use copies of
1196 these so that the &'s don't force the real ones into
1197 memory. */
1198 YYSTYPE* yyvs1 = yyvs;
1199 yytype_int16* yyss1 = yyss;
1200
1201 /* Each stack pointer address is followed by the size of the
1202 data in use in that stack, in bytes. This used to be a
1203 conditional around just the two extra args, but that might
1204 be undefined if yyoverflow is a macro. */
1205 yyoverflow(YY_("memory exhausted"),
1206 &yyss1,
1207 yysize * sizeof(*yyssp),
1208 &yyvs1,
1209 yysize * sizeof(*yyvsp),
1210 &yystacksize);
1211
1212 yyss = yyss1;
1213 yyvs = yyvs1;
1214 }
1215#else /* no yyoverflow */
1216#ifndef YYSTACK_RELOCATE
1217 goto yyexhaustedlab;
1218#else
1219 /* Extend the stack our own way. */
1220 if (YYMAXDEPTH <= yystacksize)
1221 {
1222 goto yyexhaustedlab;
1223 }
1224 yystacksize *= 2;
1225 if (YYMAXDEPTH < yystacksize)
1226 {
1227 yystacksize = YYMAXDEPTH;
1228 }
1229
1230 {
1231 yytype_int16* yyss1 = yyss;
1232 union yyalloc* yyptr = (union yyalloc*)YYSTACK_ALLOC(YYSTACK_BYTES(yystacksize));
1233 if (!yyptr)
1234 {
1235 goto yyexhaustedlab;
1236 }
1239#undef YYSTACK_RELOCATE
1240 if (yyss1 != yyssa)
1241 {
1242 YYSTACK_FREE(yyss1);
1243 }
1244 }
1245#endif
1246#endif /* no yyoverflow */
1247
1248 yyssp = yyss + yysize - 1;
1249 yyvsp = yyvs + yysize - 1;
1250
1251 YYDPRINTF((stderr, "Stack size increased to %lu\n", (unsigned long int)yystacksize));
1252
1253 if (yyss + yystacksize - 1 <= yyssp)
1254 {
1255 YYABORT;
1256 }
1257 }
1258
1259 YYDPRINTF((stderr, "Entering state %d\n", yystate));
1260
1261 if (yystate == YYFINAL)
1262 {
1263 YYACCEPT;
1264 }
1265
1266 goto yybackup;
1267
1268 /*-----------.
1269 | yybackup. |
1270 `-----------*/
1271yybackup:
1272
1273 /* Do appropriate processing given the current state. Read a
1274 lookahead token if we need one and don't already have one. */
1275
1276 /* First try to decide what to do without reference to lookahead token. */
1277 yyn = yypact[yystate];
1278 if (yypact_value_is_default(yyn))
1279 {
1280 goto yydefault;
1281 }
1282
1283 /* Not known => get a lookahead token if don't already have one. */
1284
1285 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1286 if (yychar == YYEMPTY)
1287 {
1288 YYDPRINTF((stderr, "Reading a token: "));
1289 yychar = YYLEX;
1290 }
1291
1292 if (yychar <= YYEOF)
1293 {
1294 yychar = yytoken = YYEOF;
1295 YYDPRINTF((stderr, "Now at end of input.\n"));
1296 }
1297 else
1298 {
1299 yytoken = YYTRANSLATE(yychar);
1300 YY_SYMBOL_PRINT("Next token is", yytoken, &yylval, &yylloc);
1301 }
1302
1303 /* If the proper action on seeing token YYTOKEN is to reduce or to
1304 detect an error, take that action. */
1305 yyn += yytoken;
1306 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1307 {
1308 goto yydefault;
1309 }
1310 yyn = yytable[yyn];
1311 if (yyn <= 0)
1312 {
1313 if (yytable_value_is_error(yyn))
1314 {
1315 goto yyerrlab;
1316 }
1317 yyn = -yyn;
1318 goto yyreduce;
1319 }
1320
1321 /* Count tokens shifted since error; after three, turn off error
1322 status. */
1323 if (yyerrstatus)
1324 {
1325 yyerrstatus--;
1326 }
1327
1328 /* Shift the lookahead token. */
1329 YY_SYMBOL_PRINT("Shifting", yytoken, &yylval, &yylloc);
1330
1331 /* Discard the shifted token. */
1332 yychar = YYEMPTY;
1333
1334 yystate = yyn;
1336 *++yyvsp = yylval;
1338
1339 goto yynewstate;
1340
1341
1342 /*-----------------------------------------------------------.
1343 | yydefault -- do the default action for the current state. |
1344 `-----------------------------------------------------------*/
1345yydefault:
1346 yyn = yydefact[yystate];
1347 if (yyn == 0)
1348 {
1349 goto yyerrlab;
1350 }
1351 goto yyreduce;
1352
1353
1354 /*-----------------------------.
1355 | yyreduce -- Do a reduction. |
1356 `-----------------------------*/
1357yyreduce:
1358 /* yyn is the number of a rule to reduce with. */
1359 yylen = yyr2[yyn];
1360
1361 /* If YYLEN is nonzero, implement the default value of the action:
1362 `$$ = $1'.
1363
1364 Otherwise, the following line sets YYVAL to garbage.
1365 This behavior is undocumented and Bison
1366 users should not rely upon it. Assigning to YYVAL
1367 unconditionally makes the parser a bit smaller, and it avoids a
1368 GCC warning that YYVAL may be used uninitialized. */
1369 yyval = yyvsp[1 - yylen];
1370
1371
1372 YY_REDUCE_PRINT(yyn);
1373 switch (yyn)
1374 {
1375 case 2:
1376 /* Line 1792 of yacc.c */
1377#line 68 "src/IceStorm/Grammar.y"
1378 {
1379 }
1380 break;
1381
1382 case 3:
1383 /* Line 1792 of yacc.c */
1384#line 71 "src/IceStorm/Grammar.y"
1385 {
1386 }
1387 break;
1388
1389 case 4:
1390 /* Line 1792 of yacc.c */
1391#line 79 "src/IceStorm/Grammar.y"
1392 {
1393 }
1394 break;
1395
1396 case 5:
1397 /* Line 1792 of yacc.c */
1398#line 82 "src/IceStorm/Grammar.y"
1399 {
1400 }
1401 break;
1402
1403 case 6:
1404 /* Line 1792 of yacc.c */
1405#line 90 "src/IceStorm/Grammar.y"
1406 {
1407 parser->usage();
1408 }
1409 break;
1410
1411 case 7:
1412 /* Line 1792 of yacc.c */
1413#line 94 "src/IceStorm/Grammar.y"
1414 {
1415 return 0;
1416 }
1417 break;
1418
1419 case 8:
1420 /* Line 1792 of yacc.c */
1421#line 98 "src/IceStorm/Grammar.y"
1422 {
1423 parser->create((yyvsp[(2) - (3)]));
1424 }
1425 break;
1426
1427 case 9:
1428 /* Line 1792 of yacc.c */
1429#line 102 "src/IceStorm/Grammar.y"
1430 {
1431 parser->current((yyvsp[(2) - (3)]));
1432 }
1433 break;
1434
1435 case 10:
1436 /* Line 1792 of yacc.c */
1437#line 106 "src/IceStorm/Grammar.y"
1438 {
1439 parser->destroy((yyvsp[(2) - (3)]));
1440 }
1441 break;
1442
1443 case 11:
1444 /* Line 1792 of yacc.c */
1445#line 110 "src/IceStorm/Grammar.y"
1446 {
1447 parser->link((yyvsp[(2) - (3)]));
1448 }
1449 break;
1450
1451 case 12:
1452 /* Line 1792 of yacc.c */
1453#line 114 "src/IceStorm/Grammar.y"
1454 {
1455 parser->unlink((yyvsp[(2) - (3)]));
1456 }
1457 break;
1458
1459 case 13:
1460 /* Line 1792 of yacc.c */
1461#line 118 "src/IceStorm/Grammar.y"
1462 {
1463 parser->links((yyvsp[(2) - (3)]));
1464 }
1465 break;
1466
1467 case 14:
1468 /* Line 1792 of yacc.c */
1469#line 122 "src/IceStorm/Grammar.y"
1470 {
1471 parser->topics((yyvsp[(2) - (3)]));
1472 }
1473 break;
1474
1475 case 15:
1476 /* Line 1792 of yacc.c */
1477#line 126 "src/IceStorm/Grammar.y"
1478 {
1479 parser->replica((yyvsp[(2) - (3)]));
1480 }
1481 break;
1482
1483 case 16:
1484 /* Line 1792 of yacc.c */
1485#line 130 "src/IceStorm/Grammar.y"
1486 {
1487 parser->subscribers((yyvsp[(2) - (3)]));
1488 }
1489 break;
1490
1491 case 17:
1492 /* Line 1792 of yacc.c */
1493#line 134 "src/IceStorm/Grammar.y"
1494 {
1495 parser->invalidCommand("unknown command `" + (yyvsp[(1) - (3)]).front() +
1496 "' (type `help' for more info)");
1497 }
1498 break;
1499
1500 case 18:
1501 /* Line 1792 of yacc.c */
1502#line 138 "src/IceStorm/Grammar.y"
1503 {
1504 yyerrok;
1505 }
1506 break;
1507
1508 case 19:
1509 /* Line 1792 of yacc.c */
1510#line 142 "src/IceStorm/Grammar.y"
1511 {
1512 }
1513 break;
1514
1515 case 20:
1516 /* Line 1792 of yacc.c */
1517#line 150 "src/IceStorm/Grammar.y"
1518 {
1519 (yyval) = (yyvsp[(2) - (2)]);
1520 (yyval).push_front((yyvsp[(1) - (2)]).front());
1521 }
1522 break;
1523
1524 case 21:
1525 /* Line 1792 of yacc.c */
1526#line 155 "src/IceStorm/Grammar.y"
1527 {
1528 (yyval) = (yyvsp[(2) - (2)]);
1529 (yyval).push_front((yyvsp[(1) - (2)]).front());
1530 }
1531 break;
1532
1533 case 22:
1534 /* Line 1792 of yacc.c */
1535#line 160 "src/IceStorm/Grammar.y"
1536 {
1537 (yyval) = YYSTYPE();
1538 }
1539 break;
1540
1541 case 23:
1542 /* Line 1792 of yacc.c */
1543#line 169 "src/IceStorm/Grammar.y"
1544 {
1545 }
1546 break;
1547
1548 case 24:
1549 /* Line 1792 of yacc.c */
1550#line 172 "src/IceStorm/Grammar.y"
1551 {
1552 }
1553 break;
1554
1555 case 25:
1556 /* Line 1792 of yacc.c */
1557#line 175 "src/IceStorm/Grammar.y"
1558 {
1559 }
1560 break;
1561
1562 case 26:
1563 /* Line 1792 of yacc.c */
1564#line 178 "src/IceStorm/Grammar.y"
1565 {
1566 }
1567 break;
1568
1569 case 27:
1570 /* Line 1792 of yacc.c */
1571#line 181 "src/IceStorm/Grammar.y"
1572 {
1573 }
1574 break;
1575
1576 case 28:
1577 /* Line 1792 of yacc.c */
1578#line 184 "src/IceStorm/Grammar.y"
1579 {
1580 }
1581 break;
1582
1583 case 29:
1584 /* Line 1792 of yacc.c */
1585#line 187 "src/IceStorm/Grammar.y"
1586 {
1587 }
1588 break;
1589
1590 case 30:
1591 /* Line 1792 of yacc.c */
1592#line 190 "src/IceStorm/Grammar.y"
1593 {
1594 }
1595 break;
1596
1597 case 31:
1598 /* Line 1792 of yacc.c */
1599#line 193 "src/IceStorm/Grammar.y"
1600 {
1601 }
1602 break;
1603
1604
1605 /* Line 1792 of yacc.c */
1606#line 1657 "src/IceStorm/Grammar.cpp"
1607 default:
1608 break;
1609 }
1610 /* User semantic actions sometimes alter yychar, and that requires
1611 that yytoken be updated with the new translation. We take the
1612 approach of translating immediately before every use of yytoken.
1613 One alternative is translating here after every semantic action,
1614 but that translation would be missed if the semantic action invokes
1615 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1616 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1617 incorrect destructor might then be invoked immediately. In the
1618 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1619 to an incorrect destructor call or verbose syntax error message
1620 before the lookahead is translated. */
1621 YY_SYMBOL_PRINT("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1622
1623 YYPOPSTACK(yylen);
1624 yylen = 0;
1625 YY_STACK_PRINT(yyss, yyssp);
1626
1627 *++yyvsp = yyval;
1628
1629 /* Now `shift' the result of the reduction. Determine what state
1630 that goes to, based on the state we popped back to and the rule
1631 number reduced by. */
1632
1633 yyn = yyr1[yyn];
1634
1635 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1636 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1637 {
1638 yystate = yytable[yystate];
1639 }
1640 else
1641 {
1642 yystate = yydefgoto[yyn - YYNTOKENS];
1643 }
1644
1645 goto yynewstate;
1646
1647
1648 /*------------------------------------.
1649 | yyerrlab -- here on detecting error |
1650 `------------------------------------*/
1651yyerrlab:
1652 /* Make sure we have latest lookahead translation. See comments at
1653 user semantic actions for why this is necessary. */
1654 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE(yychar);
1655
1656 /* If not already recovering from an error, report this error. */
1657 if (!yyerrstatus)
1658 {
1659 ++yynerrs;
1660#if !YYERROR_VERBOSE
1661 yyerror(YY_("syntax error"));
1662#else
1663#define YYSYNTAX_ERROR yysyntax_error(&yymsg_alloc, &yymsg, yyssp, yytoken)
1664 {
1665 char const* yymsgp = YY_("syntax error");
1666 int yysyntax_error_status;
1667 yysyntax_error_status = YYSYNTAX_ERROR;
1668 if (yysyntax_error_status == 0)
1669 {
1670 yymsgp = yymsg;
1671 }
1672 else if (yysyntax_error_status == 1)
1673 {
1674 if (yymsg != yymsgbuf)
1675 {
1676 YYSTACK_FREE(yymsg);
1677 }
1678 yymsg = (char*)YYSTACK_ALLOC(yymsg_alloc);
1679 if (!yymsg)
1680 {
1681 yymsg = yymsgbuf;
1682 yymsg_alloc = sizeof yymsgbuf;
1683 yysyntax_error_status = 2;
1684 }
1685 else
1686 {
1687 yysyntax_error_status = YYSYNTAX_ERROR;
1688 yymsgp = yymsg;
1689 }
1690 }
1691 yyerror(yymsgp);
1692 if (yysyntax_error_status == 2)
1693 {
1694 goto yyexhaustedlab;
1695 }
1696 }
1697#undef YYSYNTAX_ERROR
1698#endif
1699 }
1700
1701
1702 if (yyerrstatus == 3)
1703 {
1704 /* If just tried and failed to reuse lookahead token after an
1705 error, discard it. */
1706
1707 if (yychar <= YYEOF)
1708 {
1709 /* Return failure if at end of input. */
1710 if (yychar == YYEOF)
1711 {
1712 YYABORT;
1713 }
1714 }
1715 else
1716 {
1717 yydestruct("Error: discarding", yytoken, &yylval);
1718 yychar = YYEMPTY;
1719 }
1720 }
1721
1722 /* Else will try to reuse lookahead token after shifting the error
1723 token. */
1724 goto yyerrlab1;
1725
1726
1727 /*---------------------------------------------------.
1728 | yyerrorlab -- error raised explicitly by YYERROR. |
1729 `---------------------------------------------------*/
1730yyerrorlab:
1731
1732 /* Pacify compilers like GCC when the user code never invokes
1733 YYERROR and the label yyerrorlab therefore never appears in user
1734 code. */
1735 if (/*CONSTCOND*/ 0)
1736 {
1737 goto yyerrorlab;
1738 }
1739
1740 /* Do not reclaim the symbols of the rule which action triggered
1741 this YYERROR. */
1742 YYPOPSTACK(yylen);
1743 yylen = 0;
1744 YY_STACK_PRINT(yyss, yyssp);
1745 yystate = *yyssp;
1746 goto yyerrlab1;
1747
1748
1749 /*-------------------------------------------------------------.
1750 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1751 `-------------------------------------------------------------*/
1752yyerrlab1:
1753 yyerrstatus = 3; /* Each real token shifted decrements this. */
1754
1755 for (;;)
1756 {
1757 yyn = yypact[yystate];
1758 if (!yypact_value_is_default(yyn))
1759 {
1760 yyn += YYTERROR;
1761 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1762 {
1763 yyn = yytable[yyn];
1764 if (0 < yyn)
1765 {
1766 break;
1767 }
1768 }
1769 }
1770
1771 /* Pop the current state because it cannot handle the error token. */
1772 if (yyssp == yyss)
1773 {
1774 YYABORT;
1775 }
1776
1777
1778 yydestruct("Error: popping", yystos[yystate], yyvsp);
1779 YYPOPSTACK(1);
1780 yystate = *yyssp;
1781 YY_STACK_PRINT(yyss, yyssp);
1782 }
1783
1785 *++yyvsp = yylval;
1787
1788
1789 /* Shift the error token. */
1790 YY_SYMBOL_PRINT("Shifting", yystos[yyn], yyvsp, yylsp);
1791
1792 yystate = yyn;
1793 goto yynewstate;
1794
1795
1796 /*-------------------------------------.
1797 | yyacceptlab -- YYACCEPT comes here. |
1798 `-------------------------------------*/
1799yyacceptlab:
1800 yyresult = 0;
1801 goto yyreturn;
1802
1803 /*-----------------------------------.
1804 | yyabortlab -- YYABORT comes here. |
1805 `-----------------------------------*/
1806yyabortlab:
1807 yyresult = 1;
1808 goto yyreturn;
1809
1810#if !defined yyoverflow || YYERROR_VERBOSE
1811 /*-------------------------------------------------.
1812 | yyexhaustedlab -- memory exhaustion comes here. |
1813 `-------------------------------------------------*/
1814yyexhaustedlab:
1815 yyerror(YY_("memory exhausted"));
1816 yyresult = 2;
1817 /* Fall through. */
1818#endif
1819
1820yyreturn:
1821 if (yychar != YYEMPTY)
1822 {
1823 /* Make sure we have latest lookahead translation. See comments at
1824 user semantic actions for why this is necessary. */
1825 yytoken = YYTRANSLATE(yychar);
1826 yydestruct("Cleanup: discarding lookahead", yytoken, &yylval);
1827 }
1828 /* Do not reclaim the symbols of the rule which action triggered
1829 this YYABORT or YYACCEPT. */
1830 YYPOPSTACK(yylen);
1831 YY_STACK_PRINT(yyss, yyssp);
1832 while (yyssp != yyss)
1833 {
1834 yydestruct("Cleanup: popping", yystos[*yyssp], yyvsp);
1835 YYPOPSTACK(1);
1836 }
1837#ifndef yyoverflow
1838 if (yyss != yyssa)
1839 {
1840 YYSTACK_FREE(yyss);
1841 }
1842#endif
1843#if YYERROR_VERBOSE
1844 if (yymsg != yymsgbuf)
1845 {
1846 YYSTACK_FREE(yymsg);
1847 }
1848#endif
1849 /* Make sure YYID is used. */
1850 return YYID(yyresult);
1851}
1852
1853
1854/* Line 2055 of yacc.c */
1855#line 196 "src/IceStorm/Grammar.y"
unsigned short int yytype_uint16
Definition Grammar.cpp:209
#define YYLEX
Definition Grammar.cpp:599
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
int yytype
Definition Grammar.cpp:639
#define YYMAXDEPTH
Definition Grammar.cpp:777
yytokentype
Definition Grammar.cpp:142
@ ICE_STORM_SUBSCRIBERS
Definition Grammar.cpp:153
@ ICE_STORM_TOPICS
Definition Grammar.cpp:151
@ ICE_STORM_LINK
Definition Grammar.cpp:148
@ ICE_STORM_REPLICA
Definition Grammar.cpp:152
@ ICE_STORM_CURRENT
Definition Grammar.cpp:145
@ ICE_STORM_UNLINK
Definition Grammar.cpp:149
@ ICE_STORM_LINKS
Definition Grammar.cpp:150
@ ICE_STORM_EXIT
Definition Grammar.cpp:144
@ ICE_STORM_HELP
Definition Grammar.cpp:143
@ ICE_STORM_STRING
Definition Grammar.cpp:154
@ ICE_STORM_DESTROY
Definition Grammar.cpp:147
@ ICE_STORM_CREATE
Definition Grammar.cpp:146
#define YYSTACK_FREE
Definition Grammar.cpp:315
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
Definition Grammar.cpp:617
#define yyerrok
Definition Grammar.cpp:540
#define YY_(Msgid)
Definition Grammar.cpp:242
int YYSTYPE
Definition Grammar.cpp:160
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
#define YYUSE(E)
Definition Grammar.cpp:248
#define YYEOF
Definition Grammar.cpp:543
#define YYABORT
Definition Grammar.cpp:546
#define yypact_value_is_default(Yystate)
Definition Grammar.cpp:524
#define YYSTACK_BYTES(N)
Definition Grammar.cpp:359
#define YY_REDUCE_PRINT(Rule)
Definition Grammar.cpp:746
#define YYFINAL
Definition Grammar.cpp:399
YYSTYPE const *const yyvaluep
Definition Grammar.cpp:640
#define YY_INITIAL_VALUE(Value)
int yyrule
Definition Grammar.cpp:730
#define YYNTOKENS
Definition Grammar.cpp:404
unsigned long int yylno
Definition Grammar.cpp:735
unsigned char yytype_uint8
Definition Grammar.cpp:195
#define YY_STACK_PRINT(Bottom, Top)
Definition Grammar.cpp:713
#define YYSIZE_T
Definition Grammar.cpp:228
#define YYSTACK_ALLOC_MAXIMUM
Definition Grammar.cpp:317
#define YY_NULL
Definition Grammar.cpp:111
#define YYACCEPT
Definition Grammar.cpp:545
#define YYTRANSLATE(YYX)
Definition Grammar.cpp:416
int yydebug
Definition Grammar.cpp:755
yytype_int16 * yytop
Definition Grammar.cpp:701
#define YYID(N)
Definition Grammar.cpp:255
int yyi
Definition Grammar.cpp:734
int yyparse()
Definition Grammar.cpp:1086
#define YYTERROR
Definition Grammar.cpp:585
#define YYPOPSTACK(N)
short int yytype_int16
Definition Grammar.cpp:215
void yyerror(const char *s)
Definition Grammar.cpp:99
#define YYEMPTY
Definition Grammar.cpp:542
#define YYLAST
Definition Grammar.cpp:401
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition Grammar.cpp:368
#define YYINITDEPTH
Definition Grammar.cpp:766
#define yytable_value_is_error(Yytable_value)
Definition Grammar.cpp:526
#define YYFPRINTF
Definition Grammar.cpp:607
#define YYSTACK_ALLOC
Definition Grammar.cpp:314
#define YYDPRINTF(Args)
Definition Grammar.cpp:610
short int yytype_int8
Definition Grammar.cpp:203
#define YYSTYPE
Definition Parser.h:24
#define yyoverflow(a, b, c, d, e, f)
Definition Parser.h:44
Parser * parser
Definition Parser.cpp:34
yytype_int16 yyss_alloc
Definition Grammar.cpp:350
YYSTYPE yyvs_alloc
Definition Grammar.cpp:351