/* [<][>][^][v][top][bottom][index][help] */
DEFINITIONS
This source file includes following definitions.
- YYID
- yy_symbol_value_print
- yy_symbol_print
- yy_stack_print
- yy_reduce_print
- yystrlen
- yystpcpy
- yytnamerr
- yysyntax_error
- yydestruct
- yyparse
1 /* A Bison parser, made by GNU Bison 2.3. */
2
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
7
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)
11 any later version.
12
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.
17
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. */
22
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.
32
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
35
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
38
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. */
45
46 /* Identify Bison output. */
47 #define YYBISON 1
48
49 /* Bison version. */
50 #define YYBISON_VERSION "2.3"
51
52 /* Skeleton name. */
53 #define YYSKELETON_NAME "yacc.c"
54
55 /* Pure parsers. */
56 #define YYPURE 0
57
58 /* Using locations. */
59 #define YYLSP_NEEDED 0
60
61
62
63 /* Tokens. */
64 #ifndef YYTOKENTYPE
65 # define YYTOKENTYPE
66 /* Put the tokens into the symbol table, so that GDB and other debuggers
67 know about them. */
68 enum yytokentype {
69 kw_TRUE = 258,
70 kw_FALSE = 259,
71 kw_AND = 260,
72 kw_OR = 261,
73 kw_IN = 262,
74 kw_TAILMATCH = 263,
75 NUMBER = 264,
76 STRING = 265,
77 IDENTIFIER = 266
78 };
79 #endif
80 /* Tokens. */
81 #define kw_TRUE 258
82 #define kw_FALSE 259
83 #define kw_AND 260
84 #define kw_OR 261
85 #define kw_IN 262
86 #define kw_TAILMATCH 263
87 #define NUMBER 264
88 #define STRING 265
89 #define IDENTIFIER 266
90
91
92
93
94 /* Copy the first part of user declarations. */
95 #line 34 "heimdal/lib/hx509/sel-gram.y"
96
97 #ifdef HAVE_CONFIG_H
98 #include <config.h>
99 #endif
100 #include <stdio.h>
101 #include <stdlib.h>
102 #include <hx_locl.h>
103
104 RCSID("$Id$");
105
106
107
108 /* Enabling traces. */
109 #ifndef YYDEBUG
110 # define YYDEBUG 0
111 #endif
112
113 /* Enabling verbose error messages. */
114 #ifdef YYERROR_VERBOSE
115 # undef YYERROR_VERBOSE
116 # define YYERROR_VERBOSE 1
117 #else
118 # define YYERROR_VERBOSE 0
119 #endif
120
121 /* Enabling the token table. */
122 #ifndef YYTOKEN_TABLE
123 # define YYTOKEN_TABLE 0
124 #endif
125
126 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
127 typedef union YYSTYPE
128 #line 46 "heimdal/lib/hx509/sel-gram.y"
129 {
130 char *string;
131 struct hx_expr *expr;
132 }
133 /* Line 187 of yacc.c. */
134 #line 135 "heimdal/lib/hx509/sel-gram.y"
135 YYSTYPE;
136 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
137 # define YYSTYPE_IS_DECLARED 1
138 # define YYSTYPE_IS_TRIVIAL 1
139 #endif
140
141
142
143 /* Copy the second part of user declarations. */
144
145
146 /* Line 216 of yacc.c. */
147 #line 148 "heimdal/lib/hx509/sel-gram.y"
148
149 #ifdef short
150 # undef short
151 #endif
152
153 #ifdef YYTYPE_UINT8
154 typedef YYTYPE_UINT8 yytype_uint8;
155 #else
156 typedef unsigned char yytype_uint8;
157 #endif
158
159 #ifdef YYTYPE_INT8
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;
164 #else
165 typedef short int yytype_int8;
166 #endif
167
168 #ifdef YYTYPE_UINT16
169 typedef YYTYPE_UINT16 yytype_uint16;
170 #else
171 typedef unsigned short int yytype_uint16;
172 #endif
173
174 #ifdef YYTYPE_INT16
175 typedef YYTYPE_INT16 yytype_int16;
176 #else
177 typedef short int yytype_int16;
178 #endif
179
180 #ifndef YYSIZE_T
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
189 # else
190 # define YYSIZE_T unsigned int
191 # endif
192 #endif
193
194 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
195
196 #ifndef YY_
197 # if YYENABLE_NLS
198 # if ENABLE_NLS
199 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
200 # define YY_(msgid) dgettext ("bison-runtime", msgid)
201 # endif
202 # endif
203 # ifndef YY_
204 # define YY_(msgid) msgid
205 # endif
206 #endif
207
208 /* Suppress unused-variable warnings by "using" E. */
209 #if ! defined lint || defined __GNUC__
210 # define YYUSE(e) ((void) (e))
211 #else
212 # define YYUSE(e) /* empty */
213 #endif
214
215 /* Identity function, used to suppress warnings about constant conditions. */
216 #ifndef lint
217 # define YYID(n) (n)
218 #else
219 #if (defined __STDC__ || defined __C99__FUNC__ \
220 || defined __cplusplus || defined _MSC_VER)
221 static int
222 YYID (int i)
/* [<][>][^][v][top][bottom][index][help] */
223 #else
224 static int
225 YYID (i)
226 int i;
227 #endif
228 {
229 return i;
230 }
231 #endif
232
233 #if ! defined yyoverflow || YYERROR_VERBOSE
234
235 /* The parser invokes alloca or malloc; define the necessary symbols. */
236
237 # ifdef YYSTACK_USE_ALLOCA
238 # if YYSTACK_USE_ALLOCA
239 # ifdef __GNUC__
240 # define YYSTACK_ALLOC __builtin_alloca
241 # elif defined __BUILTIN_VA_ARG_INCR
242 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
243 # elif defined _AIX
244 # define YYSTACK_ALLOC __alloca
245 # elif defined _MSC_VER
246 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
247 # define alloca _alloca
248 # else
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 */
253 # ifndef _STDLIB_H
254 # define _STDLIB_H 1
255 # endif
256 # endif
257 # endif
258 # endif
259 # endif
260
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 */
270 # endif
271 # else
272 # define YYSTACK_ALLOC YYMALLOC
273 # define YYSTACK_FREE YYFREE
274 # ifndef YYSTACK_ALLOC_MAXIMUM
275 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
276 # endif
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 */
281 # ifndef _STDLIB_H
282 # define _STDLIB_H 1
283 # endif
284 # endif
285 # ifndef YYMALLOC
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 */
290 # endif
291 # endif
292 # ifndef YYFREE
293 # define YYFREE free
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 */
297 # endif
298 # endif
299 # endif
300 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
301
302
303 #if (! defined yyoverflow \
304 && (! defined __cplusplus \
305 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
306
307 /* A type that is properly aligned for any stack member. */
308 union yyalloc
309 {
310 yytype_int16 yyss;
311 YYSTYPE yyvs;
312 };
313
314 /* The size of the maximum gap between one aligned stack and the next. */
315 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
316
317 /* The size of an array large to enough to hold all stacks, each with
318 N elements. */
319 # define YYSTACK_BYTES(N) \
320 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
321 + YYSTACK_GAP_MAXIMUM)
322
323 /* Copy COUNT objects from FROM to TO. The source and destination do
324 not overlap. */
325 # ifndef YYCOPY
326 # if defined __GNUC__ && 1 < __GNUC__
327 # define YYCOPY(To, From, Count) \
328 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
329 # else
330 # define YYCOPY(To, From, Count) \
331 do \
332 { \
333 YYSIZE_T yyi; \
334 for (yyi = 0; yyi < (Count); yyi++) \
335 (To)[yyi] = (From)[yyi]; \
336 } \
337 while (YYID (0))
338 # endif
339 # endif
340
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
345 stack. */
346 # define YYSTACK_RELOCATE(Stack) \
347 do \
348 { \
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); \
354 } \
355 while (YYID (0))
356
357 #endif
358
359 /* YYFINAL -- State number of the termination state. */
360 #define YYFINAL 21
361 /* YYLAST -- Last index in YYTABLE. */
362 #define YYLAST 50
363
364 /* YYNTOKENS -- Number of terminals. */
365 #define YYNTOKENS 21
366 /* YYNNTS -- Number of nonterminals. */
367 #define YYNNTS 11
368 /* YYNRULES -- Number of rules. */
369 #define YYNRULES 26
370 /* YYNRULES -- Number of states. */
371 #define YYNSTATES 50
372
373 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
374 #define YYUNDEFTOK 2
375 #define YYMAXUTOK 266
376
377 #define YYTRANSLATE(YYX) \
378 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
379
380 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
381 static const yytype_uint8 yytranslate[] =
382 {
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
410 };
411
412 #if YYDEBUG
413 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
414 YYRHS. */
415 static const yytype_uint8 yyprhs[] =
416 {
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
420 };
421
422 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
423 static const yytype_int8 yyrhs[] =
424 {
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,
433 31, -1, 11, -1
434 };
435
436 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
437 static const yytype_uint8 yyrline[] =
438 {
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
442 };
443 #endif
444
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[] =
449 {
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
455 };
456 #endif
457
458 # ifdef YYPRINT
459 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
460 token YYLEX-NUM. */
461 static const yytype_uint16 yytoknum[] =
462 {
463 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
464 265, 266, 33, 40, 41, 44, 61, 37, 123, 125,
465 46
466 };
467 # endif
468
469 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
470 static const yytype_uint8 yyr1[] =
471 {
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
475 };
476
477 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
478 static const yytype_uint8 yyr2[] =
479 {
480 0, 2, 1, 1, 1, 2, 3, 3, 3, 1,
481 1, 3, 4, 4, 3, 5, 3, 1, 1, 1,
482 1, 1, 1, 4, 4, 3, 1
483 };
484
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[] =
489 {
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
495 };
496
497 /* YYDEFGOTO[NTERM-NUM]. */
498 static const yytype_int8 yydefgoto[] =
499 {
500 -1, 9, 10, 28, 11, 12, 13, 14, 15, 16,
501 32
502 };
503
504 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
505 STATE-NUM. */
506 #define YYPACT_NINF -31
507 static const yytype_int8 yypact[] =
508 {
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
514 };
515
516 /* YYPGOTO[NTERM-NUM]. */
517 static const yytype_int8 yypgoto[] =
518 {
519 -31, -31, -3, -30, -31, -17, -31, -31, -31, 21,
520 1
521 };
522
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[] =
529 {
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,
535 43
536 };
537
538 static const yytype_int8 yycheck[] =
539 {
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,
545 19
546 };
547
548 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
549 symbol of state STATE-NUM. */
550 static const yytype_uint8 yystos[] =
551 {
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
557 };
558
559 #define yyerrok (yyerrstatus = 0)
560 #define yyclearin (yychar = YYEMPTY)
561 #define YYEMPTY (-2)
562 #define YYEOF 0
563
564 #define YYACCEPT goto yyacceptlab
565 #define YYABORT goto yyabortlab
566 #define YYERROR goto yyerrorlab
567
568
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. */
572
573 #define YYFAIL goto yyerrlab
574
575 #define YYRECOVERING() (!!yyerrstatus)
576
577 #define YYBACKUP(Token, Value) \
578 do \
579 if (yychar == YYEMPTY && yylen == 1) \
580 { \
581 yychar = (Token); \
582 yylval = (Value); \
583 yytoken = YYTRANSLATE (yychar); \
584 YYPOPSTACK (1); \
585 goto yybackup; \
586 } \
587 else \
588 { \
589 yyerror (YY_("syntax error: cannot back up")); \
590 YYERROR; \
591 } \
592 while (YYID (0))
593
594
595 #define YYTERROR 1
596 #define YYERRCODE 256
597
598
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). */
602
603 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
604 #ifndef YYLLOC_DEFAULT
605 # define YYLLOC_DEFAULT(Current, Rhs, N) \
606 do \
607 if (YYID (N)) \
608 { \
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; \
613 } \
614 else \
615 { \
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; \
620 } \
621 while (YYID (0))
622 #endif
623
624
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. */
628
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)
635 # else
636 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
637 # endif
638 #endif
639
640
641 /* YYLEX -- calling `yylex' with the right arguments. */
642
643 #ifdef YYLEX_PARAM
644 # define YYLEX yylex (YYLEX_PARAM)
645 #else
646 # define YYLEX yylex ()
647 #endif
648
649 /* Enable debugging if requested. */
650 #if YYDEBUG
651
652 # ifndef YYFPRINTF
653 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
654 # define YYFPRINTF fprintf
655 # endif
656
657 # define YYDPRINTF(Args) \
658 do { \
659 if (yydebug) \
660 YYFPRINTF Args; \
661 } while (YYID (0))
662
663 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
664 do { \
665 if (yydebug) \
666 { \
667 YYFPRINTF (stderr, "%s ", Title); \
668 yy_symbol_print (stderr, \
669 Type, Value); \
670 YYFPRINTF (stderr, "\n"); \
671 } \
672 } while (YYID (0))
673
674
675 /*--------------------------------.
676 | Print this symbol on YYOUTPUT. |
677 `--------------------------------*/
678
679 /*ARGSUSED*/
680 #if (defined __STDC__ || defined __C99__FUNC__ \
681 || defined __cplusplus || defined _MSC_VER)
682 static void
683 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
/* [<][>][^][v][top][bottom][index][help] */
684 #else
685 static void
686 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
687 FILE *yyoutput;
688 int yytype;
689 YYSTYPE const * const yyvaluep;
690 #endif
691 {
692 if (!yyvaluep)
693 return;
694 # ifdef YYPRINT
695 if (yytype < YYNTOKENS)
696 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
697 # else
698 YYUSE (yyoutput);
699 # endif
700 switch (yytype)
701 {
702 default:
703 break;
704 }
705 }
706
707
708 /*--------------------------------.
709 | Print this symbol on YYOUTPUT. |
710 `--------------------------------*/
711
712 #if (defined __STDC__ || defined __C99__FUNC__ \
713 || defined __cplusplus || defined _MSC_VER)
714 static void
715 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
/* [<][>][^][v][top][bottom][index][help] */
716 #else
717 static void
718 yy_symbol_print (yyoutput, yytype, yyvaluep)
719 FILE *yyoutput;
720 int yytype;
721 YYSTYPE const * const yyvaluep;
722 #endif
723 {
724 if (yytype < YYNTOKENS)
725 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
726 else
727 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
728
729 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
730 YYFPRINTF (yyoutput, ")");
731 }
732
733 /*------------------------------------------------------------------.
734 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
735 | TOP (included). |
736 `------------------------------------------------------------------*/
737
738 #if (defined __STDC__ || defined __C99__FUNC__ \
739 || defined __cplusplus || defined _MSC_VER)
740 static void
741 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
/* [<][>][^][v][top][bottom][index][help] */
742 #else
743 static void
744 yy_stack_print (bottom, top)
745 yytype_int16 *bottom;
746 yytype_int16 *top;
747 #endif
748 {
749 YYFPRINTF (stderr, "Stack now");
750 for (; bottom <= top; ++bottom)
751 YYFPRINTF (stderr, " %d", *bottom);
752 YYFPRINTF (stderr, "\n");
753 }
754
755 # define YY_STACK_PRINT(Bottom, Top) \
756 do { \
757 if (yydebug) \
758 yy_stack_print ((Bottom), (Top)); \
759 } while (YYID (0))
760
761
762 /*------------------------------------------------.
763 | Report that the YYRULE is going to be reduced. |
764 `------------------------------------------------*/
765
766 #if (defined __STDC__ || defined __C99__FUNC__ \
767 || defined __cplusplus || defined _MSC_VER)
768 static void
769 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
/* [<][>][^][v][top][bottom][index][help] */
770 #else
771 static void
772 yy_reduce_print (yyvsp, yyrule)
773 YYSTYPE *yyvsp;
774 int yyrule;
775 #endif
776 {
777 int yynrhs = yyr2[yyrule];
778 int yyi;
779 unsigned long int yylno = yyrline[yyrule];
780 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
781 yyrule - 1, yylno);
782 /* The symbols being reduced. */
783 for (yyi = 0; yyi < yynrhs; yyi++)
784 {
785 fprintf (stderr, " $%d = ", yyi + 1);
786 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
787 &(yyvsp[(yyi + 1) - (yynrhs)])
788 );
789 fprintf (stderr, "\n");
790 }
791 }
792
793 # define YY_REDUCE_PRINT(Rule) \
794 do { \
795 if (yydebug) \
796 yy_reduce_print (yyvsp, Rule); \
797 } while (YYID (0))
798
799 /* Nonzero means print parse trace. It is left uninitialized so that
800 multiple parsers can coexist. */
801 int yydebug;
802 #else /* !YYDEBUG */
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 */
808
809
810 /* YYINITDEPTH -- initial size of the parser's stacks. */
811 #ifndef YYINITDEPTH
812 # define YYINITDEPTH 200
813 #endif
814
815 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
816 if the built-in stack extension method is used).
817
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. */
821
822 #ifndef YYMAXDEPTH
823 # define YYMAXDEPTH 10000
824 #endif
825
826
827
828 #if YYERROR_VERBOSE
829
830 # ifndef yystrlen
831 # if defined __GLIBC__ && defined _STRING_H
832 # define yystrlen strlen
833 # else
834 /* Return the length of YYSTR. */
835 #if (defined __STDC__ || defined __C99__FUNC__ \
836 || defined __cplusplus || defined _MSC_VER)
837 static YYSIZE_T
838 yystrlen (const char *yystr)
/* [<][>][^][v][top][bottom][index][help] */
839 #else
840 static YYSIZE_T
841 yystrlen (yystr)
842 const char *yystr;
843 #endif
844 {
845 YYSIZE_T yylen;
846 for (yylen = 0; yystr[yylen]; yylen++)
847 continue;
848 return yylen;
849 }
850 # endif
851 # endif
852
853 # ifndef yystpcpy
854 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
855 # define yystpcpy stpcpy
856 # else
857 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
858 YYDEST. */
859 #if (defined __STDC__ || defined __C99__FUNC__ \
860 || defined __cplusplus || defined _MSC_VER)
861 static char *
862 yystpcpy (char *yydest, const char *yysrc)
/* [<][>][^][v][top][bottom][index][help] */
863 #else
864 static char *
865 yystpcpy (yydest, yysrc)
866 char *yydest;
867 const char *yysrc;
868 #endif
869 {
870 char *yyd = yydest;
871 const char *yys = yysrc;
872
873 while ((*yyd++ = *yys++) != '\0')
874 continue;
875
876 return yyd - 1;
877 }
878 # endif
879 # endif
880
881 # ifndef yytnamerr
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
888 would have been. */
889 static YYSIZE_T
890 yytnamerr (char *yyres, const char *yystr)
/* [<][>][^][v][top][bottom][index][help] */
891 {
892 if (*yystr == '"')
893 {
894 YYSIZE_T yyn = 0;
895 char const *yyp = yystr;
896
897 for (;;)
898 switch (*++yyp)
899 {
900 case '\'':
901 case ',':
902 goto do_not_strip_quotes;
903
904 case '\\':
905 if (*++yyp != '\\')
906 goto do_not_strip_quotes;
907 /* Fall through. */
908 default:
909 if (yyres)
910 yyres[yyn] = *yyp;
911 yyn++;
912 break;
913
914 case '"':
915 if (yyres)
916 yyres[yyn] = '\0';
917 return yyn;
918 }
919 do_not_strip_quotes: ;
920 }
921
922 if (! yyres)
923 return yystrlen (yystr);
924
925 return yystpcpy (yyres, yystr) - yyres;
926 }
927 # endif
928
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
935 size calculation. */
936 static YYSIZE_T
937 yysyntax_error (char *yyresult, int yystate, int yychar)
/* [<][>][^][v][top][bottom][index][help] */
938 {
939 int yyn = yypact[yystate];
940
941 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
942 return 0;
943 else
944 {
945 int yytype = YYTRANSLATE (yychar);
946 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
947 YYSIZE_T yysize = yysize0;
948 YYSIZE_T yysize1;
949 int yysize_overflow = 0;
950 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
951 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
952 int yyx;
953
954 # if 0
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");
962 # endif
963 char *yyfmt;
964 char const *yyf;
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;
973
974 /* Start YYX at -YYN if negative to avoid negative indexes in
975 YYCHECK. */
976 int yyxbegin = yyn < 0 ? -yyn : 0;
977
978 /* Stay within bounds of both yycheck and yytname. */
979 int yychecklim = YYLAST - yyn + 1;
980 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
981 int yycount = 1;
982
983 yyarg[0] = yytname[yytype];
984 yyfmt = yystpcpy (yyformat, yyunexpected);
985
986 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
987 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
988 {
989 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
990 {
991 yycount = 1;
992 yysize = yysize0;
993 yyformat[sizeof yyunexpected - 1] = '\0';
994 break;
995 }
996 yyarg[yycount++] = yytname[yyx];
997 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
998 yysize_overflow |= (yysize1 < yysize);
999 yysize = yysize1;
1000 yyfmt = yystpcpy (yyfmt, yyprefix);
1001 yyprefix = yyor;
1002 }
1003
1004 yyf = YY_(yyformat);
1005 yysize1 = yysize + yystrlen (yyf);
1006 yysize_overflow |= (yysize1 < yysize);
1007 yysize = yysize1;
1008
1009 if (yysize_overflow)
1010 return YYSIZE_MAXIMUM;
1011
1012 if (yyresult)
1013 {
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;
1018 int yyi = 0;
1019 while ((*yyp = *yyf) != '\0')
1020 {
1021 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1022 {
1023 yyp += yytnamerr (yyp, yyarg[yyi++]);
1024 yyf += 2;
1025 }
1026 else
1027 {
1028 yyp++;
1029 yyf++;
1030 }
1031 }
1032 }
1033 return yysize;
1034 }
1035 }
1036 #endif /* YYERROR_VERBOSE */
1037
1038
1039 /*-----------------------------------------------.
1040 | Release the memory associated to this symbol. |
1041 `-----------------------------------------------*/
1042
1043 /*ARGSUSED*/
1044 #if (defined __STDC__ || defined __C99__FUNC__ \
1045 || defined __cplusplus || defined _MSC_VER)
1046 static void
1047 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
/* [<][>][^][v][top][bottom][index][help] */
1048 #else
1049 static void
1050 yydestruct (yymsg, yytype, yyvaluep)
1051 const char *yymsg;
1052 int yytype;
1053 YYSTYPE *yyvaluep;
1054 #endif
1055 {
1056 YYUSE (yyvaluep);
1057
1058 if (!yymsg)
1059 yymsg = "Deleting";
1060 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1061
1062 switch (yytype)
1063 {
1064
1065 default:
1066 break;
1067 }
1068 }
1069
1070
1071 /* Prevent warnings from -Wmissing-prototypes. */
1072
1073 #ifdef YYPARSE_PARAM
1074 #if defined __STDC__ || defined __cplusplus
1075 int yyparse (void *YYPARSE_PARAM);
1076 #else
1077 int yyparse ();
1078 #endif
1079 #else /* ! YYPARSE_PARAM */
1080 #if defined __STDC__ || defined __cplusplus
1081 int yyparse (void);
1082 #else
1083 int yyparse ();
1084 #endif
1085 #endif /* ! YYPARSE_PARAM */
1086
1087
1088
1089 /* The look-ahead symbol. */
1090 int yychar;
1091
1092 /* The semantic value of the look-ahead symbol. */
1093 YYSTYPE yylval;
1094
1095 /* Number of syntax errors so far. */
1096 int yynerrs;
1097
1098
1099
1100 /*----------.
1101 | yyparse. |
1102 `----------*/
1103
1104 #ifdef YYPARSE_PARAM
1105 #if (defined __STDC__ || defined __C99__FUNC__ \
1106 || defined __cplusplus || defined _MSC_VER)
1107 int
1108 yyparse (void *YYPARSE_PARAM)
/* [<][>][^][v][top][bottom][index][help] */
1109 #else
1110 int
1111 yyparse (YYPARSE_PARAM)
1112 void *YYPARSE_PARAM;
1113 #endif
1114 #else /* ! YYPARSE_PARAM */
1115 #if (defined __STDC__ || defined __C99__FUNC__ \
1116 || defined __cplusplus || defined _MSC_VER)
1117 int
1118 yyparse (void)
1119 #else
1120 int
1121 yyparse ()
1122
1123 #endif
1124 #endif
1125 {
1126
1127 int yystate;
1128 int yyn;
1129 int yyresult;
1130 /* Number of tokens to shift before error messages enabled. */
1131 int yyerrstatus;
1132 /* Look-ahead token as an internal (translated) token number. */
1133 int yytoken = 0;
1134 #if YYERROR_VERBOSE
1135 /* Buffer for error messages, and its allocated size. */
1136 char yymsgbuf[128];
1137 char *yymsg = yymsgbuf;
1138 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1139 #endif
1140
1141 /* Three stacks and their tools:
1142 `yyss': related to states,
1143 `yyvs': related to semantic values,
1144 `yyls': related to locations.
1145
1146 Refer to the stacks thru separate pointers, to allow yyoverflow
1147 to reallocate them elsewhere. */
1148
1149 /* The state stack. */
1150 yytype_int16 yyssa[YYINITDEPTH];
1151 yytype_int16 *yyss = yyssa;
1152 yytype_int16 *yyssp;
1153
1154 /* The semantic value stack. */
1155 YYSTYPE yyvsa[YYINITDEPTH];
1156 YYSTYPE *yyvs = yyvsa;
1157 YYSTYPE *yyvsp;
1158
1159
1160
1161 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1162
1163 YYSIZE_T yystacksize = YYINITDEPTH;
1164
1165 /* The variables used to return semantic value and location from the
1166 action routines. */
1167 YYSTYPE yyval;
1168
1169
1170 /* The number of symbols on the RHS of the reduced rule.
1171 Keep to zero when no symbol should be popped. */
1172 int yylen = 0;
1173
1174 YYDPRINTF ((stderr, "Starting parse\n"));
1175
1176 yystate = 0;
1177 yyerrstatus = 0;
1178 yynerrs = 0;
1179 yychar = YYEMPTY; /* Cause a token to be read. */
1180
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. */
1185
1186 yyssp = yyss;
1187 yyvsp = yyvs;
1188
1189 goto yysetstate;
1190
1191 /*------------------------------------------------------------.
1192 | yynewstate -- Push a new state, which is found in yystate. |
1193 `------------------------------------------------------------*/
1194 yynewstate:
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. */
1197 yyssp++;
1198
1199 yysetstate:
1200 *yyssp = yystate;
1201
1202 if (yyss + yystacksize - 1 <= yyssp)
1203 {
1204 /* Get the current used size of the three stacks, in elements. */
1205 YYSIZE_T yysize = yyssp - yyss + 1;
1206
1207 #ifdef yyoverflow
1208 {
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
1211 memory. */
1212 YYSTYPE *yyvs1 = yyvs;
1213 yytype_int16 *yyss1 = yyss;
1214
1215
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),
1223
1224 &yystacksize);
1225
1226 yyss = yyss1;
1227 yyvs = yyvs1;
1228 }
1229 #else /* no yyoverflow */
1230 # ifndef YYSTACK_RELOCATE
1231 goto yyexhaustedlab;
1232 # else
1233 /* Extend the stack our own way. */
1234 if (YYMAXDEPTH <= yystacksize)
1235 goto yyexhaustedlab;
1236 yystacksize *= 2;
1237 if (YYMAXDEPTH < yystacksize)
1238 yystacksize = YYMAXDEPTH;
1239
1240 {
1241 yytype_int16 *yyss1 = yyss;
1242 union yyalloc *yyptr =
1243 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1244 if (! yyptr)
1245 goto yyexhaustedlab;
1246 YYSTACK_RELOCATE (yyss);
1247 YYSTACK_RELOCATE (yyvs);
1248
1249 # undef YYSTACK_RELOCATE
1250 if (yyss1 != yyssa)
1251 YYSTACK_FREE (yyss1);
1252 }
1253 # endif
1254 #endif /* no yyoverflow */
1255
1256 yyssp = yyss + yysize - 1;
1257 yyvsp = yyvs + yysize - 1;
1258
1259
1260 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1261 (unsigned long int) yystacksize));
1262
1263 if (yyss + yystacksize - 1 <= yyssp)
1264 YYABORT;
1265 }
1266
1267 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1268
1269 goto yybackup;
1270
1271 /*-----------.
1272 | yybackup. |
1273 `-----------*/
1274 yybackup:
1275
1276 /* Do appropriate processing given the current state. Read a
1277 look-ahead token if we need one and don't already have one. */
1278
1279 /* First try to decide what to do without reference to look-ahead token. */
1280 yyn = yypact[yystate];
1281 if (yyn == YYPACT_NINF)
1282 goto yydefault;
1283
1284 /* Not known => get a look-ahead token if don't already have one. */
1285
1286 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1287 if (yychar == YYEMPTY)
1288 {
1289 YYDPRINTF ((stderr, "Reading a token: "));
1290 yychar = YYLEX;
1291 }
1292
1293 if (yychar <= YYEOF)
1294 {
1295 yychar = yytoken = YYEOF;
1296 YYDPRINTF ((stderr, "Now at end of input.\n"));
1297 }
1298 else
1299 {
1300 yytoken = YYTRANSLATE (yychar);
1301 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1302 }
1303
1304 /* If the proper action on seeing token YYTOKEN is to reduce or to
1305 detect an error, take that action. */
1306 yyn += yytoken;
1307 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1308 goto yydefault;
1309 yyn = yytable[yyn];
1310 if (yyn <= 0)
1311 {
1312 if (yyn == 0 || yyn == YYTABLE_NINF)
1313 goto yyerrlab;
1314 yyn = -yyn;
1315 goto yyreduce;
1316 }
1317
1318 if (yyn == YYFINAL)
1319 YYACCEPT;
1320
1321 /* Count tokens shifted since error; after three, turn off error
1322 status. */
1323 if (yyerrstatus)
1324 yyerrstatus--;
1325
1326 /* Shift the look-ahead token. */
1327 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1328
1329 /* Discard the shifted token unless it is eof. */
1330 if (yychar != YYEOF)
1331 yychar = YYEMPTY;
1332
1333 yystate = yyn;
1334 *++yyvsp = yylval;
1335
1336 goto yynewstate;
1337
1338
1339 /*-----------------------------------------------------------.
1340 | yydefault -- do the default action for the current state. |
1341 `-----------------------------------------------------------*/
1342 yydefault:
1343 yyn = yydefact[yystate];
1344 if (yyn == 0)
1345 goto yyerrlab;
1346 goto yyreduce;
1347
1348
1349 /*-----------------------------.
1350 | yyreduce -- Do a reduction. |
1351 `-----------------------------*/
1352 yyreduce:
1353 /* yyn is the number of a rule to reduce with. */
1354 yylen = yyr2[yyn];
1355
1356 /* If YYLEN is nonzero, implement the default value of the action:
1357 `$$ = $1'.
1358
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];
1365
1366
1367 YY_REDUCE_PRINT (yyn);
1368 switch (yyn)
1369 {
1370 case 2:
1371 #line 74 "heimdal/lib/hx509/sel-gram.y"
1372 { _hx509_expr_input.expr = (yyvsp[(1) - (1)].expr); }
1373 break;
1374
1375 case 3:
1376 #line 76 "heimdal/lib/hx509/sel-gram.y"
1377 { (yyval.expr) = _hx509_make_expr(op_TRUE, NULL, NULL); }
1378 break;
1379
1380 case 4:
1381 #line 77 "heimdal/lib/hx509/sel-gram.y"
1382 { (yyval.expr) = _hx509_make_expr(op_FALSE, NULL, NULL); }
1383 break;
1384
1385 case 5:
1386 #line 78 "heimdal/lib/hx509/sel-gram.y"
1387 { (yyval.expr) = _hx509_make_expr(op_NOT, (yyvsp[(2) - (2)].expr), NULL); }
1388 break;
1389
1390 case 6:
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)); }
1393 break;
1394
1395 case 7:
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)); }
1398 break;
1399
1400 case 8:
1401 #line 81 "heimdal/lib/hx509/sel-gram.y"
1402 { (yyval.expr) = (yyvsp[(2) - (3)].expr); }
1403 break;
1404
1405 case 9:
1406 #line 82 "heimdal/lib/hx509/sel-gram.y"
1407 { (yyval.expr) = _hx509_make_expr(op_COMP, (yyvsp[(1) - (1)].expr), NULL); }
1408 break;
1409
1410 case 10:
1411 #line 85 "heimdal/lib/hx509/sel-gram.y"
1412 { (yyval.expr) = _hx509_make_expr(expr_WORDS, (yyvsp[(1) - (1)].expr), NULL); }
1413 break;
1414
1415 case 11:
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)); }
1418 break;
1419
1420 case 12:
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)); }
1423 break;
1424
1425 case 13:
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)); }
1428 break;
1429
1430 case 14:
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)); }
1433 break;
1434
1435 case 15:
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)); }
1438 break;
1439
1440 case 16:
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)); }
1443 break;
1444
1445 case 17:
1446 #line 96 "heimdal/lib/hx509/sel-gram.y"
1447 { (yyval.expr) = (yyvsp[(1) - (1)].expr); }
1448 break;
1449
1450 case 18:
1451 #line 97 "heimdal/lib/hx509/sel-gram.y"
1452 { (yyval.expr) = (yyvsp[(1) - (1)].expr); }
1453 break;
1454
1455 case 19:
1456 #line 98 "heimdal/lib/hx509/sel-gram.y"
1457 { (yyval.expr) = (yyvsp[(1) - (1)].expr); }
1458 break;
1459
1460 case 20:
1461 #line 99 "heimdal/lib/hx509/sel-gram.y"
1462 { (yyval.expr) = (yyvsp[(1) - (1)].expr); }
1463 break;
1464
1465 case 21:
1466 #line 102 "heimdal/lib/hx509/sel-gram.y"
1467 { (yyval.expr) = _hx509_make_expr(expr_NUMBER, (yyvsp[(1) - (1)].string), NULL); }
1468 break;
1469
1470 case 22:
1471 #line 103 "heimdal/lib/hx509/sel-gram.y"
1472 { (yyval.expr) = _hx509_make_expr(expr_STRING, (yyvsp[(1) - (1)].string), NULL); }
1473 break;
1474
1475 case 23:
1476 #line 105 "heimdal/lib/hx509/sel-gram.y"
1477 {
1478 (yyval.expr) = _hx509_make_expr(expr_FUNCTION, (yyvsp[(1) - (4)].string), (yyvsp[(3) - (4)].expr)); }
1479 break;
1480
1481 case 24:
1482 #line 108 "heimdal/lib/hx509/sel-gram.y"
1483 { (yyval.expr) = (yyvsp[(3) - (4)].expr); }
1484 break;
1485
1486 case 25:
1487 #line 111 "heimdal/lib/hx509/sel-gram.y"
1488 {
1489 (yyval.expr) = _hx509_make_expr(expr_VAR, (yyvsp[(1) - (3)].string), (yyvsp[(3) - (3)].expr)); }
1490 break;
1491
1492 case 26:
1493 #line 113 "heimdal/lib/hx509/sel-gram.y"
1494 {
1495 (yyval.expr) = _hx509_make_expr(expr_VAR, (yyvsp[(1) - (1)].string), NULL); }
1496 break;
1497
1498
1499 /* Line 1267 of yacc.c. */
1500 #line 1501 "heimdal/lib/hx509/sel-gram.y"
1501 default: break;
1502 }
1503 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1504
1505 YYPOPSTACK (yylen);
1506 yylen = 0;
1507 YY_STACK_PRINT (yyss, yyssp);
1508
1509 *++yyvsp = yyval;
1510
1511
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. */
1515
1516 yyn = yyr1[yyn];
1517
1518 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1519 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1520 yystate = yytable[yystate];
1521 else
1522 yystate = yydefgoto[yyn - YYNTOKENS];
1523
1524 goto yynewstate;
1525
1526
1527 /*------------------------------------.
1528 | yyerrlab -- here on detecting error |
1529 `------------------------------------*/
1530 yyerrlab:
1531 /* If not already recovering from an error, report this error. */
1532 if (!yyerrstatus)
1533 {
1534 ++yynerrs;
1535 #if ! YYERROR_VERBOSE
1536 yyerror (YY_("syntax error"));
1537 #else
1538 {
1539 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1540 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1541 {
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);
1548 if (yymsg)
1549 yymsg_alloc = yyalloc;
1550 else
1551 {
1552 yymsg = yymsgbuf;
1553 yymsg_alloc = sizeof yymsgbuf;
1554 }
1555 }
1556
1557 if (0 < yysize && yysize <= yymsg_alloc)
1558 {
1559 (void) yysyntax_error (yymsg, yystate, yychar);
1560 yyerror (yymsg);
1561 }
1562 else
1563 {
1564 yyerror (YY_("syntax error"));
1565 if (yysize != 0)
1566 goto yyexhaustedlab;
1567 }
1568 }
1569 #endif
1570 }
1571
1572
1573
1574 if (yyerrstatus == 3)
1575 {
1576 /* If just tried and failed to reuse look-ahead token after an
1577 error, discard it. */
1578
1579 if (yychar <= YYEOF)
1580 {
1581 /* Return failure if at end of input. */
1582 if (yychar == YYEOF)
1583 YYABORT;
1584 }
1585 else
1586 {
1587 yydestruct ("Error: discarding",
1588 yytoken, &yylval);
1589 yychar = YYEMPTY;
1590 }
1591 }
1592
1593 /* Else will try to reuse look-ahead token after shifting the error
1594 token. */
1595 goto yyerrlab1;
1596
1597
1598 /*---------------------------------------------------.
1599 | yyerrorlab -- error raised explicitly by YYERROR. |
1600 `---------------------------------------------------*/
1601 yyerrorlab:
1602
1603 /* Pacify compilers like GCC when the user code never invokes
1604 YYERROR and the label yyerrorlab therefore never appears in user
1605 code. */
1606 if (/*CONSTCOND*/ 0)
1607 goto yyerrorlab;
1608
1609 /* Do not reclaim the symbols of the rule which action triggered
1610 this YYERROR. */
1611 YYPOPSTACK (yylen);
1612 yylen = 0;
1613 YY_STACK_PRINT (yyss, yyssp);
1614 yystate = *yyssp;
1615 goto yyerrlab1;
1616
1617
1618 /*-------------------------------------------------------------.
1619 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1620 `-------------------------------------------------------------*/
1621 yyerrlab1:
1622 yyerrstatus = 3; /* Each real token shifted decrements this. */
1623
1624 for (;;)
1625 {
1626 yyn = yypact[yystate];
1627 if (yyn != YYPACT_NINF)
1628 {
1629 yyn += YYTERROR;
1630 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1631 {
1632 yyn = yytable[yyn];
1633 if (0 < yyn)
1634 break;
1635 }
1636 }
1637
1638 /* Pop the current state because it cannot handle the error token. */
1639 if (yyssp == yyss)
1640 YYABORT;
1641
1642
1643 yydestruct ("Error: popping",
1644 yystos[yystate], yyvsp);
1645 YYPOPSTACK (1);
1646 yystate = *yyssp;
1647 YY_STACK_PRINT (yyss, yyssp);
1648 }
1649
1650 if (yyn == YYFINAL)
1651 YYACCEPT;
1652
1653 *++yyvsp = yylval;
1654
1655
1656 /* Shift the error token. */
1657 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1658
1659 yystate = yyn;
1660 goto yynewstate;
1661
1662
1663 /*-------------------------------------.
1664 | yyacceptlab -- YYACCEPT comes here. |
1665 `-------------------------------------*/
1666 yyacceptlab:
1667 yyresult = 0;
1668 goto yyreturn;
1669
1670 /*-----------------------------------.
1671 | yyabortlab -- YYABORT comes here. |
1672 `-----------------------------------*/
1673 yyabortlab:
1674 yyresult = 1;
1675 goto yyreturn;
1676
1677 #ifndef yyoverflow
1678 /*-------------------------------------------------.
1679 | yyexhaustedlab -- memory exhaustion comes here. |
1680 `-------------------------------------------------*/
1681 yyexhaustedlab:
1682 yyerror (YY_("memory exhausted"));
1683 yyresult = 2;
1684 /* Fall through. */
1685 #endif
1686
1687 yyreturn:
1688 if (yychar != YYEOF && yychar != YYEMPTY)
1689 yydestruct ("Cleanup: discarding lookahead",
1690 yytoken, &yylval);
1691 /* Do not reclaim the symbols of the rule which action triggered
1692 this YYABORT or YYACCEPT. */
1693 YYPOPSTACK (yylen);
1694 YY_STACK_PRINT (yyss, yyssp);
1695 while (yyssp != yyss)
1696 {
1697 yydestruct ("Cleanup: popping",
1698 yystos[*yyssp], yyvsp);
1699 YYPOPSTACK (1);
1700 }
1701 #ifndef yyoverflow
1702 if (yyss != yyssa)
1703 YYSTACK_FREE (yyss);
1704 #endif
1705 #if YYERROR_VERBOSE
1706 if (yymsg != yymsgbuf)
1707 YYSTACK_FREE (yymsg);
1708 #endif
1709 /* Make sure YYID is used. */
1710 return YYID (yyresult);
1711 }
1712
1713
1714