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
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
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. */
38 /* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
45 /* Identify Bison output. */
49 #define YYBISON_VERSION "2.4.1"
52 #define YYSKELETON_NAME "yacc.c"
63 /* Using locations. */
64 #define YYLSP_NEEDED 0
68 /* Copy the first part of user declarations. */
70 /* Line 189 of yacc.c */
83 /* Line 189 of yacc.c */
86 /* Enabling traces. */
91 /* Enabling verbose error messages. */
92 #ifdef YYERROR_VERBOSE
93 # undef YYERROR_VERBOSE
94 # define YYERROR_VERBOSE 1
96 # define YYERROR_VERBOSE 0
99 /* Enabling the token table. */
100 #ifndef YYTOKEN_TABLE
101 # define YYTOKEN_TABLE 0
108 /* Put the tokens into the symbol table, so that GDB and other debuggers
128 #define kw_TAILMATCH 263
131 #define IDENTIFIER 266
136 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
137 typedef union YYSTYPE
140 /* Line 214 of yacc.c */
141 #line 45 "sel-gram.y"
144 struct hx_expr *expr;
148 /* Line 214 of yacc.c */
149 #line 150 "sel-gram.c"
151 # define YYSTYPE_IS_TRIVIAL 1
152 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
153 # define YYSTYPE_IS_DECLARED 1
157 /* Copy the second part of user declarations. */
160 /* Line 264 of yacc.c */
161 #line 162 "sel-gram.c"
168 typedef YYTYPE_UINT8 yytype_uint8;
170 typedef unsigned char yytype_uint8;
174 typedef YYTYPE_INT8 yytype_int8;
175 #elif (defined __STDC__ || defined __C99__FUNC__ \
176 || defined __cplusplus || defined _MSC_VER)
177 typedef signed char yytype_int8;
179 typedef short int yytype_int8;
183 typedef YYTYPE_UINT16 yytype_uint16;
185 typedef unsigned short int yytype_uint16;
189 typedef YYTYPE_INT16 yytype_int16;
191 typedef short int yytype_int16;
195 # ifdef __SIZE_TYPE__
196 # define YYSIZE_T __SIZE_TYPE__
197 # elif defined size_t
198 # define YYSIZE_T size_t
199 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
200 || defined __cplusplus || defined _MSC_VER)
201 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
202 # define YYSIZE_T size_t
204 # define YYSIZE_T unsigned int
208 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
213 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
214 # define YY_(msgid) dgettext ("bison-runtime", msgid)
218 # define YY_(msgid) msgid
222 /* Suppress unused-variable warnings by "using" E. */
223 #if ! defined lint || defined __GNUC__
224 # define YYUSE(e) ((void) (e))
226 # define YYUSE(e) /* empty */
229 /* Identity function, used to suppress warnings about constant conditions. */
233 #if (defined __STDC__ || defined __C99__FUNC__ \
234 || defined __cplusplus || defined _MSC_VER)
247 #if ! defined yyoverflow || YYERROR_VERBOSE
249 /* The parser invokes alloca or malloc; define the necessary symbols. */
251 # ifdef YYSTACK_USE_ALLOCA
252 # if YYSTACK_USE_ALLOCA
254 # define YYSTACK_ALLOC __builtin_alloca
255 # elif defined __BUILTIN_VA_ARG_INCR
256 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
258 # define YYSTACK_ALLOC __alloca
259 # elif defined _MSC_VER
260 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
261 # define alloca _alloca
263 # define YYSTACK_ALLOC alloca
264 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
265 || defined __cplusplus || defined _MSC_VER)
266 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
275 # ifdef YYSTACK_ALLOC
276 /* Pacify GCC's `empty if-body' warning. */
277 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
278 # ifndef YYSTACK_ALLOC_MAXIMUM
279 /* The OS might guarantee only one guard page at the bottom of the stack,
280 and a page size can be as small as 4096 bytes. So we cannot safely
281 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
282 to allow for a few compiler-allocated temporary stack slots. */
283 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
286 # define YYSTACK_ALLOC YYMALLOC
287 # define YYSTACK_FREE YYFREE
288 # ifndef YYSTACK_ALLOC_MAXIMUM
289 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
291 # if (defined __cplusplus && ! defined _STDLIB_H \
292 && ! ((defined YYMALLOC || defined malloc) \
293 && (defined YYFREE || defined free)))
294 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
300 # define YYMALLOC malloc
301 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
302 || defined __cplusplus || defined _MSC_VER)
303 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
308 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
309 || defined __cplusplus || defined _MSC_VER)
310 void free (void *); /* INFRINGES ON USER NAME SPACE */
314 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
317 #if (! defined yyoverflow \
318 && (! defined __cplusplus \
319 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
321 /* A type that is properly aligned for any stack member. */
324 yytype_int16 yyss_alloc;
328 /* The size of the maximum gap between one aligned stack and the next. */
329 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
331 /* The size of an array large to enough to hold all stacks, each with
333 # define YYSTACK_BYTES(N) \
334 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
335 + YYSTACK_GAP_MAXIMUM)
337 /* Copy COUNT objects from FROM to TO. The source and destination do
340 # if defined __GNUC__ && 1 < __GNUC__
341 # define YYCOPY(To, From, Count) \
342 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
344 # define YYCOPY(To, From, Count) \
348 for (yyi = 0; yyi < (Count); yyi++) \
349 (To)[yyi] = (From)[yyi]; \
355 /* Relocate STACK from its old location to the new one. The
356 local variables YYSIZE and YYSTACKSIZE give the old and new number of
357 elements in the stack, and YYPTR gives the new location of the
358 stack. Advance YYPTR to a properly aligned location for the next
360 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
363 YYSIZE_T yynewbytes; \
364 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
365 Stack = &yyptr->Stack_alloc; \
366 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
367 yyptr += yynewbytes / sizeof (*yyptr); \
373 /* YYFINAL -- State number of the termination state. */
375 /* YYLAST -- Last index in YYTABLE. */
378 /* YYNTOKENS -- Number of terminals. */
380 /* YYNNTS -- Number of nonterminals. */
382 /* YYNRULES -- Number of rules. */
384 /* YYNRULES -- Number of states. */
387 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
389 #define YYMAXUTOK 266
391 #define YYTRANSLATE(YYX) \
392 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
394 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
395 static const yytype_uint8 yytranslate[] =
397 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
398 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
399 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
400 2, 2, 2, 12, 2, 2, 2, 17, 2, 2,
401 13, 14, 2, 2, 15, 2, 20, 2, 2, 2,
402 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
403 2, 16, 2, 2, 2, 2, 2, 2, 2, 2,
404 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
405 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
406 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
407 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
408 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
409 2, 2, 2, 18, 2, 19, 2, 2, 2, 2,
410 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
411 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
412 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
413 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
414 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
415 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
416 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
417 2, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
422 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
423 5, 6, 7, 8, 9, 10, 11
427 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
429 static const yytype_uint8 yyprhs[] =
431 0, 0, 3, 5, 7, 9, 12, 16, 20, 24,
432 26, 28, 32, 37, 42, 46, 52, 56, 58, 60,
433 62, 64, 66, 68, 73, 78, 82
436 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
437 static const yytype_int8 yyrhs[] =
439 22, 0, -1, 23, -1, 3, -1, 4, -1, 12,
440 23, -1, 23, 5, 23, -1, 23, 6, 23, -1,
441 13, 23, 14, -1, 25, -1, 26, -1, 26, 15,
442 24, -1, 26, 16, 16, 26, -1, 26, 12, 16,
443 26, -1, 26, 8, 26, -1, 26, 7, 13, 24,
444 14, -1, 26, 7, 30, -1, 27, -1, 28, -1,
445 29, -1, 30, -1, 9, -1, 10, -1, 11, 13,
446 24, 14, -1, 17, 18, 31, 19, -1, 11, 20,
450 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
451 static const yytype_uint8 yyrline[] =
453 0, 73, 73, 75, 76, 77, 78, 79, 80, 81,
454 84, 85, 88, 89, 90, 91, 92, 95, 96, 97,
455 98, 101, 102, 104, 107, 110, 112
459 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
460 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
461 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
462 static const char *const yytname[] =
464 "$end", "error", "$undefined", "kw_TRUE", "kw_FALSE", "kw_AND", "kw_OR",
465 "kw_IN", "kw_TAILMATCH", "NUMBER", "STRING", "IDENTIFIER", "'!'", "'('",
466 "')'", "','", "'='", "'%'", "'{'", "'}'", "'.'", "$accept", "start",
467 "expr", "words", "comp", "word", "number", "string", "function",
468 "variable", "variables", 0
473 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
475 static const yytype_uint16 yytoknum[] =
477 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
478 265, 266, 33, 40, 41, 44, 61, 37, 123, 125,
483 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
484 static const yytype_uint8 yyr1[] =
486 0, 21, 22, 23, 23, 23, 23, 23, 23, 23,
487 24, 24, 25, 25, 25, 25, 25, 26, 26, 26,
488 26, 27, 28, 29, 30, 31, 31
491 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
492 static const yytype_uint8 yyr2[] =
494 0, 2, 1, 1, 1, 2, 3, 3, 3, 1,
495 1, 3, 4, 4, 3, 5, 3, 1, 1, 1,
499 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
500 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
501 means the default is an error. */
502 static const yytype_uint8 yydefact[] =
504 0, 3, 4, 21, 22, 0, 0, 0, 0, 0,
505 2, 9, 0, 17, 18, 19, 20, 0, 5, 0,
506 0, 1, 0, 0, 0, 0, 0, 0, 0, 10,
507 8, 26, 0, 6, 7, 0, 16, 14, 0, 0,
508 23, 0, 0, 24, 0, 13, 12, 11, 25, 15
511 /* YYDEFGOTO[NTERM-NUM]. */
512 static const yytype_int8 yydefgoto[] =
514 -1, 9, 10, 28, 11, 12, 13, 14, 15, 16,
518 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
520 #define YYPACT_NINF -31
521 static const yytype_int8 yypact[] =
523 22, -31, -31, -31, -31, -1, 22, 22, -11, 27,
524 11, -31, -6, -31, -31, -31, -31, 19, 11, 9,
525 26, -31, 22, 22, -4, 19, 24, 25, 28, 23,
526 -31, 29, 31, 11, 11, 19, -31, -31, 19, 19,
527 -31, 19, 26, -31, 30, -31, -31, -31, -31, -31
530 /* YYPGOTO[NTERM-NUM]. */
531 static const yytype_int8 yypgoto[] =
533 -31, -31, -3, -30, -31, -17, -31, -31, -31, 21,
537 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
538 positive, shift that token. If negative, reduce the rule which
539 number is the opposite. If zero, do what YYDEFACT says.
540 If YYTABLE_NINF, syntax error. */
541 #define YYTABLE_NINF -1
542 static const yytype_uint8 yytable[] =
544 29, 24, 25, 18, 19, 44, 26, 20, 37, 35,
545 27, 47, 17, 8, 22, 23, 22, 23, 29, 33,
546 34, 45, 46, 30, 29, 1, 2, 21, 3, 4,
547 5, 3, 4, 5, 6, 7, 8, 31, 41, 8,
548 38, 39, 40, 48, 49, 36, 0, 0, 0, 42,
552 static const yytype_int8 yycheck[] =
554 17, 7, 8, 6, 7, 35, 12, 18, 25, 13,
555 16, 41, 13, 17, 5, 6, 5, 6, 35, 22,
556 23, 38, 39, 14, 41, 3, 4, 0, 9, 10,
557 11, 9, 10, 11, 12, 13, 17, 11, 15, 17,
558 16, 16, 14, 42, 14, 24, -1, -1, -1, 20,
562 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
563 symbol of state STATE-NUM. */
564 static const yytype_uint8 yystos[] =
566 0, 3, 4, 9, 10, 11, 12, 13, 17, 22,
567 23, 25, 26, 27, 28, 29, 30, 13, 23, 23,
568 18, 0, 5, 6, 7, 8, 12, 16, 24, 26,
569 14, 11, 31, 23, 23, 13, 30, 26, 16, 16,
570 14, 15, 20, 19, 24, 26, 26, 24, 31, 14
573 #define yyerrok (yyerrstatus = 0)
574 #define yyclearin (yychar = YYEMPTY)
578 #define YYACCEPT goto yyacceptlab
579 #define YYABORT goto yyabortlab
580 #define YYERROR goto yyerrorlab
583 /* Like YYERROR except do call yyerror. This remains here temporarily
584 to ease the transition to the new meaning of YYERROR, for GCC.
585 Once GCC version 2 has supplanted version 1, this can go. */
587 #define YYFAIL goto yyerrlab
589 #define YYRECOVERING() (!!yyerrstatus)
591 #define YYBACKUP(Token, Value) \
593 if (yychar == YYEMPTY && yylen == 1) \
597 yytoken = YYTRANSLATE (yychar); \
603 yyerror (YY_("syntax error: cannot back up")); \
610 #define YYERRCODE 256
613 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
614 If N is 0, then set CURRENT to the empty location which ends
615 the previous symbol: RHS[0] (always defined). */
617 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
618 #ifndef YYLLOC_DEFAULT
619 # define YYLLOC_DEFAULT(Current, Rhs, N) \
623 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
624 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
625 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
626 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
630 (Current).first_line = (Current).last_line = \
631 YYRHSLOC (Rhs, 0).last_line; \
632 (Current).first_column = (Current).last_column = \
633 YYRHSLOC (Rhs, 0).last_column; \
639 /* YY_LOCATION_PRINT -- Print the location on the stream.
640 This macro was not mandated originally: define only if we know
641 we won't break user code: when these are the locations we know. */
643 #ifndef YY_LOCATION_PRINT
644 # if YYLTYPE_IS_TRIVIAL
645 # define YY_LOCATION_PRINT(File, Loc) \
646 fprintf (File, "%d.%d-%d.%d", \
647 (Loc).first_line, (Loc).first_column, \
648 (Loc).last_line, (Loc).last_column)
650 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
655 /* YYLEX -- calling `yylex' with the right arguments. */
658 # define YYLEX yylex (YYLEX_PARAM)
660 # define YYLEX yylex ()
663 /* Enable debugging if requested. */
667 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
668 # define YYFPRINTF fprintf
671 # define YYDPRINTF(Args) \
677 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
681 YYFPRINTF (stderr, "%s ", Title); \
682 yy_symbol_print (stderr, \
684 YYFPRINTF (stderr, "\n"); \
689 /*--------------------------------.
690 | Print this symbol on YYOUTPUT. |
691 `--------------------------------*/
694 #if (defined __STDC__ || defined __C99__FUNC__ \
695 || defined __cplusplus || defined _MSC_VER)
697 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
700 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
703 YYSTYPE const * const yyvaluep;
709 if (yytype < YYNTOKENS)
710 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
722 /*--------------------------------.
723 | Print this symbol on YYOUTPUT. |
724 `--------------------------------*/
726 #if (defined __STDC__ || defined __C99__FUNC__ \
727 || defined __cplusplus || defined _MSC_VER)
729 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
732 yy_symbol_print (yyoutput, yytype, yyvaluep)
735 YYSTYPE const * const yyvaluep;
738 if (yytype < YYNTOKENS)
739 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
741 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
743 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
744 YYFPRINTF (yyoutput, ")");
747 /*------------------------------------------------------------------.
748 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
750 `------------------------------------------------------------------*/
752 #if (defined __STDC__ || defined __C99__FUNC__ \
753 || defined __cplusplus || defined _MSC_VER)
755 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
758 yy_stack_print (yybottom, yytop)
759 yytype_int16 *yybottom;
763 YYFPRINTF (stderr, "Stack now");
764 for (; yybottom <= yytop; yybottom++)
766 int yybot = *yybottom;
767 YYFPRINTF (stderr, " %d", yybot);
769 YYFPRINTF (stderr, "\n");
772 # define YY_STACK_PRINT(Bottom, Top) \
775 yy_stack_print ((Bottom), (Top)); \
779 /*------------------------------------------------.
780 | Report that the YYRULE is going to be reduced. |
781 `------------------------------------------------*/
783 #if (defined __STDC__ || defined __C99__FUNC__ \
784 || defined __cplusplus || defined _MSC_VER)
786 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
789 yy_reduce_print (yyvsp, yyrule)
794 int yynrhs = yyr2[yyrule];
796 unsigned long int yylno = yyrline[yyrule];
797 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
799 /* The symbols being reduced. */
800 for (yyi = 0; yyi < yynrhs; yyi++)
802 YYFPRINTF (stderr, " $%d = ", yyi + 1);
803 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
804 &(yyvsp[(yyi + 1) - (yynrhs)])
806 YYFPRINTF (stderr, "\n");
810 # define YY_REDUCE_PRINT(Rule) \
813 yy_reduce_print (yyvsp, Rule); \
816 /* Nonzero means print parse trace. It is left uninitialized so that
817 multiple parsers can coexist. */
820 # define YYDPRINTF(Args)
821 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
822 # define YY_STACK_PRINT(Bottom, Top)
823 # define YY_REDUCE_PRINT(Rule)
824 #endif /* !YYDEBUG */
827 /* YYINITDEPTH -- initial size of the parser's stacks. */
829 # define YYINITDEPTH 200
832 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
833 if the built-in stack extension method is used).
835 Do not make this value too large; the results are undefined if
836 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
837 evaluated with infinite-precision integer arithmetic. */
840 # define YYMAXDEPTH 10000
848 # if defined __GLIBC__ && defined _STRING_H
849 # define yystrlen strlen
851 /* Return the length of YYSTR. */
852 #if (defined __STDC__ || defined __C99__FUNC__ \
853 || defined __cplusplus || defined _MSC_VER)
855 yystrlen (const char *yystr)
863 for (yylen = 0; yystr[yylen]; yylen++)
871 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
872 # define yystpcpy stpcpy
874 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
876 #if (defined __STDC__ || defined __C99__FUNC__ \
877 || defined __cplusplus || defined _MSC_VER)
879 yystpcpy (char *yydest, const char *yysrc)
882 yystpcpy (yydest, yysrc)
888 const char *yys = yysrc;
890 while ((*yyd++ = *yys++) != '\0')
899 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
900 quotes and backslashes, so that it's suitable for yyerror. The
901 heuristic is that double-quoting is unnecessary unless the string
902 contains an apostrophe, a comma, or backslash (other than
903 backslash-backslash). YYSTR is taken from yytname. If YYRES is
904 null, do not copy; instead, return the length of what the result
907 yytnamerr (char *yyres, const char *yystr)
912 char const *yyp = yystr;
919 goto do_not_strip_quotes;
923 goto do_not_strip_quotes;
936 do_not_strip_quotes: ;
940 return yystrlen (yystr);
942 return yystpcpy (yyres, yystr) - yyres;
946 /* Copy into YYRESULT an error message about the unexpected token
947 YYCHAR while in state YYSTATE. Return the number of bytes copied,
948 including the terminating null byte. If YYRESULT is null, do not
949 copy anything; just return the number of bytes that would be
950 copied. As a special case, return 0 if an ordinary "syntax error"
951 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
954 yysyntax_error (char *yyresult, int yystate, int yychar)
956 int yyn = yypact[yystate];
958 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
962 int yytype = YYTRANSLATE (yychar);
963 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
964 YYSIZE_T yysize = yysize0;
966 int yysize_overflow = 0;
967 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
968 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
972 /* This is so xgettext sees the translatable formats that are
973 constructed on the fly. */
974 YY_("syntax error, unexpected %s");
975 YY_("syntax error, unexpected %s, expecting %s");
976 YY_("syntax error, unexpected %s, expecting %s or %s");
977 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
978 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
982 static char const yyunexpected[] = "syntax error, unexpected %s";
983 static char const yyexpecting[] = ", expecting %s";
984 static char const yyor[] = " or %s";
985 char yyformat[sizeof yyunexpected
986 + sizeof yyexpecting - 1
987 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
988 * (sizeof yyor - 1))];
989 char const *yyprefix = yyexpecting;
991 /* Start YYX at -YYN if negative to avoid negative indexes in
993 int yyxbegin = yyn < 0 ? -yyn : 0;
995 /* Stay within bounds of both yycheck and yytname. */
996 int yychecklim = YYLAST - yyn + 1;
997 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1000 yyarg[0] = yytname[yytype];
1001 yyfmt = yystpcpy (yyformat, yyunexpected);
1003 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1004 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1006 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1010 yyformat[sizeof yyunexpected - 1] = '\0';
1013 yyarg[yycount++] = yytname[yyx];
1014 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1015 yysize_overflow |= (yysize1 < yysize);
1017 yyfmt = yystpcpy (yyfmt, yyprefix);
1021 yyf = YY_(yyformat);
1022 yysize1 = yysize + yystrlen (yyf);
1023 yysize_overflow |= (yysize1 < yysize);
1026 if (yysize_overflow)
1027 return YYSIZE_MAXIMUM;
1031 /* Avoid sprintf, as that infringes on the user's name space.
1032 Don't have undefined behavior even if the translation
1033 produced a string with the wrong number of "%s"s. */
1034 char *yyp = yyresult;
1036 while ((*yyp = *yyf) != '\0')
1038 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1040 yyp += yytnamerr (yyp, yyarg[yyi++]);
1053 #endif /* YYERROR_VERBOSE */
1056 /*-----------------------------------------------.
1057 | Release the memory associated to this symbol. |
1058 `-----------------------------------------------*/
1061 #if (defined __STDC__ || defined __C99__FUNC__ \
1062 || defined __cplusplus || defined _MSC_VER)
1064 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1067 yydestruct (yymsg, yytype, yyvaluep)
1077 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1087 /* Prevent warnings from -Wmissing-prototypes. */
1088 #ifdef YYPARSE_PARAM
1089 #if defined __STDC__ || defined __cplusplus
1090 int yyparse (void *YYPARSE_PARAM);
1094 #else /* ! YYPARSE_PARAM */
1095 #if defined __STDC__ || defined __cplusplus
1100 #endif /* ! YYPARSE_PARAM */
1103 /* The lookahead symbol. */
1106 /* The semantic value of the lookahead symbol. */
1109 /* Number of syntax errors so far. */
1114 /*-------------------------.
1115 | yyparse or yypush_parse. |
1116 `-------------------------*/
1118 #ifdef YYPARSE_PARAM
1119 #if (defined __STDC__ || defined __C99__FUNC__ \
1120 || defined __cplusplus || defined _MSC_VER)
1122 yyparse (void *YYPARSE_PARAM)
1125 yyparse (YYPARSE_PARAM)
1126 void *YYPARSE_PARAM;
1128 #else /* ! YYPARSE_PARAM */
1129 #if (defined __STDC__ || defined __C99__FUNC__ \
1130 || defined __cplusplus || defined _MSC_VER)
1143 /* Number of tokens to shift before error messages enabled. */
1146 /* The stacks and their tools:
1147 `yyss': related to states.
1148 `yyvs': related to semantic values.
1150 Refer to the stacks thru separate pointers, to allow yyoverflow
1151 to reallocate them elsewhere. */
1153 /* The state stack. */
1154 yytype_int16 yyssa[YYINITDEPTH];
1156 yytype_int16 *yyssp;
1158 /* The semantic value stack. */
1159 YYSTYPE yyvsa[YYINITDEPTH];
1163 YYSIZE_T yystacksize;
1167 /* Lookahead token as an internal (translated) token number. */
1169 /* The variables used to return semantic value and location from the
1174 /* Buffer for error messages, and its allocated size. */
1176 char *yymsg = yymsgbuf;
1177 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1180 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1182 /* The number of symbols on the RHS of the reduced rule.
1183 Keep to zero when no symbol should be popped. */
1189 yystacksize = YYINITDEPTH;
1191 YYDPRINTF ((stderr, "Starting parse\n"));
1196 yychar = YYEMPTY; /* Cause a token to be read. */
1198 /* Initialize stack pointers.
1199 Waste one element of value and location stack
1200 so that they stay on the same level as the state stack.
1201 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;
1231 /* Each stack pointer address is followed by the size of the
1232 data in use in that stack, in bytes. This used to be a
1233 conditional around just the two extra args, but that might
1234 be undefined if yyoverflow is a macro. */
1235 yyoverflow (YY_("memory exhausted"),
1236 &yyss1, yysize * sizeof (*yyssp),
1237 &yyvs1, yysize * sizeof (*yyvsp),
1243 #else /* no yyoverflow */
1244 # ifndef YYSTACK_RELOCATE
1245 goto yyexhaustedlab;
1247 /* Extend the stack our own way. */
1248 if (YYMAXDEPTH <= yystacksize)
1249 goto yyexhaustedlab;
1251 if (YYMAXDEPTH < yystacksize)
1252 yystacksize = YYMAXDEPTH;
1255 yytype_int16 *yyss1 = yyss;
1256 union yyalloc *yyptr =
1257 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1259 goto yyexhaustedlab;
1260 YYSTACK_RELOCATE (yyss_alloc, yyss);
1261 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1262 # undef YYSTACK_RELOCATE
1264 YYSTACK_FREE (yyss1);
1267 #endif /* no yyoverflow */
1269 yyssp = yyss + yysize - 1;
1270 yyvsp = yyvs + yysize - 1;
1272 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1273 (unsigned long int) yystacksize));
1275 if (yyss + yystacksize - 1 <= yyssp)
1279 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1281 if (yystate == YYFINAL)
1291 /* Do appropriate processing given the current state. Read a
1292 lookahead token if we need one and don't already have one. */
1294 /* First try to decide what to do without reference to lookahead token. */
1295 yyn = yypact[yystate];
1296 if (yyn == YYPACT_NINF)
1299 /* Not known => get a lookahead token if don't already have one. */
1301 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1302 if (yychar == YYEMPTY)
1304 YYDPRINTF ((stderr, "Reading a token: "));
1308 if (yychar <= YYEOF)
1310 yychar = yytoken = YYEOF;
1311 YYDPRINTF ((stderr, "Now at end of input.\n"));
1315 yytoken = YYTRANSLATE (yychar);
1316 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1319 /* If the proper action on seeing token YYTOKEN is to reduce or to
1320 detect an error, take that action. */
1322 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1327 if (yyn == 0 || yyn == YYTABLE_NINF)
1333 /* Count tokens shifted since error; after three, turn off error
1338 /* Shift the lookahead token. */
1339 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1341 /* Discard the shifted token. */
1350 /*-----------------------------------------------------------.
1351 | yydefault -- do the default action for the current state. |
1352 `-----------------------------------------------------------*/
1354 yyn = yydefact[yystate];
1360 /*-----------------------------.
1361 | yyreduce -- Do a reduction. |
1362 `-----------------------------*/
1364 /* yyn is the number of a rule to reduce with. */
1367 /* If YYLEN is nonzero, implement the default value of the action:
1370 Otherwise, the following line sets YYVAL to garbage.
1371 This behavior is undocumented and Bison
1372 users should not rely upon it. Assigning to YYVAL
1373 unconditionally makes the parser a bit smaller, and it avoids a
1374 GCC warning that YYVAL may be used uninitialized. */
1375 yyval = yyvsp[1-yylen];
1378 YY_REDUCE_PRINT (yyn);
1383 /* Line 1455 of yacc.c */
1384 #line 73 "sel-gram.y"
1385 { _hx509_expr_input.expr = (yyvsp[(1) - (1)].expr); }
1390 /* Line 1455 of yacc.c */
1391 #line 75 "sel-gram.y"
1392 { (yyval.expr) = _hx509_make_expr(op_TRUE, NULL, NULL); }
1397 /* Line 1455 of yacc.c */
1398 #line 76 "sel-gram.y"
1399 { (yyval.expr) = _hx509_make_expr(op_FALSE, NULL, NULL); }
1404 /* Line 1455 of yacc.c */
1405 #line 77 "sel-gram.y"
1406 { (yyval.expr) = _hx509_make_expr(op_NOT, (yyvsp[(2) - (2)].expr), NULL); }
1411 /* Line 1455 of yacc.c */
1412 #line 78 "sel-gram.y"
1413 { (yyval.expr) = _hx509_make_expr(op_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
1418 /* Line 1455 of yacc.c */
1419 #line 79 "sel-gram.y"
1420 { (yyval.expr) = _hx509_make_expr(op_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
1425 /* Line 1455 of yacc.c */
1426 #line 80 "sel-gram.y"
1427 { (yyval.expr) = (yyvsp[(2) - (3)].expr); }
1432 /* Line 1455 of yacc.c */
1433 #line 81 "sel-gram.y"
1434 { (yyval.expr) = _hx509_make_expr(op_COMP, (yyvsp[(1) - (1)].expr), NULL); }
1439 /* Line 1455 of yacc.c */
1440 #line 84 "sel-gram.y"
1441 { (yyval.expr) = _hx509_make_expr(expr_WORDS, (yyvsp[(1) - (1)].expr), NULL); }
1446 /* Line 1455 of yacc.c */
1447 #line 85 "sel-gram.y"
1448 { (yyval.expr) = _hx509_make_expr(expr_WORDS, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
1453 /* Line 1455 of yacc.c */
1454 #line 88 "sel-gram.y"
1455 { (yyval.expr) = _hx509_make_expr(comp_EQ, (yyvsp[(1) - (4)].expr), (yyvsp[(4) - (4)].expr)); }
1460 /* Line 1455 of yacc.c */
1461 #line 89 "sel-gram.y"
1462 { (yyval.expr) = _hx509_make_expr(comp_NE, (yyvsp[(1) - (4)].expr), (yyvsp[(4) - (4)].expr)); }
1467 /* Line 1455 of yacc.c */
1468 #line 90 "sel-gram.y"
1469 { (yyval.expr) = _hx509_make_expr(comp_TAILEQ, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
1474 /* Line 1455 of yacc.c */
1475 #line 91 "sel-gram.y"
1476 { (yyval.expr) = _hx509_make_expr(comp_IN, (yyvsp[(1) - (5)].expr), (yyvsp[(4) - (5)].expr)); }
1481 /* Line 1455 of yacc.c */
1482 #line 92 "sel-gram.y"
1483 { (yyval.expr) = _hx509_make_expr(comp_IN, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
1488 /* Line 1455 of yacc.c */
1489 #line 95 "sel-gram.y"
1490 { (yyval.expr) = (yyvsp[(1) - (1)].expr); }
1495 /* Line 1455 of yacc.c */
1496 #line 96 "sel-gram.y"
1497 { (yyval.expr) = (yyvsp[(1) - (1)].expr); }
1502 /* Line 1455 of yacc.c */
1503 #line 97 "sel-gram.y"
1504 { (yyval.expr) = (yyvsp[(1) - (1)].expr); }
1509 /* Line 1455 of yacc.c */
1510 #line 98 "sel-gram.y"
1511 { (yyval.expr) = (yyvsp[(1) - (1)].expr); }
1516 /* Line 1455 of yacc.c */
1517 #line 101 "sel-gram.y"
1518 { (yyval.expr) = _hx509_make_expr(expr_NUMBER, (yyvsp[(1) - (1)].string), NULL); }
1523 /* Line 1455 of yacc.c */
1524 #line 102 "sel-gram.y"
1525 { (yyval.expr) = _hx509_make_expr(expr_STRING, (yyvsp[(1) - (1)].string), NULL); }
1530 /* Line 1455 of yacc.c */
1531 #line 104 "sel-gram.y"
1533 (yyval.expr) = _hx509_make_expr(expr_FUNCTION, (yyvsp[(1) - (4)].string), (yyvsp[(3) - (4)].expr)); }
1538 /* Line 1455 of yacc.c */
1539 #line 107 "sel-gram.y"
1540 { (yyval.expr) = (yyvsp[(3) - (4)].expr); }
1545 /* Line 1455 of yacc.c */
1546 #line 110 "sel-gram.y"
1548 (yyval.expr) = _hx509_make_expr(expr_VAR, (yyvsp[(1) - (3)].string), (yyvsp[(3) - (3)].expr)); }
1553 /* Line 1455 of yacc.c */
1554 #line 112 "sel-gram.y"
1556 (yyval.expr) = _hx509_make_expr(expr_VAR, (yyvsp[(1) - (1)].string), NULL); }
1561 /* Line 1455 of yacc.c */
1562 #line 1563 "sel-gram.c"
1565 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1569 YY_STACK_PRINT (yyss, yyssp);
1573 /* Now `shift' the result of the reduction. Determine what state
1574 that goes to, based on the state we popped back to and the rule
1575 number reduced by. */
1579 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1580 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1581 yystate = yytable[yystate];
1583 yystate = yydefgoto[yyn - YYNTOKENS];
1588 /*------------------------------------.
1589 | yyerrlab -- here on detecting error |
1590 `------------------------------------*/
1592 /* If not already recovering from an error, report this error. */
1596 #if ! YYERROR_VERBOSE
1597 yyerror (YY_("syntax error"));
1600 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1601 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1603 YYSIZE_T yyalloc = 2 * yysize;
1604 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1605 yyalloc = YYSTACK_ALLOC_MAXIMUM;
1606 if (yymsg != yymsgbuf)
1607 YYSTACK_FREE (yymsg);
1608 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1610 yymsg_alloc = yyalloc;
1614 yymsg_alloc = sizeof yymsgbuf;
1618 if (0 < yysize && yysize <= yymsg_alloc)
1620 (void) yysyntax_error (yymsg, yystate, yychar);
1625 yyerror (YY_("syntax error"));
1627 goto yyexhaustedlab;
1635 if (yyerrstatus == 3)
1637 /* If just tried and failed to reuse lookahead token after an
1638 error, discard it. */
1640 if (yychar <= YYEOF)
1642 /* Return failure if at end of input. */
1643 if (yychar == YYEOF)
1648 yydestruct ("Error: discarding",
1654 /* Else will try to reuse lookahead token after shifting the error
1659 /*---------------------------------------------------.
1660 | yyerrorlab -- error raised explicitly by YYERROR. |
1661 `---------------------------------------------------*/
1664 /* Pacify compilers like GCC when the user code never invokes
1665 YYERROR and the label yyerrorlab therefore never appears in user
1667 if (/*CONSTCOND*/ 0)
1670 /* Do not reclaim the symbols of the rule which action triggered
1674 YY_STACK_PRINT (yyss, yyssp);
1679 /*-------------------------------------------------------------.
1680 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1681 `-------------------------------------------------------------*/
1683 yyerrstatus = 3; /* Each real token shifted decrements this. */
1687 yyn = yypact[yystate];
1688 if (yyn != YYPACT_NINF)
1691 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1699 /* Pop the current state because it cannot handle the error token. */
1704 yydestruct ("Error: popping",
1705 yystos[yystate], yyvsp);
1708 YY_STACK_PRINT (yyss, yyssp);
1714 /* Shift the error token. */
1715 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1721 /*-------------------------------------.
1722 | yyacceptlab -- YYACCEPT comes here. |
1723 `-------------------------------------*/
1728 /*-----------------------------------.
1729 | yyabortlab -- YYABORT comes here. |
1730 `-----------------------------------*/
1735 #if !defined(yyoverflow) || YYERROR_VERBOSE
1736 /*-------------------------------------------------.
1737 | yyexhaustedlab -- memory exhaustion comes here. |
1738 `-------------------------------------------------*/
1740 yyerror (YY_("memory exhausted"));
1746 if (yychar != YYEMPTY)
1747 yydestruct ("Cleanup: discarding lookahead",
1749 /* Do not reclaim the symbols of the rule which action triggered
1750 this YYABORT or YYACCEPT. */
1752 YY_STACK_PRINT (yyss, yyssp);
1753 while (yyssp != yyss)
1755 yydestruct ("Cleanup: popping",
1756 yystos[*yyssp], yyvsp);
1761 YYSTACK_FREE (yyss);
1764 if (yymsg != yymsgbuf)
1765 YYSTACK_FREE (yymsg);
1767 /* Make sure YYID is used. */
1768 return YYID (yyresult);