1 /* A Bison parser, made by GNU Bison 2.3. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
23 /* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
39 /* All symbols defined below should begin with yy or YY, to avoid
40 infringing on user name space. This should be done even for local
41 variables, as they might otherwise be expanded by user macros.
42 There are some unavoidable exceptions within include files to
43 define necessary library symbols; they are noted "INFRINGES ON
44 USER NAME SPACE" below. */
46 /* Identify Bison output. */
50 #define YYBISON_VERSION "2.3"
53 #define YYSKELETON_NAME "yacc.c"
58 /* Using locations. */
59 #define YYLSP_NEEDED 0
66 /* Put the tokens into the symbol table, so that GDB and other debuggers
81 #define UNIMPLEMENTED 261
88 /* Copy the first part of user declarations. */
92 * Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
93 * (Royal Institute of Technology, Stockholm, Sweden).
94 * All rights reserved.
96 * Redistribution and use in source and binary forms, with or without
97 * modification, are permitted provided that the following conditions
100 * 1. Redistributions of source code must retain the above copyright
101 * notice, this list of conditions and the following disclaimer.
103 * 2. Redistributions in binary form must reproduce the above copyright
104 * notice, this list of conditions and the following disclaimer in the
105 * documentation and/or other materials provided with the distribution.
107 * 3. Neither the name of the Institute nor the names of its contributors
108 * may be used to endorse or promote products derived from this software
109 * without specific prior written permission.
111 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
112 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
113 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
114 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
115 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
116 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
117 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
118 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
119 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
120 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
124 #include "make_cmds.h"
125 RCSID("$Id: parse.y 21745 2007-07-31 16:11:25Z lha $");
127 static void yyerror (char *s);
129 struct string_list* append_string(struct string_list*, char*);
130 void free_string_list(struct string_list *list);
131 unsigned string_to_flag(const char *);
133 /* This is for bison */
135 #if !defined(alloca) && !defined(HAVE_ALLOCA)
136 #define alloca(x) malloc(x)
141 /* Enabling traces. */
146 /* Enabling verbose error messages. */
147 #ifdef YYERROR_VERBOSE
148 # undef YYERROR_VERBOSE
149 # define YYERROR_VERBOSE 1
151 # define YYERROR_VERBOSE 0
154 /* Enabling the token table. */
155 #ifndef YYTOKEN_TABLE
156 # define YYTOKEN_TABLE 0
159 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
160 typedef union YYSTYPE
165 struct string_list *list;
167 /* Line 193 of yacc.c. */
170 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
171 # define YYSTYPE_IS_DECLARED 1
172 # define YYSTYPE_IS_TRIVIAL 1
177 /* Copy the second part of user declarations. */
180 /* Line 216 of yacc.c. */
188 typedef YYTYPE_UINT8 yytype_uint8;
190 typedef unsigned char yytype_uint8;
194 typedef YYTYPE_INT8 yytype_int8;
195 #elif (defined __STDC__ || defined __C99__FUNC__ \
196 || defined __cplusplus || defined _MSC_VER)
197 typedef signed char yytype_int8;
199 typedef short int yytype_int8;
203 typedef YYTYPE_UINT16 yytype_uint16;
205 typedef unsigned short int yytype_uint16;
209 typedef YYTYPE_INT16 yytype_int16;
211 typedef short int yytype_int16;
215 # ifdef __SIZE_TYPE__
216 # define YYSIZE_T __SIZE_TYPE__
217 # elif defined size_t
218 # define YYSIZE_T size_t
219 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
220 || defined __cplusplus || defined _MSC_VER)
221 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
222 # define YYSIZE_T size_t
224 # define YYSIZE_T unsigned int
228 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
231 # if defined YYENABLE_NLS && YYENABLE_NLS
233 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
234 # define YY_(msgid) dgettext ("bison-runtime", msgid)
238 # define YY_(msgid) msgid
242 /* Suppress unused-variable warnings by "using" E. */
243 #if ! defined lint || defined __GNUC__
244 # define YYUSE(e) ((void) (e))
246 # define YYUSE(e) /* empty */
249 /* Identity function, used to suppress warnings about constant conditions. */
253 #if (defined __STDC__ || defined __C99__FUNC__ \
254 || defined __cplusplus || defined _MSC_VER)
267 #if ! defined yyoverflow || YYERROR_VERBOSE
269 /* The parser invokes alloca or malloc; define the necessary symbols. */
271 # ifdef YYSTACK_USE_ALLOCA
272 # if YYSTACK_USE_ALLOCA
274 # define YYSTACK_ALLOC __builtin_alloca
275 # elif defined __BUILTIN_VA_ARG_INCR
276 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
278 # define YYSTACK_ALLOC __alloca
279 # elif defined _MSC_VER
280 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
281 # define alloca _alloca
283 # define YYSTACK_ALLOC alloca
284 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
285 || defined __cplusplus || defined _MSC_VER)
286 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
295 # ifdef YYSTACK_ALLOC
296 /* Pacify GCC's `empty if-body' warning. */
297 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
298 # ifndef YYSTACK_ALLOC_MAXIMUM
299 /* The OS might guarantee only one guard page at the bottom of the stack,
300 and a page size can be as small as 4096 bytes. So we cannot safely
301 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
302 to allow for a few compiler-allocated temporary stack slots. */
303 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
306 # define YYSTACK_ALLOC YYMALLOC
307 # define YYSTACK_FREE YYFREE
308 # ifndef YYSTACK_ALLOC_MAXIMUM
309 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
311 # if (defined __cplusplus && ! defined _STDLIB_H \
312 && ! ((defined YYMALLOC || defined malloc) \
313 && (defined YYFREE || defined free)))
314 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
320 # define YYMALLOC malloc
321 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
322 || defined __cplusplus || defined _MSC_VER)
323 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
328 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
329 || defined __cplusplus || defined _MSC_VER)
330 void free (void *); /* INFRINGES ON USER NAME SPACE */
334 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
337 #if (! defined yyoverflow \
338 && (! defined __cplusplus \
339 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
341 /* A type that is properly aligned for any stack member. */
348 /* The size of the maximum gap between one aligned stack and the next. */
349 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
351 /* The size of an array large to enough to hold all stacks, each with
353 # define YYSTACK_BYTES(N) \
354 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
355 + YYSTACK_GAP_MAXIMUM)
357 /* Copy COUNT objects from FROM to TO. The source and destination do
360 # if defined __GNUC__ && 1 < __GNUC__
361 # define YYCOPY(To, From, Count) \
362 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
364 # define YYCOPY(To, From, Count) \
368 for (yyi = 0; yyi < (Count); yyi++) \
369 (To)[yyi] = (From)[yyi]; \
375 /* Relocate STACK from its old location to the new one. The
376 local variables YYSIZE and YYSTACKSIZE give the old and new number of
377 elements in the stack, and YYPTR gives the new location of the
378 stack. Advance YYPTR to a properly aligned location for the next
380 # define YYSTACK_RELOCATE(Stack) \
383 YYSIZE_T yynewbytes; \
384 YYCOPY (&yyptr->Stack, Stack, yysize); \
385 Stack = &yyptr->Stack; \
386 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
387 yyptr += yynewbytes / sizeof (*yyptr); \
393 /* YYFINAL -- State number of the termination state. */
395 /* YYLAST -- Last index in YYTABLE. */
398 /* YYNTOKENS -- Number of terminals. */
400 /* YYNNTS -- Number of nonterminals. */
402 /* YYNRULES -- Number of rules. */
404 /* YYNRULES -- Number of states. */
407 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
409 #define YYMAXUTOK 263
411 #define YYTRANSLATE(YYX) \
412 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
414 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
415 static const yytype_uint8 yytranslate[] =
417 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
418 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
419 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
420 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
421 11, 12, 2, 2, 10, 2, 2, 2, 2, 2,
422 2, 2, 2, 2, 2, 2, 2, 2, 2, 9,
423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
424 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
425 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
426 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
427 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
428 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
429 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
430 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
431 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
432 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
433 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
434 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
435 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
436 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
437 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
438 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
439 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
441 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
442 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
447 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
449 static const yytype_uint8 yyprhs[] =
451 0, 0, 3, 4, 6, 8, 11, 15, 27, 35,
452 43, 47, 50, 52, 56, 58, 62
455 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
456 static const yytype_int8 yyrhs[] =
458 14, 0, -1, -1, 15, -1, 16, -1, 15, 16,
459 -1, 3, 8, 9, -1, 4, 8, 10, 8, 10,
460 17, 10, 11, 18, 12, 9, -1, 4, 8, 10,
461 8, 10, 17, 9, -1, 6, 8, 10, 8, 10,
462 17, 9, -1, 5, 17, 9, -1, 7, 9, -1,
463 8, -1, 17, 10, 8, -1, 19, -1, 18, 10,
467 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
468 static const yytype_uint8 yyrline[] =
470 0, 65, 65, 66, 69, 70, 73, 77, 81, 85,
471 91, 95, 101, 105, 111, 115, 120
475 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
476 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
477 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
478 static const char *const yytname[] =
480 "$end", "error", "$undefined", "TABLE", "REQUEST", "UNKNOWN",
481 "UNIMPLEMENTED", "END", "STRING", "';'", "','", "'('", "')'", "$accept",
482 "file", "statements", "statement", "aliases", "flags", "flag", 0
487 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
489 static const yytype_uint16 yytoknum[] =
491 0, 256, 257, 258, 259, 260, 261, 262, 263, 59,
496 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
497 static const yytype_uint8 yyr1[] =
499 0, 13, 14, 14, 15, 15, 16, 16, 16, 16,
500 16, 16, 17, 17, 18, 18, 19
503 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
504 static const yytype_uint8 yyr2[] =
506 0, 2, 0, 1, 1, 2, 3, 11, 7, 7,
510 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
511 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
512 means the default is an error. */
513 static const yytype_uint8 yydefact[] =
515 2, 0, 0, 0, 0, 0, 0, 3, 4, 0,
516 0, 12, 0, 0, 11, 1, 5, 6, 0, 10,
517 0, 0, 0, 13, 0, 0, 0, 0, 0, 8,
518 0, 9, 0, 16, 0, 14, 0, 0, 15, 7
521 /* YYDEFGOTO[NTERM-NUM]. */
522 static const yytype_int8 yydefgoto[] =
524 -1, 6, 7, 8, 12, 34, 35
527 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
529 #define YYPACT_NINF -10
530 static const yytype_int8 yypact[] =
532 -3, 0, 10, 11, 12, 13, 21, -3, -10, 14,
533 15, -10, 1, 16, -10, -10, -10, -10, 19, -10,
534 20, 22, 23, -10, 24, 11, 11, 3, 5, -10,
535 -2, -10, 27, -10, -5, -10, 27, 28, -10, -10
538 /* YYPGOTO[NTERM-NUM]. */
539 static const yytype_int8 yypgoto[] =
541 -10, -10, -10, 17, -9, -10, -7
544 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
545 positive, shift that token. If negative, reduce the rule which
546 number is the opposite. If zero, do what YYDEFACT says.
547 If YYTABLE_NINF, syntax error. */
548 #define YYTABLE_NINF -1
549 static const yytype_uint8 yytable[] =
551 1, 2, 3, 4, 5, 36, 23, 37, 9, 32,
552 19, 20, 29, 30, 31, 20, 27, 28, 10, 11,
553 13, 15, 14, 17, 16, 18, 21, 22, 23, 38,
554 24, 0, 0, 25, 26, 33, 0, 39
557 static const yytype_int8 yycheck[] =
559 3, 4, 5, 6, 7, 10, 8, 12, 8, 11,
560 9, 10, 9, 10, 9, 10, 25, 26, 8, 8,
561 8, 0, 9, 9, 7, 10, 10, 8, 8, 36,
562 8, -1, -1, 10, 10, 8, -1, 9
565 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
566 symbol of state STATE-NUM. */
567 static const yytype_uint8 yystos[] =
569 0, 3, 4, 5, 6, 7, 14, 15, 16, 8,
570 8, 8, 17, 8, 9, 0, 16, 9, 10, 9,
571 10, 10, 8, 8, 8, 10, 10, 17, 17, 9,
572 10, 9, 11, 8, 18, 19, 10, 12, 19, 9
575 #define yyerrok (yyerrstatus = 0)
576 #define yyclearin (yychar = YYEMPTY)
580 #define YYACCEPT goto yyacceptlab
581 #define YYABORT goto yyabortlab
582 #define YYERROR goto yyerrorlab
585 /* Like YYERROR except do call yyerror. This remains here temporarily
586 to ease the transition to the new meaning of YYERROR, for GCC.
587 Once GCC version 2 has supplanted version 1, this can go. */
589 #define YYFAIL goto yyerrlab
591 #define YYRECOVERING() (!!yyerrstatus)
593 #define YYBACKUP(Token, Value) \
595 if (yychar == YYEMPTY && yylen == 1) \
599 yytoken = YYTRANSLATE (yychar); \
605 yyerror (YY_("syntax error: cannot back up")); \
612 #define YYERRCODE 256
615 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
616 If N is 0, then set CURRENT to the empty location which ends
617 the previous symbol: RHS[0] (always defined). */
619 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
620 #ifndef YYLLOC_DEFAULT
621 # define YYLLOC_DEFAULT(Current, Rhs, N) \
625 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
626 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
627 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
628 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
632 (Current).first_line = (Current).last_line = \
633 YYRHSLOC (Rhs, 0).last_line; \
634 (Current).first_column = (Current).last_column = \
635 YYRHSLOC (Rhs, 0).last_column; \
641 /* YY_LOCATION_PRINT -- Print the location on the stream.
642 This macro was not mandated originally: define only if we know
643 we won't break user code: when these are the locations we know. */
645 #ifndef YY_LOCATION_PRINT
646 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
647 # define YY_LOCATION_PRINT(File, Loc) \
648 fprintf (File, "%d.%d-%d.%d", \
649 (Loc).first_line, (Loc).first_column, \
650 (Loc).last_line, (Loc).last_column)
652 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
657 /* YYLEX -- calling `yylex' with the right arguments. */
660 # define YYLEX yylex (YYLEX_PARAM)
662 # define YYLEX yylex ()
665 /* Enable debugging if requested. */
669 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
670 # define YYFPRINTF fprintf
673 # define YYDPRINTF(Args) \
679 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
683 YYFPRINTF (stderr, "%s ", Title); \
684 yy_symbol_print (stderr, \
686 YYFPRINTF (stderr, "\n"); \
691 /*--------------------------------.
692 | Print this symbol on YYOUTPUT. |
693 `--------------------------------*/
696 #if (defined __STDC__ || defined __C99__FUNC__ \
697 || defined __cplusplus || defined _MSC_VER)
699 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
702 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
705 YYSTYPE const * const yyvaluep;
711 if (yytype < YYNTOKENS)
712 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
724 /*--------------------------------.
725 | Print this symbol on YYOUTPUT. |
726 `--------------------------------*/
728 #if (defined __STDC__ || defined __C99__FUNC__ \
729 || defined __cplusplus || defined _MSC_VER)
731 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
734 yy_symbol_print (yyoutput, yytype, yyvaluep)
737 YYSTYPE const * const yyvaluep;
740 if (yytype < YYNTOKENS)
741 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
743 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
745 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
746 YYFPRINTF (yyoutput, ")");
749 /*------------------------------------------------------------------.
750 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
752 `------------------------------------------------------------------*/
754 #if (defined __STDC__ || defined __C99__FUNC__ \
755 || defined __cplusplus || defined _MSC_VER)
757 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
760 yy_stack_print (bottom, top)
761 yytype_int16 *bottom;
765 YYFPRINTF (stderr, "Stack now");
766 for (; bottom <= top; ++bottom)
767 YYFPRINTF (stderr, " %d", *bottom);
768 YYFPRINTF (stderr, "\n");
771 # define YY_STACK_PRINT(Bottom, Top) \
774 yy_stack_print ((Bottom), (Top)); \
778 /*------------------------------------------------.
779 | Report that the YYRULE is going to be reduced. |
780 `------------------------------------------------*/
782 #if (defined __STDC__ || defined __C99__FUNC__ \
783 || defined __cplusplus || defined _MSC_VER)
785 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
788 yy_reduce_print (yyvsp, yyrule)
793 int yynrhs = yyr2[yyrule];
795 unsigned long int yylno = yyrline[yyrule];
796 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
798 /* The symbols being reduced. */
799 for (yyi = 0; yyi < yynrhs; yyi++)
801 fprintf (stderr, " $%d = ", yyi + 1);
802 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
803 &(yyvsp[(yyi + 1) - (yynrhs)])
805 fprintf (stderr, "\n");
809 # define YY_REDUCE_PRINT(Rule) \
812 yy_reduce_print (yyvsp, Rule); \
815 /* Nonzero means print parse trace. It is left uninitialized so that
816 multiple parsers can coexist. */
819 # define YYDPRINTF(Args)
820 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
821 # define YY_STACK_PRINT(Bottom, Top)
822 # define YY_REDUCE_PRINT(Rule)
823 #endif /* !YYDEBUG */
826 /* YYINITDEPTH -- initial size of the parser's stacks. */
828 # define YYINITDEPTH 200
831 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
832 if the built-in stack extension method is used).
834 Do not make this value too large; the results are undefined if
835 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
836 evaluated with infinite-precision integer arithmetic. */
839 # define YYMAXDEPTH 10000
847 # if defined __GLIBC__ && defined _STRING_H
848 # define yystrlen strlen
850 /* Return the length of YYSTR. */
851 #if (defined __STDC__ || defined __C99__FUNC__ \
852 || defined __cplusplus || defined _MSC_VER)
854 yystrlen (const char *yystr)
862 for (yylen = 0; yystr[yylen]; yylen++)
870 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
871 # define yystpcpy stpcpy
873 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
875 #if (defined __STDC__ || defined __C99__FUNC__ \
876 || defined __cplusplus || defined _MSC_VER)
878 yystpcpy (char *yydest, const char *yysrc)
881 yystpcpy (yydest, yysrc)
887 const char *yys = yysrc;
889 while ((*yyd++ = *yys++) != '\0')
898 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
899 quotes and backslashes, so that it's suitable for yyerror. The
900 heuristic is that double-quoting is unnecessary unless the string
901 contains an apostrophe, a comma, or backslash (other than
902 backslash-backslash). YYSTR is taken from yytname. If YYRES is
903 null, do not copy; instead, return the length of what the result
906 yytnamerr (char *yyres, const char *yystr)
911 char const *yyp = yystr;
918 goto do_not_strip_quotes;
922 goto do_not_strip_quotes;
935 do_not_strip_quotes: ;
939 return yystrlen (yystr);
941 return yystpcpy (yyres, yystr) - yyres;
945 /* Copy into YYRESULT an error message about the unexpected token
946 YYCHAR while in state YYSTATE. Return the number of bytes copied,
947 including the terminating null byte. If YYRESULT is null, do not
948 copy anything; just return the number of bytes that would be
949 copied. As a special case, return 0 if an ordinary "syntax error"
950 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
953 yysyntax_error (char *yyresult, int yystate, int yychar)
955 int yyn = yypact[yystate];
957 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
961 int yytype = YYTRANSLATE (yychar);
962 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
963 YYSIZE_T yysize = yysize0;
965 int yysize_overflow = 0;
966 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
967 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
971 /* This is so xgettext sees the translatable formats that are
972 constructed on the fly. */
973 YY_("syntax error, unexpected %s");
974 YY_("syntax error, unexpected %s, expecting %s");
975 YY_("syntax error, unexpected %s, expecting %s or %s");
976 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
977 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
981 static char const yyunexpected[] = "syntax error, unexpected %s";
982 static char const yyexpecting[] = ", expecting %s";
983 static char const yyor[] = " or %s";
984 char yyformat[sizeof yyunexpected
985 + sizeof yyexpecting - 1
986 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
987 * (sizeof yyor - 1))];
988 char const *yyprefix = yyexpecting;
990 /* Start YYX at -YYN if negative to avoid negative indexes in
992 int yyxbegin = yyn < 0 ? -yyn : 0;
994 /* Stay within bounds of both yycheck and yytname. */
995 int yychecklim = YYLAST - yyn + 1;
996 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
999 yyarg[0] = yytname[yytype];
1000 yyfmt = yystpcpy (yyformat, yyunexpected);
1002 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1003 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1005 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1009 yyformat[sizeof yyunexpected - 1] = '\0';
1012 yyarg[yycount++] = yytname[yyx];
1013 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1014 yysize_overflow |= (yysize1 < yysize);
1016 yyfmt = yystpcpy (yyfmt, yyprefix);
1020 yyf = YY_(yyformat);
1021 yysize1 = yysize + yystrlen (yyf);
1022 yysize_overflow |= (yysize1 < yysize);
1025 if (yysize_overflow)
1026 return YYSIZE_MAXIMUM;
1030 /* Avoid sprintf, as that infringes on the user's name space.
1031 Don't have undefined behavior even if the translation
1032 produced a string with the wrong number of "%s"s. */
1033 char *yyp = yyresult;
1035 while ((*yyp = *yyf) != '\0')
1037 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1039 yyp += yytnamerr (yyp, yyarg[yyi++]);
1052 #endif /* YYERROR_VERBOSE */
1055 /*-----------------------------------------------.
1056 | Release the memory associated to this symbol. |
1057 `-----------------------------------------------*/
1060 #if (defined __STDC__ || defined __C99__FUNC__ \
1061 || defined __cplusplus || defined _MSC_VER)
1063 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1066 yydestruct (yymsg, yytype, yyvaluep)
1076 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1087 /* Prevent warnings from -Wmissing-prototypes. */
1089 #ifdef YYPARSE_PARAM
1090 #if defined __STDC__ || defined __cplusplus
1091 int yyparse (void *YYPARSE_PARAM);
1095 #else /* ! YYPARSE_PARAM */
1096 #if defined __STDC__ || defined __cplusplus
1101 #endif /* ! YYPARSE_PARAM */
1105 /* The look-ahead symbol. */
1108 /* The semantic value of the look-ahead symbol. */
1111 /* Number of syntax errors so far. */
1120 #ifdef YYPARSE_PARAM
1121 #if (defined __STDC__ || defined __C99__FUNC__ \
1122 || defined __cplusplus || defined _MSC_VER)
1124 yyparse (void *YYPARSE_PARAM)
1127 yyparse (YYPARSE_PARAM)
1128 void *YYPARSE_PARAM;
1130 #else /* ! YYPARSE_PARAM */
1131 #if (defined __STDC__ || defined __C99__FUNC__ \
1132 || defined __cplusplus || defined _MSC_VER)
1146 /* Number of tokens to shift before error messages enabled. */
1148 /* Look-ahead token as an internal (translated) token number. */
1151 /* Buffer for error messages, and its allocated size. */
1153 char *yymsg = yymsgbuf;
1154 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1157 /* Three stacks and their tools:
1158 `yyss': related to states,
1159 `yyvs': related to semantic values,
1160 `yyls': related to locations.
1162 Refer to the stacks thru separate pointers, to allow yyoverflow
1163 to reallocate them elsewhere. */
1165 /* The state stack. */
1166 yytype_int16 yyssa[YYINITDEPTH];
1167 yytype_int16 *yyss = yyssa;
1168 yytype_int16 *yyssp;
1170 /* The semantic value stack. */
1171 YYSTYPE yyvsa[YYINITDEPTH];
1172 YYSTYPE *yyvs = yyvsa;
1177 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1179 YYSIZE_T yystacksize = YYINITDEPTH;
1181 /* The variables used to return semantic value and location from the
1186 /* The number of symbols on the RHS of the reduced rule.
1187 Keep to zero when no symbol should be popped. */
1190 YYDPRINTF ((stderr, "Starting parse\n"));
1195 yychar = YYEMPTY; /* Cause a token to be read. */
1197 /* Initialize stack pointers.
1198 Waste one element of value and location stack
1199 so that they stay on the same level as the state stack.
1200 The wasted elements are never initialized. */
1207 /*------------------------------------------------------------.
1208 | yynewstate -- Push a new state, which is found in yystate. |
1209 `------------------------------------------------------------*/
1211 /* In all cases, when you get here, the value and location stacks
1212 have just been pushed. So pushing a state here evens the stacks. */
1218 if (yyss + yystacksize - 1 <= yyssp)
1220 /* Get the current used size of the three stacks, in elements. */
1221 YYSIZE_T yysize = yyssp - yyss + 1;
1225 /* Give user a chance to reallocate the stack. Use copies of
1226 these so that the &'s don't force the real ones into
1228 YYSTYPE *yyvs1 = yyvs;
1229 yytype_int16 *yyss1 = yyss;
1232 /* Each stack pointer address is followed by the size of the
1233 data in use in that stack, in bytes. This used to be a
1234 conditional around just the two extra args, but that might
1235 be undefined if yyoverflow is a macro. */
1236 yyoverflow (YY_("memory exhausted"),
1237 &yyss1, yysize * sizeof (*yyssp),
1238 &yyvs1, yysize * sizeof (*yyvsp),
1245 #else /* no yyoverflow */
1246 # ifndef YYSTACK_RELOCATE
1247 goto yyexhaustedlab;
1249 /* Extend the stack our own way. */
1250 if (YYMAXDEPTH <= yystacksize)
1251 goto yyexhaustedlab;
1253 if (YYMAXDEPTH < yystacksize)
1254 yystacksize = YYMAXDEPTH;
1257 yytype_int16 *yyss1 = yyss;
1258 union yyalloc *yyptr =
1259 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1261 goto yyexhaustedlab;
1262 YYSTACK_RELOCATE (yyss);
1263 YYSTACK_RELOCATE (yyvs);
1265 # undef YYSTACK_RELOCATE
1267 YYSTACK_FREE (yyss1);
1270 #endif /* no yyoverflow */
1272 yyssp = yyss + yysize - 1;
1273 yyvsp = yyvs + yysize - 1;
1276 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1277 (unsigned long int) yystacksize));
1279 if (yyss + yystacksize - 1 <= yyssp)
1283 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1292 /* Do appropriate processing given the current state. Read a
1293 look-ahead token if we need one and don't already have one. */
1295 /* First try to decide what to do without reference to look-ahead token. */
1296 yyn = yypact[yystate];
1297 if (yyn == YYPACT_NINF)
1300 /* Not known => get a look-ahead token if don't already have one. */
1302 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1303 if (yychar == YYEMPTY)
1305 YYDPRINTF ((stderr, "Reading a token: "));
1309 if (yychar <= YYEOF)
1311 yychar = yytoken = YYEOF;
1312 YYDPRINTF ((stderr, "Now at end of input.\n"));
1316 yytoken = YYTRANSLATE (yychar);
1317 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1320 /* If the proper action on seeing token YYTOKEN is to reduce or to
1321 detect an error, take that action. */
1323 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1328 if (yyn == 0 || yyn == YYTABLE_NINF)
1337 /* Count tokens shifted since error; after three, turn off error
1342 /* Shift the look-ahead token. */
1343 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1345 /* Discard the shifted token unless it is eof. */
1346 if (yychar != YYEOF)
1355 /*-----------------------------------------------------------.
1356 | yydefault -- do the default action for the current state. |
1357 `-----------------------------------------------------------*/
1359 yyn = yydefact[yystate];
1365 /*-----------------------------.
1366 | yyreduce -- Do a reduction. |
1367 `-----------------------------*/
1369 /* yyn is the number of a rule to reduce with. */
1372 /* If YYLEN is nonzero, implement the default value of the action:
1375 Otherwise, the following line sets YYVAL to garbage.
1376 This behavior is undocumented and Bison
1377 users should not rely upon it. Assigning to YYVAL
1378 unconditionally makes the parser a bit smaller, and it avoids a
1379 GCC warning that YYVAL may be used uninitialized. */
1380 yyval = yyvsp[1-yylen];
1383 YY_REDUCE_PRINT (yyn);
1389 table_name = (yyvsp[(2) - (3)].string);
1396 add_command((yyvsp[(2) - (11)].string), (yyvsp[(4) - (11)].string), (yyvsp[(6) - (11)].list), (yyvsp[(9) - (11)].number));
1403 add_command((yyvsp[(2) - (7)].string), (yyvsp[(4) - (7)].string), (yyvsp[(6) - (7)].list), 0);
1410 free((yyvsp[(2) - (7)].string));
1411 free((yyvsp[(4) - (7)].string));
1412 free_string_list((yyvsp[(6) - (7)].list));
1419 free_string_list((yyvsp[(2) - (3)].list));
1433 (yyval.list) = append_string(NULL, (yyvsp[(1) - (1)].string));
1440 (yyval.list) = append_string((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].string));
1447 (yyval.number) = (yyvsp[(1) - (1)].number);
1454 (yyval.number) = (yyvsp[(1) - (3)].number) | (yyvsp[(3) - (3)].number);
1461 (yyval.number) = string_to_flag((yyvsp[(1) - (1)].string));
1462 free((yyvsp[(1) - (1)].string));
1467 /* Line 1267 of yacc.c. */
1468 #line 1469 "parse.c"
1471 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1475 YY_STACK_PRINT (yyss, yyssp);
1480 /* Now `shift' the result of the reduction. Determine what state
1481 that goes to, based on the state we popped back to and the rule
1482 number reduced by. */
1486 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1487 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1488 yystate = yytable[yystate];
1490 yystate = yydefgoto[yyn - YYNTOKENS];
1495 /*------------------------------------.
1496 | yyerrlab -- here on detecting error |
1497 `------------------------------------*/
1499 /* If not already recovering from an error, report this error. */
1503 #if ! YYERROR_VERBOSE
1504 yyerror (YY_("syntax error"));
1507 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1508 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1510 YYSIZE_T yyalloc = 2 * yysize;
1511 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1512 yyalloc = YYSTACK_ALLOC_MAXIMUM;
1513 if (yymsg != yymsgbuf)
1514 YYSTACK_FREE (yymsg);
1515 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1517 yymsg_alloc = yyalloc;
1521 yymsg_alloc = sizeof yymsgbuf;
1525 if (0 < yysize && yysize <= yymsg_alloc)
1527 (void) yysyntax_error (yymsg, yystate, yychar);
1532 yyerror (YY_("syntax error"));
1534 goto yyexhaustedlab;
1542 if (yyerrstatus == 3)
1544 /* If just tried and failed to reuse look-ahead token after an
1545 error, discard it. */
1547 if (yychar <= YYEOF)
1549 /* Return failure if at end of input. */
1550 if (yychar == YYEOF)
1555 yydestruct ("Error: discarding",
1561 /* Else will try to reuse look-ahead token after shifting the error
1566 /*---------------------------------------------------.
1567 | yyerrorlab -- error raised explicitly by YYERROR. |
1568 `---------------------------------------------------*/
1571 /* Pacify compilers like GCC when the user code never invokes
1572 YYERROR and the label yyerrorlab therefore never appears in user
1574 if (/*CONSTCOND*/ 0)
1577 /* Do not reclaim the symbols of the rule which action triggered
1581 YY_STACK_PRINT (yyss, yyssp);
1586 /*-------------------------------------------------------------.
1587 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1588 `-------------------------------------------------------------*/
1590 yyerrstatus = 3; /* Each real token shifted decrements this. */
1594 yyn = yypact[yystate];
1595 if (yyn != YYPACT_NINF)
1598 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1606 /* Pop the current state because it cannot handle the error token. */
1611 yydestruct ("Error: popping",
1612 yystos[yystate], yyvsp);
1615 YY_STACK_PRINT (yyss, yyssp);
1624 /* Shift the error token. */
1625 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1631 /*-------------------------------------.
1632 | yyacceptlab -- YYACCEPT comes here. |
1633 `-------------------------------------*/
1638 /*-----------------------------------.
1639 | yyabortlab -- YYABORT comes here. |
1640 `-----------------------------------*/
1646 /*-------------------------------------------------.
1647 | yyexhaustedlab -- memory exhaustion comes here. |
1648 `-------------------------------------------------*/
1650 yyerror (YY_("memory exhausted"));
1656 if (yychar != YYEOF && yychar != YYEMPTY)
1657 yydestruct ("Cleanup: discarding lookahead",
1659 /* Do not reclaim the symbols of the rule which action triggered
1660 this YYABORT or YYACCEPT. */
1662 YY_STACK_PRINT (yyss, yyssp);
1663 while (yyssp != yyss)
1665 yydestruct ("Cleanup: popping",
1666 yystos[*yyssp], yyvsp);
1671 YYSTACK_FREE (yyss);
1674 if (yymsg != yymsgbuf)
1675 YYSTACK_FREE (yymsg);
1677 /* Make sure YYID is used. */
1678 return YYID (yyresult);
1688 error_message ("%s\n", s);
1692 append_string(struct string_list *list, char *str)
1694 struct string_list *sl = malloc(sizeof(*sl));
1701 list->tail = &sl->next;
1704 sl->tail = &sl->next;
1709 free_string_list(struct string_list *list)
1712 struct string_list *sl = list->next;
1720 string_to_flag(const char *string)