source: branches/samba-3.5.x/source4/heimdal/lib/hx509/sel-gram.c

Last change on this file was 414, checked in by Herwig Bauernfeind, 16 years ago

Samba 3.5.0: Initial import

File size: 46.1 KB
Line 
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
105
106
107/* Enabling traces. */
108#ifndef YYDEBUG
109# define YYDEBUG 0
110#endif
111
112/* Enabling verbose error messages. */
113#ifdef YYERROR_VERBOSE
114# undef YYERROR_VERBOSE
115# define YYERROR_VERBOSE 1
116#else
117# define YYERROR_VERBOSE 0
118#endif
119
120/* Enabling the token table. */
121#ifndef YYTOKEN_TABLE
122# define YYTOKEN_TABLE 0
123#endif
124
125#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
126typedef union YYSTYPE
127#line 45 "heimdal/lib/hx509/sel-gram.y"
128{
129 char *string;
130 struct hx_expr *expr;
131}
132/* Line 187 of yacc.c. */
133#line 134 "heimdal/lib/hx509/sel-gram.y"
134 YYSTYPE;
135# define yystype YYSTYPE /* obsolescent; will be withdrawn */
136# define YYSTYPE_IS_DECLARED 1
137# define YYSTYPE_IS_TRIVIAL 1
138#endif
139
140
141
142/* Copy the second part of user declarations. */
143
144
145/* Line 216 of yacc.c. */
146#line 147 "heimdal/lib/hx509/sel-gram.y"
147
148#ifdef short
149# undef short
150#endif
151
152#ifdef YYTYPE_UINT8
153typedef YYTYPE_UINT8 yytype_uint8;
154#else
155typedef unsigned char yytype_uint8;
156#endif
157
158#ifdef YYTYPE_INT8
159typedef YYTYPE_INT8 yytype_int8;
160#elif (defined __STDC__ || defined __C99__FUNC__ \
161 || defined __cplusplus || defined _MSC_VER)
162typedef signed char yytype_int8;
163#else
164typedef short int yytype_int8;
165#endif
166
167#ifdef YYTYPE_UINT16
168typedef YYTYPE_UINT16 yytype_uint16;
169#else
170typedef unsigned short int yytype_uint16;
171#endif
172
173#ifdef YYTYPE_INT16
174typedef YYTYPE_INT16 yytype_int16;
175#else
176typedef short int yytype_int16;
177#endif
178
179#ifndef YYSIZE_T
180# ifdef __SIZE_TYPE__
181# define YYSIZE_T __SIZE_TYPE__
182# elif defined size_t
183# define YYSIZE_T size_t
184# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
185 || defined __cplusplus || defined _MSC_VER)
186# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
187# define YYSIZE_T size_t
188# else
189# define YYSIZE_T unsigned int
190# endif
191#endif
192
193#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
194
195#ifndef YY_
196# if YYENABLE_NLS
197# if ENABLE_NLS
198# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
199# define YY_(msgid) dgettext ("bison-runtime", msgid)
200# endif
201# endif
202# ifndef YY_
203# define YY_(msgid) msgid
204# endif
205#endif
206
207/* Suppress unused-variable warnings by "using" E. */
208#if ! defined lint || defined __GNUC__
209# define YYUSE(e) ((void) (e))
210#else
211# define YYUSE(e) /* empty */
212#endif
213
214/* Identity function, used to suppress warnings about constant conditions. */
215#ifndef lint
216# define YYID(n) (n)
217#else
218#if (defined __STDC__ || defined __C99__FUNC__ \
219 || defined __cplusplus || defined _MSC_VER)
220static int
221YYID (int i)
222#else
223static int
224YYID (i)
225 int i;
226#endif
227{
228 return i;
229}
230#endif
231
232#if ! defined yyoverflow || YYERROR_VERBOSE
233
234/* The parser invokes alloca or malloc; define the necessary symbols. */
235
236# ifdef YYSTACK_USE_ALLOCA
237# if YYSTACK_USE_ALLOCA
238# ifdef __GNUC__
239# define YYSTACK_ALLOC __builtin_alloca
240# elif defined __BUILTIN_VA_ARG_INCR
241# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
242# elif defined _AIX
243# define YYSTACK_ALLOC __alloca
244# elif defined _MSC_VER
245# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
246# define alloca _alloca
247# else
248# define YYSTACK_ALLOC alloca
249# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
250 || defined __cplusplus || defined _MSC_VER)
251# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
252# ifndef _STDLIB_H
253# define _STDLIB_H 1
254# endif
255# endif
256# endif
257# endif
258# endif
259
260# ifdef YYSTACK_ALLOC
261 /* Pacify GCC's `empty if-body' warning. */
262# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
263# ifndef YYSTACK_ALLOC_MAXIMUM
264 /* The OS might guarantee only one guard page at the bottom of the stack,
265 and a page size can be as small as 4096 bytes. So we cannot safely
266 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
267 to allow for a few compiler-allocated temporary stack slots. */
268# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
269# endif
270# else
271# define YYSTACK_ALLOC YYMALLOC
272# define YYSTACK_FREE YYFREE
273# ifndef YYSTACK_ALLOC_MAXIMUM
274# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
275# endif
276# if (defined __cplusplus && ! defined _STDLIB_H \
277 && ! ((defined YYMALLOC || defined malloc) \
278 && (defined YYFREE || defined free)))
279# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
280# ifndef _STDLIB_H
281# define _STDLIB_H 1
282# endif
283# endif
284# ifndef YYMALLOC
285# define YYMALLOC malloc
286# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
287 || defined __cplusplus || defined _MSC_VER)
288void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
289# endif
290# endif
291# ifndef YYFREE
292# define YYFREE free
293# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
294 || defined __cplusplus || defined _MSC_VER)
295void free (void *); /* INFRINGES ON USER NAME SPACE */
296# endif
297# endif
298# endif
299#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
300
301
302#if (! defined yyoverflow \
303 && (! defined __cplusplus \
304 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
305
306/* A type that is properly aligned for any stack member. */
307union yyalloc
308{
309 yytype_int16 yyss;
310 YYSTYPE yyvs;
311 };
312
313/* The size of the maximum gap between one aligned stack and the next. */
314# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
315
316/* The size of an array large to enough to hold all stacks, each with
317 N elements. */
318# define YYSTACK_BYTES(N) \
319 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
320 + YYSTACK_GAP_MAXIMUM)
321
322/* Copy COUNT objects from FROM to TO. The source and destination do
323 not overlap. */
324# ifndef YYCOPY
325# if defined __GNUC__ && 1 < __GNUC__
326# define YYCOPY(To, From, Count) \
327 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
328# else
329# define YYCOPY(To, From, Count) \
330 do \
331 { \
332 YYSIZE_T yyi; \
333 for (yyi = 0; yyi < (Count); yyi++) \
334 (To)[yyi] = (From)[yyi]; \
335 } \
336 while (YYID (0))
337# endif
338# endif
339
340/* Relocate STACK from its old location to the new one. The
341 local variables YYSIZE and YYSTACKSIZE give the old and new number of
342 elements in the stack, and YYPTR gives the new location of the
343 stack. Advance YYPTR to a properly aligned location for the next
344 stack. */
345# define YYSTACK_RELOCATE(Stack) \
346 do \
347 { \
348 YYSIZE_T yynewbytes; \
349 YYCOPY (&yyptr->Stack, Stack, yysize); \
350 Stack = &yyptr->Stack; \
351 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
352 yyptr += yynewbytes / sizeof (*yyptr); \
353 } \
354 while (YYID (0))
355
356#endif
357
358/* YYFINAL -- State number of the termination state. */
359#define YYFINAL 21
360/* YYLAST -- Last index in YYTABLE. */
361#define YYLAST 50
362
363/* YYNTOKENS -- Number of terminals. */
364#define YYNTOKENS 21
365/* YYNNTS -- Number of nonterminals. */
366#define YYNNTS 11
367/* YYNRULES -- Number of rules. */
368#define YYNRULES 26
369/* YYNRULES -- Number of states. */
370#define YYNSTATES 50
371
372/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
373#define YYUNDEFTOK 2
374#define YYMAXUTOK 266
375
376#define YYTRANSLATE(YYX) \
377 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
378
379/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
380static const yytype_uint8 yytranslate[] =
381{
382 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
383 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
384 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
385 2, 2, 2, 12, 2, 2, 2, 17, 2, 2,
386 13, 14, 2, 2, 15, 2, 20, 2, 2, 2,
387 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
388 2, 16, 2, 2, 2, 2, 2, 2, 2, 2,
389 2, 2, 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, 18, 2, 19, 2, 2, 2, 2,
395 2, 2, 2, 2, 2, 2, 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, 1, 2, 3, 4,
408 5, 6, 7, 8, 9, 10, 11
409};
410
411#if YYDEBUG
412/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
413 YYRHS. */
414static const yytype_uint8 yyprhs[] =
415{
416 0, 0, 3, 5, 7, 9, 12, 16, 20, 24,
417 26, 28, 32, 37, 42, 46, 52, 56, 58, 60,
418 62, 64, 66, 68, 73, 78, 82
419};
420
421/* YYRHS -- A `-1'-separated list of the rules' RHS. */
422static const yytype_int8 yyrhs[] =
423{
424 22, 0, -1, 23, -1, 3, -1, 4, -1, 12,
425 23, -1, 23, 5, 23, -1, 23, 6, 23, -1,
426 13, 23, 14, -1, 25, -1, 26, -1, 26, 15,
427 24, -1, 26, 16, 16, 26, -1, 26, 12, 16,
428 26, -1, 26, 8, 26, -1, 26, 7, 13, 24,
429 14, -1, 26, 7, 30, -1, 27, -1, 28, -1,
430 29, -1, 30, -1, 9, -1, 10, -1, 11, 13,
431 24, 14, -1, 17, 18, 31, 19, -1, 11, 20,
432 31, -1, 11, -1
433};
434
435/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
436static const yytype_uint8 yyrline[] =
437{
438 0, 73, 73, 75, 76, 77, 78, 79, 80, 81,
439 84, 85, 88, 89, 90, 91, 92, 95, 96, 97,
440 98, 101, 102, 104, 107, 110, 112
441};
442#endif
443
444#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
445/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
446 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
447static const char *const yytname[] =
448{
449 "$end", "error", "$undefined", "kw_TRUE", "kw_FALSE", "kw_AND", "kw_OR",
450 "kw_IN", "kw_TAILMATCH", "NUMBER", "STRING", "IDENTIFIER", "'!'", "'('",
451 "')'", "','", "'='", "'%'", "'{'", "'}'", "'.'", "$accept", "start",
452 "expr", "words", "comp", "word", "number", "string", "function",
453 "variable", "variables", 0
454};
455#endif
456
457# ifdef YYPRINT
458/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
459 token YYLEX-NUM. */
460static const yytype_uint16 yytoknum[] =
461{
462 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
463 265, 266, 33, 40, 41, 44, 61, 37, 123, 125,
464 46
465};
466# endif
467
468/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
469static const yytype_uint8 yyr1[] =
470{
471 0, 21, 22, 23, 23, 23, 23, 23, 23, 23,
472 24, 24, 25, 25, 25, 25, 25, 26, 26, 26,
473 26, 27, 28, 29, 30, 31, 31
474};
475
476/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
477static const yytype_uint8 yyr2[] =
478{
479 0, 2, 1, 1, 1, 2, 3, 3, 3, 1,
480 1, 3, 4, 4, 3, 5, 3, 1, 1, 1,
481 1, 1, 1, 4, 4, 3, 1
482};
483
484/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
485 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
486 means the default is an error. */
487static const yytype_uint8 yydefact[] =
488{
489 0, 3, 4, 21, 22, 0, 0, 0, 0, 0,
490 2, 9, 0, 17, 18, 19, 20, 0, 5, 0,
491 0, 1, 0, 0, 0, 0, 0, 0, 0, 10,
492 8, 26, 0, 6, 7, 0, 16, 14, 0, 0,
493 23, 0, 0, 24, 0, 13, 12, 11, 25, 15
494};
495
496/* YYDEFGOTO[NTERM-NUM]. */
497static const yytype_int8 yydefgoto[] =
498{
499 -1, 9, 10, 28, 11, 12, 13, 14, 15, 16,
500 32
501};
502
503/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
504 STATE-NUM. */
505#define YYPACT_NINF -31
506static const yytype_int8 yypact[] =
507{
508 22, -31, -31, -31, -31, -1, 22, 22, -11, 27,
509 11, -31, -6, -31, -31, -31, -31, 19, 11, 9,
510 26, -31, 22, 22, -4, 19, 24, 25, 28, 23,
511 -31, 29, 31, 11, 11, 19, -31, -31, 19, 19,
512 -31, 19, 26, -31, 30, -31, -31, -31, -31, -31
513};
514
515/* YYPGOTO[NTERM-NUM]. */
516static const yytype_int8 yypgoto[] =
517{
518 -31, -31, -3, -30, -31, -17, -31, -31, -31, 21,
519 1
520};
521
522/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
523 positive, shift that token. If negative, reduce the rule which
524 number is the opposite. If zero, do what YYDEFACT says.
525 If YYTABLE_NINF, syntax error. */
526#define YYTABLE_NINF -1
527static const yytype_uint8 yytable[] =
528{
529 29, 24, 25, 18, 19, 44, 26, 20, 37, 35,
530 27, 47, 17, 8, 22, 23, 22, 23, 29, 33,
531 34, 45, 46, 30, 29, 1, 2, 21, 3, 4,
532 5, 3, 4, 5, 6, 7, 8, 31, 41, 8,
533 38, 39, 40, 48, 49, 36, 0, 0, 0, 42,
534 43
535};
536
537static const yytype_int8 yycheck[] =
538{
539 17, 7, 8, 6, 7, 35, 12, 18, 25, 13,
540 16, 41, 13, 17, 5, 6, 5, 6, 35, 22,
541 23, 38, 39, 14, 41, 3, 4, 0, 9, 10,
542 11, 9, 10, 11, 12, 13, 17, 11, 15, 17,
543 16, 16, 14, 42, 14, 24, -1, -1, -1, 20,
544 19
545};
546
547/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
548 symbol of state STATE-NUM. */
549static const yytype_uint8 yystos[] =
550{
551 0, 3, 4, 9, 10, 11, 12, 13, 17, 22,
552 23, 25, 26, 27, 28, 29, 30, 13, 23, 23,
553 18, 0, 5, 6, 7, 8, 12, 16, 24, 26,
554 14, 11, 31, 23, 23, 13, 30, 26, 16, 16,
555 14, 15, 20, 19, 24, 26, 26, 24, 31, 14
556};
557
558#define yyerrok (yyerrstatus = 0)
559#define yyclearin (yychar = YYEMPTY)
560#define YYEMPTY (-2)
561#define YYEOF 0
562
563#define YYACCEPT goto yyacceptlab
564#define YYABORT goto yyabortlab
565#define YYERROR goto yyerrorlab
566
567
568/* Like YYERROR except do call yyerror. This remains here temporarily
569 to ease the transition to the new meaning of YYERROR, for GCC.
570 Once GCC version 2 has supplanted version 1, this can go. */
571
572#define YYFAIL goto yyerrlab
573
574#define YYRECOVERING() (!!yyerrstatus)
575
576#define YYBACKUP(Token, Value) \
577do \
578 if (yychar == YYEMPTY && yylen == 1) \
579 { \
580 yychar = (Token); \
581 yylval = (Value); \
582 yytoken = YYTRANSLATE (yychar); \
583 YYPOPSTACK (1); \
584 goto yybackup; \
585 } \
586 else \
587 { \
588 yyerror (YY_("syntax error: cannot back up")); \
589 YYERROR; \
590 } \
591while (YYID (0))
592
593
594#define YYTERROR 1
595#define YYERRCODE 256
596
597
598/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
599 If N is 0, then set CURRENT to the empty location which ends
600 the previous symbol: RHS[0] (always defined). */
601
602#define YYRHSLOC(Rhs, K) ((Rhs)[K])
603#ifndef YYLLOC_DEFAULT
604# define YYLLOC_DEFAULT(Current, Rhs, N) \
605 do \
606 if (YYID (N)) \
607 { \
608 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
609 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
610 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
611 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
612 } \
613 else \
614 { \
615 (Current).first_line = (Current).last_line = \
616 YYRHSLOC (Rhs, 0).last_line; \
617 (Current).first_column = (Current).last_column = \
618 YYRHSLOC (Rhs, 0).last_column; \
619 } \
620 while (YYID (0))
621#endif
622
623
624/* YY_LOCATION_PRINT -- Print the location on the stream.
625 This macro was not mandated originally: define only if we know
626 we won't break user code: when these are the locations we know. */
627
628#ifndef YY_LOCATION_PRINT
629# if YYLTYPE_IS_TRIVIAL
630# define YY_LOCATION_PRINT(File, Loc) \
631 fprintf (File, "%d.%d-%d.%d", \
632 (Loc).first_line, (Loc).first_column, \
633 (Loc).last_line, (Loc).last_column)
634# else
635# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
636# endif
637#endif
638
639
640/* YYLEX -- calling `yylex' with the right arguments. */
641
642#ifdef YYLEX_PARAM
643# define YYLEX yylex (YYLEX_PARAM)
644#else
645# define YYLEX yylex ()
646#endif
647
648/* Enable debugging if requested. */
649#if YYDEBUG
650
651# ifndef YYFPRINTF
652# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
653# define YYFPRINTF fprintf
654# endif
655
656# define YYDPRINTF(Args) \
657do { \
658 if (yydebug) \
659 YYFPRINTF Args; \
660} while (YYID (0))
661
662# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
663do { \
664 if (yydebug) \
665 { \
666 YYFPRINTF (stderr, "%s ", Title); \
667 yy_symbol_print (stderr, \
668 Type, Value); \
669 YYFPRINTF (stderr, "\n"); \
670 } \
671} while (YYID (0))
672
673
674/*--------------------------------.
675| Print this symbol on YYOUTPUT. |
676`--------------------------------*/
677
678/*ARGSUSED*/
679#if (defined __STDC__ || defined __C99__FUNC__ \
680 || defined __cplusplus || defined _MSC_VER)
681static void
682yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
683#else
684static void
685yy_symbol_value_print (yyoutput, yytype, yyvaluep)
686 FILE *yyoutput;
687 int yytype;
688 YYSTYPE const * const yyvaluep;
689#endif
690{
691 if (!yyvaluep)
692 return;
693# ifdef YYPRINT
694 if (yytype < YYNTOKENS)
695 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
696# else
697 YYUSE (yyoutput);
698# endif
699 switch (yytype)
700 {
701 default:
702 break;
703 }
704}
705
706
707/*--------------------------------.
708| Print this symbol on YYOUTPUT. |
709`--------------------------------*/
710
711#if (defined __STDC__ || defined __C99__FUNC__ \
712 || defined __cplusplus || defined _MSC_VER)
713static void
714yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
715#else
716static void
717yy_symbol_print (yyoutput, yytype, yyvaluep)
718 FILE *yyoutput;
719 int yytype;
720 YYSTYPE const * const yyvaluep;
721#endif
722{
723 if (yytype < YYNTOKENS)
724 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
725 else
726 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
727
728 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
729 YYFPRINTF (yyoutput, ")");
730}
731
732/*------------------------------------------------------------------.
733| yy_stack_print -- Print the state stack from its BOTTOM up to its |
734| TOP (included). |
735`------------------------------------------------------------------*/
736
737#if (defined __STDC__ || defined __C99__FUNC__ \
738 || defined __cplusplus || defined _MSC_VER)
739static void
740yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
741#else
742static void
743yy_stack_print (bottom, top)
744 yytype_int16 *bottom;
745 yytype_int16 *top;
746#endif
747{
748 YYFPRINTF (stderr, "Stack now");
749 for (; bottom <= top; ++bottom)
750 YYFPRINTF (stderr, " %d", *bottom);
751 YYFPRINTF (stderr, "\n");
752}
753
754# define YY_STACK_PRINT(Bottom, Top) \
755do { \
756 if (yydebug) \
757 yy_stack_print ((Bottom), (Top)); \
758} while (YYID (0))
759
760
761/*------------------------------------------------.
762| Report that the YYRULE is going to be reduced. |
763`------------------------------------------------*/
764
765#if (defined __STDC__ || defined __C99__FUNC__ \
766 || defined __cplusplus || defined _MSC_VER)
767static void
768yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
769#else
770static void
771yy_reduce_print (yyvsp, yyrule)
772 YYSTYPE *yyvsp;
773 int yyrule;
774#endif
775{
776 int yynrhs = yyr2[yyrule];
777 int yyi;
778 unsigned long int yylno = yyrline[yyrule];
779 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
780 yyrule - 1, yylno);
781 /* The symbols being reduced. */
782 for (yyi = 0; yyi < yynrhs; yyi++)
783 {
784 fprintf (stderr, " $%d = ", yyi + 1);
785 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
786 &(yyvsp[(yyi + 1) - (yynrhs)])
787 );
788 fprintf (stderr, "\n");
789 }
790}
791
792# define YY_REDUCE_PRINT(Rule) \
793do { \
794 if (yydebug) \
795 yy_reduce_print (yyvsp, Rule); \
796} while (YYID (0))
797
798/* Nonzero means print parse trace. It is left uninitialized so that
799 multiple parsers can coexist. */
800int yydebug;
801#else /* !YYDEBUG */
802# define YYDPRINTF(Args)
803# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
804# define YY_STACK_PRINT(Bottom, Top)
805# define YY_REDUCE_PRINT(Rule)
806#endif /* !YYDEBUG */
807
808
809/* YYINITDEPTH -- initial size of the parser's stacks. */
810#ifndef YYINITDEPTH
811# define YYINITDEPTH 200
812#endif
813
814/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
815 if the built-in stack extension method is used).
816
817 Do not make this value too large; the results are undefined if
818 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
819 evaluated with infinite-precision integer arithmetic. */
820
821#ifndef YYMAXDEPTH
822# define YYMAXDEPTH 10000
823#endif
824
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)
837static YYSIZE_T
838yystrlen (const char *yystr)
839#else
840static YYSIZE_T
841yystrlen (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)
861static char *
862yystpcpy (char *yydest, const char *yysrc)
863#else
864static char *
865yystpcpy (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. */
889static YYSIZE_T
890yytnamerr (char *yyres, const char *yystr)
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. */
936static YYSIZE_T
937yysyntax_error (char *yyresult, int yystate, int yychar)
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/*-----------------------------------------------.
1041| Release the memory associated to this symbol. |
1042`-----------------------------------------------*/
1043
1044/*ARGSUSED*/
1045#if (defined __STDC__ || defined __C99__FUNC__ \
1046 || defined __cplusplus || defined _MSC_VER)
1047static void
1048yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1049#else
1050static void
1051yydestruct (yymsg, yytype, yyvaluep)
1052 const char *yymsg;
1053 int yytype;
1054 YYSTYPE *yyvaluep;
1055#endif
1056{
1057 YYUSE (yyvaluep);
1058
1059 if (!yymsg)
1060 yymsg = "Deleting";
1061 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1062
1063 switch (yytype)
1064 {
1065
1066 default:
1067 break;
1068 }
1069}
1070
1071
1072
1073/* Prevent warnings from -Wmissing-prototypes. */
1074
1075#ifdef YYPARSE_PARAM
1076#if defined __STDC__ || defined __cplusplus
1077int yyparse (void *YYPARSE_PARAM);
1078#else
1079int yyparse ();
1080#endif
1081#else /* ! YYPARSE_PARAM */
1082#if defined __STDC__ || defined __cplusplus
1083int yyparse (void);
1084#else
1085int yyparse ();
1086#endif
1087#endif /* ! YYPARSE_PARAM */
1088
1089
1090
1091/* The look-ahead symbol. */
1092int yychar;
1093
1094/* The semantic value of the look-ahead symbol. */
1095YYSTYPE yylval;
1096
1097/* Number of syntax errors so far. */
1098int yynerrs;
1099
1100
1101
1102/*----------.
1103| yyparse. |
1104`----------*/
1105
1106#ifdef YYPARSE_PARAM
1107#if (defined __STDC__ || defined __C99__FUNC__ \
1108 || defined __cplusplus || defined _MSC_VER)
1109int
1110yyparse (void *YYPARSE_PARAM)
1111#else
1112int
1113yyparse (YYPARSE_PARAM)
1114 void *YYPARSE_PARAM;
1115#endif
1116#else /* ! YYPARSE_PARAM */
1117#if (defined __STDC__ || defined __C99__FUNC__ \
1118 || defined __cplusplus || defined _MSC_VER)
1119int
1120yyparse (void)
1121#else
1122int
1123yyparse ()
1124
1125#endif
1126#endif
1127{
1128
1129 int yystate;
1130 int yyn;
1131 int yyresult;
1132 /* Number of tokens to shift before error messages enabled. */
1133 int yyerrstatus;
1134 /* Look-ahead token as an internal (translated) token number. */
1135 int yytoken = 0;
1136#if YYERROR_VERBOSE
1137 /* Buffer for error messages, and its allocated size. */
1138 char yymsgbuf[128];
1139 char *yymsg = yymsgbuf;
1140 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1141#endif
1142
1143 /* Three stacks and their tools:
1144 `yyss': related to states,
1145 `yyvs': related to semantic values,
1146 `yyls': related to locations.
1147
1148 Refer to the stacks thru separate pointers, to allow yyoverflow
1149 to reallocate them elsewhere. */
1150
1151 /* The state stack. */
1152 yytype_int16 yyssa[YYINITDEPTH];
1153 yytype_int16 *yyss = yyssa;
1154 yytype_int16 *yyssp;
1155
1156 /* The semantic value stack. */
1157 YYSTYPE yyvsa[YYINITDEPTH];
1158 YYSTYPE *yyvs = yyvsa;
1159 YYSTYPE *yyvsp;
1160
1161
1162
1163#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1164
1165 YYSIZE_T yystacksize = YYINITDEPTH;
1166
1167 /* The variables used to return semantic value and location from the
1168 action routines. */
1169 YYSTYPE yyval;
1170
1171
1172 /* The number of symbols on the RHS of the reduced rule.
1173 Keep to zero when no symbol should be popped. */
1174 int yylen = 0;
1175
1176 YYDPRINTF ((stderr, "Starting parse\n"));
1177
1178 yystate = 0;
1179 yyerrstatus = 0;
1180 yynerrs = 0;
1181 yychar = YYEMPTY; /* Cause a token to be read. */
1182
1183 /* Initialize stack pointers.
1184 Waste one element of value and location stack
1185 so that they stay on the same level as the state stack.
1186 The wasted elements are never initialized. */
1187
1188 yyssp = yyss;
1189 yyvsp = yyvs;
1190
1191 goto yysetstate;
1192
1193/*------------------------------------------------------------.
1194| yynewstate -- Push a new state, which is found in yystate. |
1195`------------------------------------------------------------*/
1196 yynewstate:
1197 /* In all cases, when you get here, the value and location stacks
1198 have just been pushed. So pushing a state here evens the stacks. */
1199 yyssp++;
1200
1201 yysetstate:
1202 *yyssp = yystate;
1203
1204 if (yyss + yystacksize - 1 <= yyssp)
1205 {
1206 /* Get the current used size of the three stacks, in elements. */
1207 YYSIZE_T yysize = yyssp - yyss + 1;
1208
1209#ifdef yyoverflow
1210 {
1211 /* Give user a chance to reallocate the stack. Use copies of
1212 these so that the &'s don't force the real ones into
1213 memory. */
1214 YYSTYPE *yyvs1 = yyvs;
1215 yytype_int16 *yyss1 = yyss;
1216
1217
1218 /* Each stack pointer address is followed by the size of the
1219 data in use in that stack, in bytes. This used to be a
1220 conditional around just the two extra args, but that might
1221 be undefined if yyoverflow is a macro. */
1222 yyoverflow (YY_("memory exhausted"),
1223 &yyss1, yysize * sizeof (*yyssp),
1224 &yyvs1, yysize * sizeof (*yyvsp),
1225
1226 &yystacksize);
1227
1228 yyss = yyss1;
1229 yyvs = yyvs1;
1230 }
1231#else /* no yyoverflow */
1232# ifndef YYSTACK_RELOCATE
1233 goto yyexhaustedlab;
1234# else
1235 /* Extend the stack our own way. */
1236 if (YYMAXDEPTH <= yystacksize)
1237 goto yyexhaustedlab;
1238 yystacksize *= 2;
1239 if (YYMAXDEPTH < yystacksize)
1240 yystacksize = YYMAXDEPTH;
1241
1242 {
1243 yytype_int16 *yyss1 = yyss;
1244 union yyalloc *yyptr =
1245 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1246 if (! yyptr)
1247 goto yyexhaustedlab;
1248 YYSTACK_RELOCATE (yyss);
1249 YYSTACK_RELOCATE (yyvs);
1250
1251# undef YYSTACK_RELOCATE
1252 if (yyss1 != yyssa)
1253 YYSTACK_FREE (yyss1);
1254 }
1255# endif
1256#endif /* no yyoverflow */
1257
1258 yyssp = yyss + yysize - 1;
1259 yyvsp = yyvs + yysize - 1;
1260
1261
1262 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1263 (unsigned long int) yystacksize));
1264
1265 if (yyss + yystacksize - 1 <= yyssp)
1266 YYABORT;
1267 }
1268
1269 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1270
1271 goto yybackup;
1272
1273/*-----------.
1274| yybackup. |
1275`-----------*/
1276yybackup:
1277
1278 /* Do appropriate processing given the current state. Read a
1279 look-ahead token if we need one and don't already have one. */
1280
1281 /* First try to decide what to do without reference to look-ahead token. */
1282 yyn = yypact[yystate];
1283 if (yyn == YYPACT_NINF)
1284 goto yydefault;
1285
1286 /* Not known => get a look-ahead token if don't already have one. */
1287
1288 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1289 if (yychar == YYEMPTY)
1290 {
1291 YYDPRINTF ((stderr, "Reading a token: "));
1292 yychar = YYLEX;
1293 }
1294
1295 if (yychar <= YYEOF)
1296 {
1297 yychar = yytoken = YYEOF;
1298 YYDPRINTF ((stderr, "Now at end of input.\n"));
1299 }
1300 else
1301 {
1302 yytoken = YYTRANSLATE (yychar);
1303 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1304 }
1305
1306 /* If the proper action on seeing token YYTOKEN is to reduce or to
1307 detect an error, take that action. */
1308 yyn += yytoken;
1309 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1310 goto yydefault;
1311 yyn = yytable[yyn];
1312 if (yyn <= 0)
1313 {
1314 if (yyn == 0 || yyn == YYTABLE_NINF)
1315 goto yyerrlab;
1316 yyn = -yyn;
1317 goto yyreduce;
1318 }
1319
1320 if (yyn == YYFINAL)
1321 YYACCEPT;
1322
1323 /* Count tokens shifted since error; after three, turn off error
1324 status. */
1325 if (yyerrstatus)
1326 yyerrstatus--;
1327
1328 /* Shift the look-ahead token. */
1329 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1330
1331 /* Discard the shifted token unless it is eof. */
1332 if (yychar != YYEOF)
1333 yychar = YYEMPTY;
1334
1335 yystate = yyn;
1336 *++yyvsp = yylval;
1337
1338 goto yynewstate;
1339
1340
1341/*-----------------------------------------------------------.
1342| yydefault -- do the default action for the current state. |
1343`-----------------------------------------------------------*/
1344yydefault:
1345 yyn = yydefact[yystate];
1346 if (yyn == 0)
1347 goto yyerrlab;
1348 goto yyreduce;
1349
1350
1351/*-----------------------------.
1352| yyreduce -- Do a reduction. |
1353`-----------------------------*/
1354yyreduce:
1355 /* yyn is the number of a rule to reduce with. */
1356 yylen = yyr2[yyn];
1357
1358 /* If YYLEN is nonzero, implement the default value of the action:
1359 `$$ = $1'.
1360
1361 Otherwise, the following line sets YYVAL to garbage.
1362 This behavior is undocumented and Bison
1363 users should not rely upon it. Assigning to YYVAL
1364 unconditionally makes the parser a bit smaller, and it avoids a
1365 GCC warning that YYVAL may be used uninitialized. */
1366 yyval = yyvsp[1-yylen];
1367
1368
1369 YY_REDUCE_PRINT (yyn);
1370 switch (yyn)
1371 {
1372 case 2:
1373#line 73 "heimdal/lib/hx509/sel-gram.y"
1374 { _hx509_expr_input.expr = (yyvsp[(1) - (1)].expr); }
1375 break;
1376
1377 case 3:
1378#line 75 "heimdal/lib/hx509/sel-gram.y"
1379 { (yyval.expr) = _hx509_make_expr(op_TRUE, NULL, NULL); }
1380 break;
1381
1382 case 4:
1383#line 76 "heimdal/lib/hx509/sel-gram.y"
1384 { (yyval.expr) = _hx509_make_expr(op_FALSE, NULL, NULL); }
1385 break;
1386
1387 case 5:
1388#line 77 "heimdal/lib/hx509/sel-gram.y"
1389 { (yyval.expr) = _hx509_make_expr(op_NOT, (yyvsp[(2) - (2)].expr), NULL); }
1390 break;
1391
1392 case 6:
1393#line 78 "heimdal/lib/hx509/sel-gram.y"
1394 { (yyval.expr) = _hx509_make_expr(op_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
1395 break;
1396
1397 case 7:
1398#line 79 "heimdal/lib/hx509/sel-gram.y"
1399 { (yyval.expr) = _hx509_make_expr(op_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
1400 break;
1401
1402 case 8:
1403#line 80 "heimdal/lib/hx509/sel-gram.y"
1404 { (yyval.expr) = (yyvsp[(2) - (3)].expr); }
1405 break;
1406
1407 case 9:
1408#line 81 "heimdal/lib/hx509/sel-gram.y"
1409 { (yyval.expr) = _hx509_make_expr(op_COMP, (yyvsp[(1) - (1)].expr), NULL); }
1410 break;
1411
1412 case 10:
1413#line 84 "heimdal/lib/hx509/sel-gram.y"
1414 { (yyval.expr) = _hx509_make_expr(expr_WORDS, (yyvsp[(1) - (1)].expr), NULL); }
1415 break;
1416
1417 case 11:
1418#line 85 "heimdal/lib/hx509/sel-gram.y"
1419 { (yyval.expr) = _hx509_make_expr(expr_WORDS, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
1420 break;
1421
1422 case 12:
1423#line 88 "heimdal/lib/hx509/sel-gram.y"
1424 { (yyval.expr) = _hx509_make_expr(comp_EQ, (yyvsp[(1) - (4)].expr), (yyvsp[(4) - (4)].expr)); }
1425 break;
1426
1427 case 13:
1428#line 89 "heimdal/lib/hx509/sel-gram.y"
1429 { (yyval.expr) = _hx509_make_expr(comp_NE, (yyvsp[(1) - (4)].expr), (yyvsp[(4) - (4)].expr)); }
1430 break;
1431
1432 case 14:
1433#line 90 "heimdal/lib/hx509/sel-gram.y"
1434 { (yyval.expr) = _hx509_make_expr(comp_TAILEQ, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
1435 break;
1436
1437 case 15:
1438#line 91 "heimdal/lib/hx509/sel-gram.y"
1439 { (yyval.expr) = _hx509_make_expr(comp_IN, (yyvsp[(1) - (5)].expr), (yyvsp[(4) - (5)].expr)); }
1440 break;
1441
1442 case 16:
1443#line 92 "heimdal/lib/hx509/sel-gram.y"
1444 { (yyval.expr) = _hx509_make_expr(comp_IN, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
1445 break;
1446
1447 case 17:
1448#line 95 "heimdal/lib/hx509/sel-gram.y"
1449 { (yyval.expr) = (yyvsp[(1) - (1)].expr); }
1450 break;
1451
1452 case 18:
1453#line 96 "heimdal/lib/hx509/sel-gram.y"
1454 { (yyval.expr) = (yyvsp[(1) - (1)].expr); }
1455 break;
1456
1457 case 19:
1458#line 97 "heimdal/lib/hx509/sel-gram.y"
1459 { (yyval.expr) = (yyvsp[(1) - (1)].expr); }
1460 break;
1461
1462 case 20:
1463#line 98 "heimdal/lib/hx509/sel-gram.y"
1464 { (yyval.expr) = (yyvsp[(1) - (1)].expr); }
1465 break;
1466
1467 case 21:
1468#line 101 "heimdal/lib/hx509/sel-gram.y"
1469 { (yyval.expr) = _hx509_make_expr(expr_NUMBER, (yyvsp[(1) - (1)].string), NULL); }
1470 break;
1471
1472 case 22:
1473#line 102 "heimdal/lib/hx509/sel-gram.y"
1474 { (yyval.expr) = _hx509_make_expr(expr_STRING, (yyvsp[(1) - (1)].string), NULL); }
1475 break;
1476
1477 case 23:
1478#line 104 "heimdal/lib/hx509/sel-gram.y"
1479 {
1480 (yyval.expr) = _hx509_make_expr(expr_FUNCTION, (yyvsp[(1) - (4)].string), (yyvsp[(3) - (4)].expr)); }
1481 break;
1482
1483 case 24:
1484#line 107 "heimdal/lib/hx509/sel-gram.y"
1485 { (yyval.expr) = (yyvsp[(3) - (4)].expr); }
1486 break;
1487
1488 case 25:
1489#line 110 "heimdal/lib/hx509/sel-gram.y"
1490 {
1491 (yyval.expr) = _hx509_make_expr(expr_VAR, (yyvsp[(1) - (3)].string), (yyvsp[(3) - (3)].expr)); }
1492 break;
1493
1494 case 26:
1495#line 112 "heimdal/lib/hx509/sel-gram.y"
1496 {
1497 (yyval.expr) = _hx509_make_expr(expr_VAR, (yyvsp[(1) - (1)].string), NULL); }
1498 break;
1499
1500
1501/* Line 1267 of yacc.c. */
1502#line 1500 "heimdal/lib/hx509/sel-gram.y"
1503 default: break;
1504 }
1505 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1506
1507 YYPOPSTACK (yylen);
1508 yylen = 0;
1509 YY_STACK_PRINT (yyss, yyssp);
1510
1511 *++yyvsp = yyval;
1512
1513
1514 /* Now `shift' the result of the reduction. Determine what state
1515 that goes to, based on the state we popped back to and the rule
1516 number reduced by. */
1517
1518 yyn = yyr1[yyn];
1519
1520 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1521 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1522 yystate = yytable[yystate];
1523 else
1524 yystate = yydefgoto[yyn - YYNTOKENS];
1525
1526 goto yynewstate;
1527
1528
1529/*------------------------------------.
1530| yyerrlab -- here on detecting error |
1531`------------------------------------*/
1532yyerrlab:
1533 /* If not already recovering from an error, report this error. */
1534 if (!yyerrstatus)
1535 {
1536 ++yynerrs;
1537#if ! YYERROR_VERBOSE
1538 yyerror (YY_("syntax error"));
1539#else
1540 {
1541 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1542 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1543 {
1544 YYSIZE_T yyalloc = 2 * yysize;
1545 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1546 yyalloc = YYSTACK_ALLOC_MAXIMUM;
1547 if (yymsg != yymsgbuf)
1548 YYSTACK_FREE (yymsg);
1549 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1550 if (yymsg)
1551 yymsg_alloc = yyalloc;
1552 else
1553 {
1554 yymsg = yymsgbuf;
1555 yymsg_alloc = sizeof yymsgbuf;
1556 }
1557 }
1558
1559 if (0 < yysize && yysize <= yymsg_alloc)
1560 {
1561 (void) yysyntax_error (yymsg, yystate, yychar);
1562 yyerror (yymsg);
1563 }
1564 else
1565 {
1566 yyerror (YY_("syntax error"));
1567 if (yysize != 0)
1568 goto yyexhaustedlab;
1569 }
1570 }
1571#endif
1572 }
1573
1574
1575
1576 if (yyerrstatus == 3)
1577 {
1578 /* If just tried and failed to reuse look-ahead token after an
1579 error, discard it. */
1580
1581 if (yychar <= YYEOF)
1582 {
1583 /* Return failure if at end of input. */
1584 if (yychar == YYEOF)
1585 YYABORT;
1586 }
1587 else
1588 {
1589 yydestruct ("Error: discarding",
1590 yytoken, &yylval);
1591 yychar = YYEMPTY;
1592 }
1593 }
1594
1595 /* Else will try to reuse look-ahead token after shifting the error
1596 token. */
1597 goto yyerrlab1;
1598
1599
1600/*---------------------------------------------------.
1601| yyerrorlab -- error raised explicitly by YYERROR. |
1602`---------------------------------------------------*/
1603yyerrorlab:
1604
1605 /* Pacify compilers like GCC when the user code never invokes
1606 YYERROR and the label yyerrorlab therefore never appears in user
1607 code. */
1608 if (/*CONSTCOND*/ 0)
1609 goto yyerrorlab;
1610
1611 /* Do not reclaim the symbols of the rule which action triggered
1612 this YYERROR. */
1613 YYPOPSTACK (yylen);
1614 yylen = 0;
1615 YY_STACK_PRINT (yyss, yyssp);
1616 yystate = *yyssp;
1617 goto yyerrlab1;
1618
1619
1620/*-------------------------------------------------------------.
1621| yyerrlab1 -- common code for both syntax error and YYERROR. |
1622`-------------------------------------------------------------*/
1623yyerrlab1:
1624 yyerrstatus = 3; /* Each real token shifted decrements this. */
1625
1626 for (;;)
1627 {
1628 yyn = yypact[yystate];
1629 if (yyn != YYPACT_NINF)
1630 {
1631 yyn += YYTERROR;
1632 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1633 {
1634 yyn = yytable[yyn];
1635 if (0 < yyn)
1636 break;
1637 }
1638 }
1639
1640 /* Pop the current state because it cannot handle the error token. */
1641 if (yyssp == yyss)
1642 YYABORT;
1643
1644
1645 yydestruct ("Error: popping",
1646 yystos[yystate], yyvsp);
1647 YYPOPSTACK (1);
1648 yystate = *yyssp;
1649 YY_STACK_PRINT (yyss, yyssp);
1650 }
1651
1652 if (yyn == YYFINAL)
1653 YYACCEPT;
1654
1655 *++yyvsp = yylval;
1656
1657
1658 /* Shift the error token. */
1659 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1660
1661 yystate = yyn;
1662 goto yynewstate;
1663
1664
1665/*-------------------------------------.
1666| yyacceptlab -- YYACCEPT comes here. |
1667`-------------------------------------*/
1668yyacceptlab:
1669 yyresult = 0;
1670 goto yyreturn;
1671
1672/*-----------------------------------.
1673| yyabortlab -- YYABORT comes here. |
1674`-----------------------------------*/
1675yyabortlab:
1676 yyresult = 1;
1677 goto yyreturn;
1678
1679#ifndef yyoverflow
1680/*-------------------------------------------------.
1681| yyexhaustedlab -- memory exhaustion comes here. |
1682`-------------------------------------------------*/
1683yyexhaustedlab:
1684 yyerror (YY_("memory exhausted"));
1685 yyresult = 2;
1686 /* Fall through. */
1687#endif
1688
1689yyreturn:
1690 if (yychar != YYEOF && yychar != YYEMPTY)
1691 yydestruct ("Cleanup: discarding lookahead",
1692 yytoken, &yylval);
1693 /* Do not reclaim the symbols of the rule which action triggered
1694 this YYABORT or YYACCEPT. */
1695 YYPOPSTACK (yylen);
1696 YY_STACK_PRINT (yyss, yyssp);
1697 while (yyssp != yyss)
1698 {
1699 yydestruct ("Cleanup: popping",
1700 yystos[*yyssp], yyvsp);
1701 YYPOPSTACK (1);
1702 }
1703#ifndef yyoverflow
1704 if (yyss != yyssa)
1705 YYSTACK_FREE (yyss);
1706#endif
1707#if YYERROR_VERBOSE
1708 if (yymsg != yymsgbuf)
1709 YYSTACK_FREE (yymsg);
1710#endif
1711 /* Make sure YYID is used. */
1712 return YYID (yyresult);
1713}
1714
1715
1716
Note: See TracBrowser for help on using the repository browser.