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
86
#define kw_TAILMATCH 263
89
#define IDENTIFIER 266
94
/* Copy the first part of user declarations. */
95
#line 34 "heimdal/lib/hx509/sel-gram.y"
108
/* Enabling traces. */
113
/* Enabling verbose error messages. */
114
#ifdef YYERROR_VERBOSE
115
# undef YYERROR_VERBOSE
116
# define YYERROR_VERBOSE 1
118
# define YYERROR_VERBOSE 0
121
/* Enabling the token table. */
122
#ifndef YYTOKEN_TABLE
123
# define YYTOKEN_TABLE 0
126
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
127
typedef union YYSTYPE
128
#line 46 "heimdal/lib/hx509/sel-gram.y"
131
struct hx_expr *expr;
133
/* Line 187 of yacc.c. */
134
#line 135 "heimdal/lib/hx509/sel-gram.y"
136
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
137
# define YYSTYPE_IS_DECLARED 1
138
# define YYSTYPE_IS_TRIVIAL 1
143
/* Copy the second part of user declarations. */
146
/* Line 216 of yacc.c. */
147
#line 148 "heimdal/lib/hx509/sel-gram.y"
154
typedef YYTYPE_UINT8 yytype_uint8;
156
typedef unsigned char yytype_uint8;
160
typedef YYTYPE_INT8 yytype_int8;
161
#elif (defined __STDC__ || defined __C99__FUNC__ \
162
|| defined __cplusplus || defined _MSC_VER)
163
typedef signed char yytype_int8;
165
typedef short int yytype_int8;
169
typedef YYTYPE_UINT16 yytype_uint16;
171
typedef unsigned short int yytype_uint16;
175
typedef YYTYPE_INT16 yytype_int16;
177
typedef short int yytype_int16;
181
# ifdef __SIZE_TYPE__
182
# define YYSIZE_T __SIZE_TYPE__
183
# elif defined size_t
184
# define YYSIZE_T size_t
185
# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
186
|| defined __cplusplus || defined _MSC_VER)
187
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
188
# define YYSIZE_T size_t
190
# define YYSIZE_T unsigned int
194
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
199
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
200
# define YY_(msgid) dgettext ("bison-runtime", msgid)
204
# define YY_(msgid) msgid
208
/* Suppress unused-variable warnings by "using" E. */
209
#if ! defined lint || defined __GNUC__
210
# define YYUSE(e) ((void) (e))
212
# define YYUSE(e) /* empty */
215
/* Identity function, used to suppress warnings about constant conditions. */
219
#if (defined __STDC__ || defined __C99__FUNC__ \
220
|| defined __cplusplus || defined _MSC_VER)
233
#if ! defined yyoverflow || YYERROR_VERBOSE
235
/* The parser invokes alloca or malloc; define the necessary symbols. */
237
# ifdef YYSTACK_USE_ALLOCA
238
# if YYSTACK_USE_ALLOCA
240
# define YYSTACK_ALLOC __builtin_alloca
241
# elif defined __BUILTIN_VA_ARG_INCR
242
# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
244
# define YYSTACK_ALLOC __alloca
245
# elif defined _MSC_VER
246
# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
247
# define alloca _alloca
249
# define YYSTACK_ALLOC alloca
250
# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
251
|| defined __cplusplus || defined _MSC_VER)
252
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
261
# ifdef YYSTACK_ALLOC
262
/* Pacify GCC's `empty if-body' warning. */
263
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
264
# ifndef YYSTACK_ALLOC_MAXIMUM
265
/* The OS might guarantee only one guard page at the bottom of the stack,
266
and a page size can be as small as 4096 bytes. So we cannot safely
267
invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
268
to allow for a few compiler-allocated temporary stack slots. */
269
# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
272
# define YYSTACK_ALLOC YYMALLOC
273
# define YYSTACK_FREE YYFREE
274
# ifndef YYSTACK_ALLOC_MAXIMUM
275
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
277
# if (defined __cplusplus && ! defined _STDLIB_H \
278
&& ! ((defined YYMALLOC || defined malloc) \
279
&& (defined YYFREE || defined free)))
280
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
286
# define YYMALLOC malloc
287
# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
288
|| defined __cplusplus || defined _MSC_VER)
289
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
294
# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
295
|| defined __cplusplus || defined _MSC_VER)
296
void free (void *); /* INFRINGES ON USER NAME SPACE */
300
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
303
#if (! defined yyoverflow \
304
&& (! defined __cplusplus \
305
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
307
/* A type that is properly aligned for any stack member. */
314
/* The size of the maximum gap between one aligned stack and the next. */
315
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
317
/* The size of an array large to enough to hold all stacks, each with
319
# define YYSTACK_BYTES(N) \
320
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
321
+ YYSTACK_GAP_MAXIMUM)
323
/* Copy COUNT objects from FROM to TO. The source and destination do
326
# if defined __GNUC__ && 1 < __GNUC__
327
# define YYCOPY(To, From, Count) \
328
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
330
# define YYCOPY(To, From, Count) \
334
for (yyi = 0; yyi < (Count); yyi++) \
335
(To)[yyi] = (From)[yyi]; \
341
/* Relocate STACK from its old location to the new one. The
342
local variables YYSIZE and YYSTACKSIZE give the old and new number of
343
elements in the stack, and YYPTR gives the new location of the
344
stack. Advance YYPTR to a properly aligned location for the next
346
# define YYSTACK_RELOCATE(Stack) \
349
YYSIZE_T yynewbytes; \
350
YYCOPY (&yyptr->Stack, Stack, yysize); \
351
Stack = &yyptr->Stack; \
352
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
353
yyptr += yynewbytes / sizeof (*yyptr); \
359
/* YYFINAL -- State number of the termination state. */
361
/* YYLAST -- Last index in YYTABLE. */
364
/* YYNTOKENS -- Number of terminals. */
366
/* YYNNTS -- Number of nonterminals. */
368
/* YYNRULES -- Number of rules. */
370
/* YYNRULES -- Number of states. */
373
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
375
#define YYMAXUTOK 266
377
#define YYTRANSLATE(YYX) \
378
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
380
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
381
static const yytype_uint8 yytranslate[] =
383
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
384
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
385
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
386
2, 2, 2, 12, 2, 2, 2, 17, 2, 2,
387
13, 14, 2, 2, 15, 2, 20, 2, 2, 2,
388
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
389
2, 16, 2, 2, 2, 2, 2, 2, 2, 2,
390
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
391
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
392
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
393
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
394
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
395
2, 2, 2, 18, 2, 19, 2, 2, 2, 2,
396
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
397
2, 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, 2, 2, 2, 2, 2, 2, 2,
401
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
402
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
403
2, 2, 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, 1, 2, 3, 4,
409
5, 6, 7, 8, 9, 10, 11
413
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
415
static const yytype_uint8 yyprhs[] =
417
0, 0, 3, 5, 7, 9, 12, 16, 20, 24,
418
26, 28, 32, 37, 42, 46, 52, 56, 58, 60,
419
62, 64, 66, 68, 73, 78, 82
422
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
423
static const yytype_int8 yyrhs[] =
425
22, 0, -1, 23, -1, 3, -1, 4, -1, 12,
426
23, -1, 23, 5, 23, -1, 23, 6, 23, -1,
427
13, 23, 14, -1, 25, -1, 26, -1, 26, 15,
428
24, -1, 26, 16, 16, 26, -1, 26, 12, 16,
429
26, -1, 26, 8, 26, -1, 26, 7, 13, 24,
430
14, -1, 26, 7, 30, -1, 27, -1, 28, -1,
431
29, -1, 30, -1, 9, -1, 10, -1, 11, 13,
432
24, 14, -1, 17, 18, 31, 19, -1, 11, 20,
436
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
437
static const yytype_uint8 yyrline[] =
439
0, 74, 74, 76, 77, 78, 79, 80, 81, 82,
440
85, 86, 89, 90, 91, 92, 93, 96, 97, 98,
441
99, 102, 103, 105, 108, 111, 113
445
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
446
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
447
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
448
static const char *const yytname[] =
450
"$end", "error", "$undefined", "kw_TRUE", "kw_FALSE", "kw_AND", "kw_OR",
451
"kw_IN", "kw_TAILMATCH", "NUMBER", "STRING", "IDENTIFIER", "'!'", "'('",
452
"')'", "','", "'='", "'%'", "'{'", "'}'", "'.'", "$accept", "start",
453
"expr", "words", "comp", "word", "number", "string", "function",
454
"variable", "variables", 0
459
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
461
static const yytype_uint16 yytoknum[] =
463
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
464
265, 266, 33, 40, 41, 44, 61, 37, 123, 125,
469
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
470
static const yytype_uint8 yyr1[] =
472
0, 21, 22, 23, 23, 23, 23, 23, 23, 23,
473
24, 24, 25, 25, 25, 25, 25, 26, 26, 26,
474
26, 27, 28, 29, 30, 31, 31
477
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
478
static const yytype_uint8 yyr2[] =
480
0, 2, 1, 1, 1, 2, 3, 3, 3, 1,
481
1, 3, 4, 4, 3, 5, 3, 1, 1, 1,
485
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
486
STATE-NUM when YYTABLE doesn't specify something else to do. Zero
487
means the default is an error. */
488
static const yytype_uint8 yydefact[] =
490
0, 3, 4, 21, 22, 0, 0, 0, 0, 0,
491
2, 9, 0, 17, 18, 19, 20, 0, 5, 0,
492
0, 1, 0, 0, 0, 0, 0, 0, 0, 10,
493
8, 26, 0, 6, 7, 0, 16, 14, 0, 0,
494
23, 0, 0, 24, 0, 13, 12, 11, 25, 15
497
/* YYDEFGOTO[NTERM-NUM]. */
498
static const yytype_int8 yydefgoto[] =
500
-1, 9, 10, 28, 11, 12, 13, 14, 15, 16,
504
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
506
#define YYPACT_NINF -31
507
static const yytype_int8 yypact[] =
509
22, -31, -31, -31, -31, -1, 22, 22, -11, 27,
510
11, -31, -6, -31, -31, -31, -31, 19, 11, 9,
511
26, -31, 22, 22, -4, 19, 24, 25, 28, 23,
512
-31, 29, 31, 11, 11, 19, -31, -31, 19, 19,
513
-31, 19, 26, -31, 30, -31, -31, -31, -31, -31
516
/* YYPGOTO[NTERM-NUM]. */
517
static const yytype_int8 yypgoto[] =
519
-31, -31, -3, -30, -31, -17, -31, -31, -31, 21,
523
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
524
positive, shift that token. If negative, reduce the rule which
525
number is the opposite. If zero, do what YYDEFACT says.
526
If YYTABLE_NINF, syntax error. */
527
#define YYTABLE_NINF -1
528
static const yytype_uint8 yytable[] =
530
29, 24, 25, 18, 19, 44, 26, 20, 37, 35,
531
27, 47, 17, 8, 22, 23, 22, 23, 29, 33,
532
34, 45, 46, 30, 29, 1, 2, 21, 3, 4,
533
5, 3, 4, 5, 6, 7, 8, 31, 41, 8,
534
38, 39, 40, 48, 49, 36, 0, 0, 0, 42,
538
static const yytype_int8 yycheck[] =
540
17, 7, 8, 6, 7, 35, 12, 18, 25, 13,
541
16, 41, 13, 17, 5, 6, 5, 6, 35, 22,
542
23, 38, 39, 14, 41, 3, 4, 0, 9, 10,
543
11, 9, 10, 11, 12, 13, 17, 11, 15, 17,
544
16, 16, 14, 42, 14, 24, -1, -1, -1, 20,
548
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
549
symbol of state STATE-NUM. */
550
static const yytype_uint8 yystos[] =
552
0, 3, 4, 9, 10, 11, 12, 13, 17, 22,
553
23, 25, 26, 27, 28, 29, 30, 13, 23, 23,
554
18, 0, 5, 6, 7, 8, 12, 16, 24, 26,
555
14, 11, 31, 23, 23, 13, 30, 26, 16, 16,
556
14, 15, 20, 19, 24, 26, 26, 24, 31, 14
559
#define yyerrok (yyerrstatus = 0)
560
#define yyclearin (yychar = YYEMPTY)
564
#define YYACCEPT goto yyacceptlab
565
#define YYABORT goto yyabortlab
566
#define YYERROR goto yyerrorlab
569
/* Like YYERROR except do call yyerror. This remains here temporarily
570
to ease the transition to the new meaning of YYERROR, for GCC.
571
Once GCC version 2 has supplanted version 1, this can go. */
573
#define YYFAIL goto yyerrlab
575
#define YYRECOVERING() (!!yyerrstatus)
577
#define YYBACKUP(Token, Value) \
579
if (yychar == YYEMPTY && yylen == 1) \
583
yytoken = YYTRANSLATE (yychar); \
589
yyerror (YY_("syntax error: cannot back up")); \
596
#define YYERRCODE 256
599
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
600
If N is 0, then set CURRENT to the empty location which ends
601
the previous symbol: RHS[0] (always defined). */
603
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
604
#ifndef YYLLOC_DEFAULT
605
# define YYLLOC_DEFAULT(Current, Rhs, N) \
609
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
610
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
611
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
612
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
616
(Current).first_line = (Current).last_line = \
617
YYRHSLOC (Rhs, 0).last_line; \
618
(Current).first_column = (Current).last_column = \
619
YYRHSLOC (Rhs, 0).last_column; \
625
/* YY_LOCATION_PRINT -- Print the location on the stream.
626
This macro was not mandated originally: define only if we know
627
we won't break user code: when these are the locations we know. */
629
#ifndef YY_LOCATION_PRINT
630
# if YYLTYPE_IS_TRIVIAL
631
# define YY_LOCATION_PRINT(File, Loc) \
632
fprintf (File, "%d.%d-%d.%d", \
633
(Loc).first_line, (Loc).first_column, \
634
(Loc).last_line, (Loc).last_column)
636
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
641
/* YYLEX -- calling `yylex' with the right arguments. */
644
# define YYLEX yylex (YYLEX_PARAM)
646
# define YYLEX yylex ()
649
/* Enable debugging if requested. */
653
# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
654
# define YYFPRINTF fprintf
657
# define YYDPRINTF(Args) \
663
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
667
YYFPRINTF (stderr, "%s ", Title); \
668
yy_symbol_print (stderr, \
670
YYFPRINTF (stderr, "\n"); \
675
/*--------------------------------.
676
| Print this symbol on YYOUTPUT. |
677
`--------------------------------*/
680
#if (defined __STDC__ || defined __C99__FUNC__ \
681
|| defined __cplusplus || defined _MSC_VER)
683
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
686
yy_symbol_value_print (yyoutput, yytype, yyvaluep)
689
YYSTYPE const * const yyvaluep;
695
if (yytype < YYNTOKENS)
696
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
708
/*--------------------------------.
709
| Print this symbol on YYOUTPUT. |
710
`--------------------------------*/
712
#if (defined __STDC__ || defined __C99__FUNC__ \
713
|| defined __cplusplus || defined _MSC_VER)
715
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
718
yy_symbol_print (yyoutput, yytype, yyvaluep)
721
YYSTYPE const * const yyvaluep;
724
if (yytype < YYNTOKENS)
725
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
727
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
729
yy_symbol_value_print (yyoutput, yytype, yyvaluep);
730
YYFPRINTF (yyoutput, ")");
733
/*------------------------------------------------------------------.
734
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
736
`------------------------------------------------------------------*/
738
#if (defined __STDC__ || defined __C99__FUNC__ \
739
|| defined __cplusplus || defined _MSC_VER)
741
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
744
yy_stack_print (bottom, top)
745
yytype_int16 *bottom;
749
YYFPRINTF (stderr, "Stack now");
750
for (; bottom <= top; ++bottom)
751
YYFPRINTF (stderr, " %d", *bottom);
752
YYFPRINTF (stderr, "\n");
755
# define YY_STACK_PRINT(Bottom, Top) \
758
yy_stack_print ((Bottom), (Top)); \
762
/*------------------------------------------------.
763
| Report that the YYRULE is going to be reduced. |
764
`------------------------------------------------*/
766
#if (defined __STDC__ || defined __C99__FUNC__ \
767
|| defined __cplusplus || defined _MSC_VER)
769
yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
772
yy_reduce_print (yyvsp, yyrule)
777
int yynrhs = yyr2[yyrule];
779
unsigned long int yylno = yyrline[yyrule];
780
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
782
/* The symbols being reduced. */
783
for (yyi = 0; yyi < yynrhs; yyi++)
785
fprintf (stderr, " $%d = ", yyi + 1);
786
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
787
&(yyvsp[(yyi + 1) - (yynrhs)])
789
fprintf (stderr, "\n");
793
# define YY_REDUCE_PRINT(Rule) \
796
yy_reduce_print (yyvsp, Rule); \
799
/* Nonzero means print parse trace. It is left uninitialized so that
800
multiple parsers can coexist. */
803
# define YYDPRINTF(Args)
804
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
805
# define YY_STACK_PRINT(Bottom, Top)
806
# define YY_REDUCE_PRINT(Rule)
807
#endif /* !YYDEBUG */
810
/* YYINITDEPTH -- initial size of the parser's stacks. */
812
# define YYINITDEPTH 200
815
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
816
if the built-in stack extension method is used).
818
Do not make this value too large; the results are undefined if
819
YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
820
evaluated with infinite-precision integer arithmetic. */
823
# define YYMAXDEPTH 10000
831
# if defined __GLIBC__ && defined _STRING_H
832
# define yystrlen strlen
834
/* Return the length of YYSTR. */
835
#if (defined __STDC__ || defined __C99__FUNC__ \
836
|| defined __cplusplus || defined _MSC_VER)
838
yystrlen (const char *yystr)
846
for (yylen = 0; yystr[yylen]; yylen++)
854
# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
855
# define yystpcpy stpcpy
857
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
859
#if (defined __STDC__ || defined __C99__FUNC__ \
860
|| defined __cplusplus || defined _MSC_VER)
862
yystpcpy (char *yydest, const char *yysrc)
865
yystpcpy (yydest, yysrc)
871
const char *yys = yysrc;
873
while ((*yyd++ = *yys++) != '\0')
882
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
883
quotes and backslashes, so that it's suitable for yyerror. The
884
heuristic is that double-quoting is unnecessary unless the string
885
contains an apostrophe, a comma, or backslash (other than
886
backslash-backslash). YYSTR is taken from yytname. If YYRES is
887
null, do not copy; instead, return the length of what the result
890
yytnamerr (char *yyres, const char *yystr)
895
char const *yyp = yystr;
902
goto do_not_strip_quotes;
906
goto do_not_strip_quotes;
919
do_not_strip_quotes: ;
923
return yystrlen (yystr);
925
return yystpcpy (yyres, yystr) - yyres;
929
/* Copy into YYRESULT an error message about the unexpected token
930
YYCHAR while in state YYSTATE. Return the number of bytes copied,
931
including the terminating null byte. If YYRESULT is null, do not
932
copy anything; just return the number of bytes that would be
933
copied. As a special case, return 0 if an ordinary "syntax error"
934
message will do. Return YYSIZE_MAXIMUM if overflow occurs during
937
yysyntax_error (char *yyresult, int yystate, int yychar)
939
int yyn = yypact[yystate];
941
if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
945
int yytype = YYTRANSLATE (yychar);
946
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
947
YYSIZE_T yysize = yysize0;
949
int yysize_overflow = 0;
950
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
951
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
955
/* This is so xgettext sees the translatable formats that are
956
constructed on the fly. */
957
YY_("syntax error, unexpected %s");
958
YY_("syntax error, unexpected %s, expecting %s");
959
YY_("syntax error, unexpected %s, expecting %s or %s");
960
YY_("syntax error, unexpected %s, expecting %s or %s or %s");
961
YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
965
static char const yyunexpected[] = "syntax error, unexpected %s";
966
static char const yyexpecting[] = ", expecting %s";
967
static char const yyor[] = " or %s";
968
char yyformat[sizeof yyunexpected
969
+ sizeof yyexpecting - 1
970
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
971
* (sizeof yyor - 1))];
972
char const *yyprefix = yyexpecting;
974
/* Start YYX at -YYN if negative to avoid negative indexes in
976
int yyxbegin = yyn < 0 ? -yyn : 0;
978
/* Stay within bounds of both yycheck and yytname. */
979
int yychecklim = YYLAST - yyn + 1;
980
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
983
yyarg[0] = yytname[yytype];
984
yyfmt = yystpcpy (yyformat, yyunexpected);
986
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
987
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
989
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
993
yyformat[sizeof yyunexpected - 1] = '\0';
996
yyarg[yycount++] = yytname[yyx];
997
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
998
yysize_overflow |= (yysize1 < yysize);
1000
yyfmt = yystpcpy (yyfmt, yyprefix);
1004
yyf = YY_(yyformat);
1005
yysize1 = yysize + yystrlen (yyf);
1006
yysize_overflow |= (yysize1 < yysize);
1009
if (yysize_overflow)
1010
return YYSIZE_MAXIMUM;
1014
/* Avoid sprintf, as that infringes on the user's name space.
1015
Don't have undefined behavior even if the translation
1016
produced a string with the wrong number of "%s"s. */
1017
char *yyp = yyresult;
1019
while ((*yyp = *yyf) != '\0')
1021
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1023
yyp += yytnamerr (yyp, yyarg[yyi++]);
1036
#endif /* YYERROR_VERBOSE */
1039
/*-----------------------------------------------.
1040
| Release the memory associated to this symbol. |
1041
`-----------------------------------------------*/
1044
#if (defined __STDC__ || defined __C99__FUNC__ \
1045
|| defined __cplusplus || defined _MSC_VER)
1047
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1050
yydestruct (yymsg, yytype, yyvaluep)
1060
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1071
/* Prevent warnings from -Wmissing-prototypes. */
1073
#ifdef YYPARSE_PARAM
1074
#if defined __STDC__ || defined __cplusplus
1075
int yyparse (void *YYPARSE_PARAM);
1079
#else /* ! YYPARSE_PARAM */
1080
#if defined __STDC__ || defined __cplusplus
1085
#endif /* ! YYPARSE_PARAM */
1089
/* The look-ahead symbol. */
1092
/* The semantic value of the look-ahead symbol. */
1095
/* Number of syntax errors so far. */
1104
#ifdef YYPARSE_PARAM
1105
#if (defined __STDC__ || defined __C99__FUNC__ \
1106
|| defined __cplusplus || defined _MSC_VER)
1108
yyparse (void *YYPARSE_PARAM)
1111
yyparse (YYPARSE_PARAM)
1112
void *YYPARSE_PARAM;
1114
#else /* ! YYPARSE_PARAM */
1115
#if (defined __STDC__ || defined __C99__FUNC__ \
1116
|| defined __cplusplus || defined _MSC_VER)
1130
/* Number of tokens to shift before error messages enabled. */
1132
/* Look-ahead token as an internal (translated) token number. */
1135
/* Buffer for error messages, and its allocated size. */
1137
char *yymsg = yymsgbuf;
1138
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1141
/* Three stacks and their tools:
1142
`yyss': related to states,
1143
`yyvs': related to semantic values,
1144
`yyls': related to locations.
1146
Refer to the stacks thru separate pointers, to allow yyoverflow
1147
to reallocate them elsewhere. */
1149
/* The state stack. */
1150
yytype_int16 yyssa[YYINITDEPTH];
1151
yytype_int16 *yyss = yyssa;
1152
yytype_int16 *yyssp;
1154
/* The semantic value stack. */
1155
YYSTYPE yyvsa[YYINITDEPTH];
1156
YYSTYPE *yyvs = yyvsa;
1161
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1163
YYSIZE_T yystacksize = YYINITDEPTH;
1165
/* The variables used to return semantic value and location from the
1170
/* The number of symbols on the RHS of the reduced rule.
1171
Keep to zero when no symbol should be popped. */
1174
YYDPRINTF ((stderr, "Starting parse\n"));
1179
yychar = YYEMPTY; /* Cause a token to be read. */
1181
/* Initialize stack pointers.
1182
Waste one element of value and location stack
1183
so that they stay on the same level as the state stack.
1184
The wasted elements are never initialized. */
1191
/*------------------------------------------------------------.
1192
| yynewstate -- Push a new state, which is found in yystate. |
1193
`------------------------------------------------------------*/
1195
/* In all cases, when you get here, the value and location stacks
1196
have just been pushed. So pushing a state here evens the stacks. */
1202
if (yyss + yystacksize - 1 <= yyssp)
1204
/* Get the current used size of the three stacks, in elements. */
1205
YYSIZE_T yysize = yyssp - yyss + 1;
1209
/* Give user a chance to reallocate the stack. Use copies of
1210
these so that the &'s don't force the real ones into
1212
YYSTYPE *yyvs1 = yyvs;
1213
yytype_int16 *yyss1 = yyss;
1216
/* Each stack pointer address is followed by the size of the
1217
data in use in that stack, in bytes. This used to be a
1218
conditional around just the two extra args, but that might
1219
be undefined if yyoverflow is a macro. */
1220
yyoverflow (YY_("memory exhausted"),
1221
&yyss1, yysize * sizeof (*yyssp),
1222
&yyvs1, yysize * sizeof (*yyvsp),
1229
#else /* no yyoverflow */
1230
# ifndef YYSTACK_RELOCATE
1231
goto yyexhaustedlab;
1233
/* Extend the stack our own way. */
1234
if (YYMAXDEPTH <= yystacksize)
1235
goto yyexhaustedlab;
1237
if (YYMAXDEPTH < yystacksize)
1238
yystacksize = YYMAXDEPTH;
1241
yytype_int16 *yyss1 = yyss;
1242
union yyalloc *yyptr =
1243
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1245
goto yyexhaustedlab;
1246
YYSTACK_RELOCATE (yyss);
1247
YYSTACK_RELOCATE (yyvs);
1249
# undef YYSTACK_RELOCATE
1251
YYSTACK_FREE (yyss1);
1254
#endif /* no yyoverflow */
1256
yyssp = yyss + yysize - 1;
1257
yyvsp = yyvs + yysize - 1;
1260
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1261
(unsigned long int) yystacksize));
1263
if (yyss + yystacksize - 1 <= yyssp)
1267
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1276
/* Do appropriate processing given the current state. Read a
1277
look-ahead token if we need one and don't already have one. */
1279
/* First try to decide what to do without reference to look-ahead token. */
1280
yyn = yypact[yystate];
1281
if (yyn == YYPACT_NINF)
1284
/* Not known => get a look-ahead token if don't already have one. */
1286
/* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1287
if (yychar == YYEMPTY)
1289
YYDPRINTF ((stderr, "Reading a token: "));
1293
if (yychar <= YYEOF)
1295
yychar = yytoken = YYEOF;
1296
YYDPRINTF ((stderr, "Now at end of input.\n"));
1300
yytoken = YYTRANSLATE (yychar);
1301
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1304
/* If the proper action on seeing token YYTOKEN is to reduce or to
1305
detect an error, take that action. */
1307
if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1312
if (yyn == 0 || yyn == YYTABLE_NINF)
1321
/* Count tokens shifted since error; after three, turn off error
1326
/* Shift the look-ahead token. */
1327
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1329
/* Discard the shifted token unless it is eof. */
1330
if (yychar != YYEOF)
1339
/*-----------------------------------------------------------.
1340
| yydefault -- do the default action for the current state. |
1341
`-----------------------------------------------------------*/
1343
yyn = yydefact[yystate];
1349
/*-----------------------------.
1350
| yyreduce -- Do a reduction. |
1351
`-----------------------------*/
1353
/* yyn is the number of a rule to reduce with. */
1356
/* If YYLEN is nonzero, implement the default value of the action:
1359
Otherwise, the following line sets YYVAL to garbage.
1360
This behavior is undocumented and Bison
1361
users should not rely upon it. Assigning to YYVAL
1362
unconditionally makes the parser a bit smaller, and it avoids a
1363
GCC warning that YYVAL may be used uninitialized. */
1364
yyval = yyvsp[1-yylen];
1367
YY_REDUCE_PRINT (yyn);
1371
#line 74 "heimdal/lib/hx509/sel-gram.y"
1372
{ _hx509_expr_input.expr = (yyvsp[(1) - (1)].expr); }
1376
#line 76 "heimdal/lib/hx509/sel-gram.y"
1377
{ (yyval.expr) = _hx509_make_expr(op_TRUE, NULL, NULL); }
1381
#line 77 "heimdal/lib/hx509/sel-gram.y"
1382
{ (yyval.expr) = _hx509_make_expr(op_FALSE, NULL, NULL); }
1386
#line 78 "heimdal/lib/hx509/sel-gram.y"
1387
{ (yyval.expr) = _hx509_make_expr(op_NOT, (yyvsp[(2) - (2)].expr), NULL); }
1391
#line 79 "heimdal/lib/hx509/sel-gram.y"
1392
{ (yyval.expr) = _hx509_make_expr(op_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
1396
#line 80 "heimdal/lib/hx509/sel-gram.y"
1397
{ (yyval.expr) = _hx509_make_expr(op_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
1401
#line 81 "heimdal/lib/hx509/sel-gram.y"
1402
{ (yyval.expr) = (yyvsp[(2) - (3)].expr); }
1406
#line 82 "heimdal/lib/hx509/sel-gram.y"
1407
{ (yyval.expr) = _hx509_make_expr(op_COMP, (yyvsp[(1) - (1)].expr), NULL); }
1411
#line 85 "heimdal/lib/hx509/sel-gram.y"
1412
{ (yyval.expr) = _hx509_make_expr(expr_WORDS, (yyvsp[(1) - (1)].expr), NULL); }
1416
#line 86 "heimdal/lib/hx509/sel-gram.y"
1417
{ (yyval.expr) = _hx509_make_expr(expr_WORDS, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
1421
#line 89 "heimdal/lib/hx509/sel-gram.y"
1422
{ (yyval.expr) = _hx509_make_expr(comp_EQ, (yyvsp[(1) - (4)].expr), (yyvsp[(4) - (4)].expr)); }
1426
#line 90 "heimdal/lib/hx509/sel-gram.y"
1427
{ (yyval.expr) = _hx509_make_expr(comp_NE, (yyvsp[(1) - (4)].expr), (yyvsp[(4) - (4)].expr)); }
1431
#line 91 "heimdal/lib/hx509/sel-gram.y"
1432
{ (yyval.expr) = _hx509_make_expr(comp_TAILEQ, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
1436
#line 92 "heimdal/lib/hx509/sel-gram.y"
1437
{ (yyval.expr) = _hx509_make_expr(comp_IN, (yyvsp[(1) - (5)].expr), (yyvsp[(4) - (5)].expr)); }
1441
#line 93 "heimdal/lib/hx509/sel-gram.y"
1442
{ (yyval.expr) = _hx509_make_expr(comp_IN, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
1446
#line 96 "heimdal/lib/hx509/sel-gram.y"
1447
{ (yyval.expr) = (yyvsp[(1) - (1)].expr); }
1451
#line 97 "heimdal/lib/hx509/sel-gram.y"
1452
{ (yyval.expr) = (yyvsp[(1) - (1)].expr); }
1456
#line 98 "heimdal/lib/hx509/sel-gram.y"
1457
{ (yyval.expr) = (yyvsp[(1) - (1)].expr); }
1461
#line 99 "heimdal/lib/hx509/sel-gram.y"
1462
{ (yyval.expr) = (yyvsp[(1) - (1)].expr); }
1466
#line 102 "heimdal/lib/hx509/sel-gram.y"
1467
{ (yyval.expr) = _hx509_make_expr(expr_NUMBER, (yyvsp[(1) - (1)].string), NULL); }
1471
#line 103 "heimdal/lib/hx509/sel-gram.y"
1472
{ (yyval.expr) = _hx509_make_expr(expr_STRING, (yyvsp[(1) - (1)].string), NULL); }
1476
#line 105 "heimdal/lib/hx509/sel-gram.y"
1478
(yyval.expr) = _hx509_make_expr(expr_FUNCTION, (yyvsp[(1) - (4)].string), (yyvsp[(3) - (4)].expr)); }
1482
#line 108 "heimdal/lib/hx509/sel-gram.y"
1483
{ (yyval.expr) = (yyvsp[(3) - (4)].expr); }
1487
#line 111 "heimdal/lib/hx509/sel-gram.y"
1489
(yyval.expr) = _hx509_make_expr(expr_VAR, (yyvsp[(1) - (3)].string), (yyvsp[(3) - (3)].expr)); }
1493
#line 113 "heimdal/lib/hx509/sel-gram.y"
1495
(yyval.expr) = _hx509_make_expr(expr_VAR, (yyvsp[(1) - (1)].string), NULL); }
1499
/* Line 1267 of yacc.c. */
1500
#line 1501 "heimdal/lib/hx509/sel-gram.y"
1503
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1507
YY_STACK_PRINT (yyss, yyssp);
1512
/* Now `shift' the result of the reduction. Determine what state
1513
that goes to, based on the state we popped back to and the rule
1514
number reduced by. */
1518
yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1519
if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1520
yystate = yytable[yystate];
1522
yystate = yydefgoto[yyn - YYNTOKENS];
1527
/*------------------------------------.
1528
| yyerrlab -- here on detecting error |
1529
`------------------------------------*/
1531
/* If not already recovering from an error, report this error. */
1535
#if ! YYERROR_VERBOSE
1536
yyerror (YY_("syntax error"));
1539
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1540
if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1542
YYSIZE_T yyalloc = 2 * yysize;
1543
if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1544
yyalloc = YYSTACK_ALLOC_MAXIMUM;
1545
if (yymsg != yymsgbuf)
1546
YYSTACK_FREE (yymsg);
1547
yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1549
yymsg_alloc = yyalloc;
1553
yymsg_alloc = sizeof yymsgbuf;
1557
if (0 < yysize && yysize <= yymsg_alloc)
1559
(void) yysyntax_error (yymsg, yystate, yychar);
1564
yyerror (YY_("syntax error"));
1566
goto yyexhaustedlab;
1574
if (yyerrstatus == 3)
1576
/* If just tried and failed to reuse look-ahead token after an
1577
error, discard it. */
1579
if (yychar <= YYEOF)
1581
/* Return failure if at end of input. */
1582
if (yychar == YYEOF)
1587
yydestruct ("Error: discarding",
1593
/* Else will try to reuse look-ahead token after shifting the error
1598
/*---------------------------------------------------.
1599
| yyerrorlab -- error raised explicitly by YYERROR. |
1600
`---------------------------------------------------*/
1603
/* Pacify compilers like GCC when the user code never invokes
1604
YYERROR and the label yyerrorlab therefore never appears in user
1606
if (/*CONSTCOND*/ 0)
1609
/* Do not reclaim the symbols of the rule which action triggered
1613
YY_STACK_PRINT (yyss, yyssp);
1618
/*-------------------------------------------------------------.
1619
| yyerrlab1 -- common code for both syntax error and YYERROR. |
1620
`-------------------------------------------------------------*/
1622
yyerrstatus = 3; /* Each real token shifted decrements this. */
1626
yyn = yypact[yystate];
1627
if (yyn != YYPACT_NINF)
1630
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1638
/* Pop the current state because it cannot handle the error token. */
1643
yydestruct ("Error: popping",
1644
yystos[yystate], yyvsp);
1647
YY_STACK_PRINT (yyss, yyssp);
1656
/* Shift the error token. */
1657
YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1663
/*-------------------------------------.
1664
| yyacceptlab -- YYACCEPT comes here. |
1665
`-------------------------------------*/
1670
/*-----------------------------------.
1671
| yyabortlab -- YYABORT comes here. |
1672
`-----------------------------------*/
1678
/*-------------------------------------------------.
1679
| yyexhaustedlab -- memory exhaustion comes here. |
1680
`-------------------------------------------------*/
1682
yyerror (YY_("memory exhausted"));
1688
if (yychar != YYEOF && yychar != YYEMPTY)
1689
yydestruct ("Cleanup: discarding lookahead",
1691
/* Do not reclaim the symbols of the rule which action triggered
1692
this YYABORT or YYACCEPT. */
1694
YY_STACK_PRINT (yyss, yyssp);
1695
while (yyssp != yyss)
1697
yydestruct ("Cleanup: popping",
1698
yystos[*yyssp], yyvsp);
1703
YYSTACK_FREE (yyss);
1706
if (yymsg != yymsgbuf)
1707
YYSTACK_FREE (yymsg);
1709
/* Make sure YYID is used. */
1710
return YYID (yyresult);