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#if YYERROR_VERBOSE 828 829# ifndef yystrlen 830# if defined __GLIBC__ && defined _STRING_H 831# define yystrlen strlen 832# else 833/* Return the length of YYSTR. */ 834#if (defined __STDC__ || defined __C99__FUNC__ \ 835 || defined __cplusplus || defined _MSC_VER) 836static YYSIZE_T 837yystrlen (const char *yystr) 838#else 839static YYSIZE_T 840yystrlen (yystr) 841 const char *yystr; 842#endif 843{ 844 YYSIZE_T yylen; 845 for (yylen = 0; yystr[yylen]; yylen++) 846 continue; 847 return yylen; 848} 849# endif 850# endif 851 852# ifndef yystpcpy 853# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 854# define yystpcpy stpcpy 855# else 856/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 857 YYDEST. */ 858#if (defined __STDC__ || defined __C99__FUNC__ \ 859 || defined __cplusplus || defined _MSC_VER) 860static char * 861yystpcpy (char *yydest, const char *yysrc) 862#else 863static char * 864yystpcpy (yydest, yysrc) 865 char *yydest; 866 const char *yysrc; 867#endif 868{ 869 char *yyd = yydest; 870 const char *yys = yysrc; 871 872 while ((*yyd++ = *yys++) != '\0') 873 continue; 874 875 return yyd - 1; 876} 877# endif 878# endif 879 880# ifndef yytnamerr 881/* Copy to YYRES the contents of YYSTR after stripping away unnecessary 882 quotes and backslashes, so that it's suitable for yyerror. The 883 heuristic is that double-quoting is unnecessary unless the string 884 contains an apostrophe, a comma, or backslash (other than 885 backslash-backslash). YYSTR is taken from yytname. If YYRES is 886 null, do not copy; instead, return the length of what the result 887 would have been. */ 888static YYSIZE_T 889yytnamerr (char *yyres, const char *yystr) 890{ 891 if (*yystr == '"') 892 { 893 YYSIZE_T yyn = 0; 894 char const *yyp = yystr; 895 896 for (;;) 897 switch (*++yyp) 898 { 899 case '\'': 900 case ',': 901 goto do_not_strip_quotes; 902 903 case '\\': 904 if (*++yyp != '\\') 905 goto do_not_strip_quotes; 906 /* Fall through. */ 907 default: 908 if (yyres) 909 yyres[yyn] = *yyp; 910 yyn++; 911 break; 912 913 case '"': 914 if (yyres) 915 yyres[yyn] = '\0'; 916 return yyn; 917 } 918 do_not_strip_quotes: ; 919 } 920 921 if (! yyres) 922 return yystrlen (yystr); 923 924 return yystpcpy (yyres, yystr) - yyres; 925} 926# endif 927 928/* Copy into YYRESULT an error message about the unexpected token 929 YYCHAR while in state YYSTATE. Return the number of bytes copied, 930 including the terminating null byte. If YYRESULT is null, do not 931 copy anything; just return the number of bytes that would be 932 copied. As a special case, return 0 if an ordinary "syntax error" 933 message will do. Return YYSIZE_MAXIMUM if overflow occurs during 934 size calculation. */ 935static YYSIZE_T 936yysyntax_error (char *yyresult, int yystate, int yychar) 937{ 938 int yyn = yypact[yystate]; 939 940 if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) 941 return 0; 942 else 943 { 944 int yytype = YYTRANSLATE (yychar); 945 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); 946 YYSIZE_T yysize = yysize0; 947 YYSIZE_T yysize1; 948 int yysize_overflow = 0; 949 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 950 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 951 int yyx; 952 953# if 0 954 /* This is so xgettext sees the translatable formats that are 955 constructed on the fly. */ 956 YY_("syntax error, unexpected %s"); 957 YY_("syntax error, unexpected %s, expecting %s"); 958 YY_("syntax error, unexpected %s, expecting %s or %s"); 959 YY_("syntax error, unexpected %s, expecting %s or %s or %s"); 960 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); 961# endif 962 char *yyfmt; 963 char const *yyf; 964 static char const yyunexpected[] = "syntax error, unexpected %s"; 965 static char const yyexpecting[] = ", expecting %s"; 966 static char const yyor[] = " or %s"; 967 char yyformat[sizeof yyunexpected 968 + sizeof yyexpecting - 1 969 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) 970 * (sizeof yyor - 1))]; 971 char const *yyprefix = yyexpecting; 972 973 /* Start YYX at -YYN if negative to avoid negative indexes in 974 YYCHECK. */ 975 int yyxbegin = yyn < 0 ? -yyn : 0; 976 977 /* Stay within bounds of both yycheck and yytname. */ 978 int yychecklim = YYLAST - yyn + 1; 979 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 980 int yycount = 1; 981 982 yyarg[0] = yytname[yytype]; 983 yyfmt = yystpcpy (yyformat, yyunexpected); 984 985 for (yyx = yyxbegin; yyx < yyxend; ++yyx) 986 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) 987 { 988 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 989 { 990 yycount = 1; 991 yysize = yysize0; 992 yyformat[sizeof yyunexpected - 1] = '\0'; 993 break; 994 } 995 yyarg[yycount++] = yytname[yyx]; 996 yysize1 = yysize + yytnamerr (0, yytname[yyx]); 997 yysize_overflow |= (yysize1 < yysize); 998 yysize = yysize1; 999 yyfmt = yystpcpy (yyfmt, yyprefix); 1000 yyprefix = yyor; 1001 } 1002 1003 yyf = YY_(yyformat); 1004 yysize1 = yysize + yystrlen (yyf); 1005 yysize_overflow |= (yysize1 < yysize); 1006 yysize = yysize1; 1007 1008 if (yysize_overflow) 1009 return YYSIZE_MAXIMUM; 1010 1011 if (yyresult) 1012 { 1013 /* Avoid sprintf, as that infringes on the user's name space. 1014 Don't have undefined behavior even if the translation 1015 produced a string with the wrong number of "%s"s. */ 1016 char *yyp = yyresult; 1017 int yyi = 0; 1018 while ((*yyp = *yyf) != '\0') 1019 { 1020 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) 1021 { 1022 yyp += yytnamerr (yyp, yyarg[yyi++]); 1023 yyf += 2; 1024 } 1025 else 1026 { 1027 yyp++; 1028 yyf++; 1029 } 1030 } 1031 } 1032 return yysize; 1033 } 1034} 1035#endif /* YYERROR_VERBOSE */ 1036 1037 1038/*-----------------------------------------------. 1039| Release the memory associated to this symbol. | 1040`-----------------------------------------------*/ 1041 1042/*ARGSUSED*/ 1043#if (defined __STDC__ || defined __C99__FUNC__ \ 1044 || defined __cplusplus || defined _MSC_VER) 1045static void 1046yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 1047#else 1048static void 1049yydestruct (yymsg, yytype, yyvaluep) 1050 const char *yymsg; 1051 int yytype; 1052 YYSTYPE *yyvaluep; 1053#endif 1054{ 1055 YYUSE (yyvaluep); 1056 1057 if (!yymsg) 1058 yymsg = "Deleting"; 1059 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 1060 1061 switch (yytype) 1062 { 1063 1064 default: 1065 break; 1066 } 1067} 1068 1069 1070/* Prevent warnings from -Wmissing-prototypes. */ 1071 1072#ifdef YYPARSE_PARAM 1073#if defined __STDC__ || defined __cplusplus 1074int yyparse (void *YYPARSE_PARAM); 1075#else 1076int yyparse (); 1077#endif 1078#else /* ! YYPARSE_PARAM */ 1079#if defined __STDC__ || defined __cplusplus 1080int yyparse (void); 1081#else 1082int yyparse (); 1083#endif 1084#endif /* ! YYPARSE_PARAM */ 1085 1086 1087 1088/* The look-ahead symbol. */ 1089int yychar; 1090 1091/* The semantic value of the look-ahead symbol. */ 1092YYSTYPE yylval; 1093 1094/* Number of syntax errors so far. */ 1095int yynerrs; 1096 1097 1098 1099/*----------. 1100| yyparse. | 1101`----------*/ 1102 1103#ifdef YYPARSE_PARAM 1104#if (defined __STDC__ || defined __C99__FUNC__ \ 1105 || defined __cplusplus || defined _MSC_VER) 1106int 1107yyparse (void *YYPARSE_PARAM) 1108#else 1109int 1110yyparse (YYPARSE_PARAM) 1111 void *YYPARSE_PARAM; 1112#endif 1113#else /* ! YYPARSE_PARAM */ 1114#if (defined __STDC__ || defined __C99__FUNC__ \ 1115 || defined __cplusplus || defined _MSC_VER) 1116int 1117yyparse (void) 1118#else 1119int 1120yyparse () 1121 1122#endif 1123#endif 1124{ 1125 1126 int yystate; 1127 int yyn; 1128 int yyresult; 1129 /* Number of tokens to shift before error messages enabled. */ 1130 int yyerrstatus; 1131 /* Look-ahead token as an internal (translated) token number. */ 1132 int yytoken = 0; 1133#if YYERROR_VERBOSE 1134 /* Buffer for error messages, and its allocated size. */ 1135 char yymsgbuf[128]; 1136 char *yymsg = yymsgbuf; 1137 YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 1138#endif 1139 1140 /* Three stacks and their tools: 1141 `yyss': related to states, 1142 `yyvs': related to semantic values, 1143 `yyls': related to locations. 1144 1145 Refer to the stacks thru separate pointers, to allow yyoverflow 1146 to reallocate them elsewhere. */ 1147 1148 /* The state stack. */ 1149 yytype_int16 yyssa[YYINITDEPTH]; 1150 yytype_int16 *yyss = yyssa; 1151 yytype_int16 *yyssp; 1152 1153 /* The semantic value stack. */ 1154 YYSTYPE yyvsa[YYINITDEPTH]; 1155 YYSTYPE *yyvs = yyvsa; 1156 YYSTYPE *yyvsp; 1157 1158 1159 1160#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1161 1162 YYSIZE_T yystacksize = YYINITDEPTH; 1163 1164 /* The variables used to return semantic value and location from the 1165 action routines. */ 1166 YYSTYPE yyval; 1167 1168 1169 /* The number of symbols on the RHS of the reduced rule. 1170 Keep to zero when no symbol should be popped. */ 1171 int yylen = 0; 1172 1173 YYDPRINTF ((stderr, "Starting parse\n")); 1174 1175 yystate = 0; 1176 yyerrstatus = 0; 1177 yynerrs = 0; 1178 yychar = YYEMPTY; /* Cause a token to be read. */ 1179 1180 /* Initialize stack pointers. 1181 Waste one element of value and location stack 1182 so that they stay on the same level as the state stack. 1183 The wasted elements are never initialized. */ 1184 1185 yyssp = yyss; 1186 yyvsp = yyvs; 1187 1188 goto yysetstate; 1189 1190/*------------------------------------------------------------. 1191| yynewstate -- Push a new state, which is found in yystate. | 1192`------------------------------------------------------------*/ 1193 yynewstate: 1194 /* In all cases, when you get here, the value and location stacks 1195 have just been pushed. So pushing a state here evens the stacks. */ 1196 yyssp++; 1197 1198 yysetstate: 1199 *yyssp = yystate; 1200 1201 if (yyss + yystacksize - 1 <= yyssp) 1202 { 1203 /* Get the current used size of the three stacks, in elements. */ 1204 YYSIZE_T yysize = yyssp - yyss + 1; 1205 1206#ifdef yyoverflow 1207 { 1208 /* Give user a chance to reallocate the stack. Use copies of 1209 these so that the &'s don't force the real ones into 1210 memory. */ 1211 YYSTYPE *yyvs1 = yyvs; 1212 yytype_int16 *yyss1 = yyss; 1213 1214 1215 /* Each stack pointer address is followed by the size of the 1216 data in use in that stack, in bytes. This used to be a 1217 conditional around just the two extra args, but that might 1218 be undefined if yyoverflow is a macro. */ 1219 yyoverflow (YY_("memory exhausted"), 1220 &yyss1, yysize * sizeof (*yyssp), 1221 &yyvs1, yysize * sizeof (*yyvsp), 1222 1223 &yystacksize); 1224 1225 yyss = yyss1; 1226 yyvs = yyvs1; 1227 } 1228#else /* no yyoverflow */ 1229# ifndef YYSTACK_RELOCATE 1230 goto yyexhaustedlab; 1231# else 1232 /* Extend the stack our own way. */ 1233 if (YYMAXDEPTH <= yystacksize) 1234 goto yyexhaustedlab; 1235 yystacksize *= 2; 1236 if (YYMAXDEPTH < yystacksize) 1237 yystacksize = YYMAXDEPTH; 1238 1239 { 1240 yytype_int16 *yyss1 = yyss; 1241 union yyalloc *yyptr = 1242 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1243 if (! yyptr) 1244 goto yyexhaustedlab; 1245 YYSTACK_RELOCATE (yyss); 1246 YYSTACK_RELOCATE (yyvs); 1247 1248# undef YYSTACK_RELOCATE 1249 if (yyss1 != yyssa) 1250 YYSTACK_FREE (yyss1); 1251 } 1252# endif 1253#endif /* no yyoverflow */ 1254 1255 yyssp = yyss + yysize - 1; 1256 yyvsp = yyvs + yysize - 1; 1257 1258 1259 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1260 (unsigned long int) yystacksize)); 1261 1262 if (yyss + yystacksize - 1 <= yyssp) 1263 YYABORT; 1264 } 1265 1266 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 1267 1268 goto yybackup; 1269 1270/*-----------. 1271| yybackup. | 1272`-----------*/ 1273yybackup: 1274 1275 /* Do appropriate processing given the current state. Read a 1276 look-ahead token if we need one and don't already have one. */ 1277 1278 /* First try to decide what to do without reference to look-ahead token. */ 1279 yyn = yypact[yystate]; 1280 if (yyn == YYPACT_NINF) 1281 goto yydefault; 1282 1283 /* Not known => get a look-ahead token if don't already have one. */ 1284 1285 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ 1286 if (yychar == YYEMPTY) 1287 { 1288 YYDPRINTF ((stderr, "Reading a token: ")); 1289 yychar = YYLEX; 1290 } 1291 1292 if (yychar <= YYEOF) 1293 { 1294 yychar = yytoken = YYEOF; 1295 YYDPRINTF ((stderr, "Now at end of input.\n")); 1296 } 1297 else 1298 { 1299 yytoken = YYTRANSLATE (yychar); 1300 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 1301 } 1302 1303 /* If the proper action on seeing token YYTOKEN is to reduce or to 1304 detect an error, take that action. */ 1305 yyn += yytoken; 1306 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 1307 goto yydefault; 1308 yyn = yytable[yyn]; 1309 if (yyn <= 0) 1310 { 1311 if (yyn == 0 || yyn == YYTABLE_NINF) 1312 goto yyerrlab; 1313 yyn = -yyn; 1314 goto yyreduce; 1315 } 1316 1317 if (yyn == YYFINAL) 1318 YYACCEPT; 1319 1320 /* Count tokens shifted since error; after three, turn off error 1321 status. */ 1322 if (yyerrstatus) 1323 yyerrstatus--; 1324 1325 /* Shift the look-ahead token. */ 1326 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 1327 1328 /* Discard the shifted token unless it is eof. */ 1329 if (yychar != YYEOF) 1330 yychar = YYEMPTY; 1331 1332 yystate = yyn; 1333 *++yyvsp = yylval; 1334 1335 goto yynewstate; 1336 1337 1338/*-----------------------------------------------------------. 1339| yydefault -- do the default action for the current state. | 1340`-----------------------------------------------------------*/ 1341yydefault: 1342 yyn = yydefact[yystate]; 1343 if (yyn == 0) 1344 goto yyerrlab; 1345 goto yyreduce; 1346 1347 1348/*-----------------------------. 1349| yyreduce -- Do a reduction. | 1350`-----------------------------*/ 1351yyreduce: 1352 /* yyn is the number of a rule to reduce with. */ 1353 yylen = yyr2[yyn]; 1354 1355 /* If YYLEN is nonzero, implement the default value of the action: 1356 `$$ = $1'. 1357 1358 Otherwise, the following line sets YYVAL to garbage. 1359 This behavior is undocumented and Bison 1360 users should not rely upon it. Assigning to YYVAL 1361 unconditionally makes the parser a bit smaller, and it avoids a 1362 GCC warning that YYVAL may be used uninitialized. */ 1363 yyval = yyvsp[1-yylen]; 1364 1365 1366 YY_REDUCE_PRINT (yyn); 1367 switch (yyn) 1368 { 1369 case 2: 1370#line 73 "heimdal/lib/hx509/sel-gram.y" 1371 { _hx509_expr_input.expr = (yyvsp[(1) - (1)].expr); } 1372 break; 1373 1374 case 3: 1375#line 75 "heimdal/lib/hx509/sel-gram.y" 1376 { (yyval.expr) = _hx509_make_expr(op_TRUE, NULL, NULL); } 1377 break; 1378 1379 case 4: 1380#line 76 "heimdal/lib/hx509/sel-gram.y" 1381 { (yyval.expr) = _hx509_make_expr(op_FALSE, NULL, NULL); } 1382 break; 1383 1384 case 5: 1385#line 77 "heimdal/lib/hx509/sel-gram.y" 1386 { (yyval.expr) = _hx509_make_expr(op_NOT, (yyvsp[(2) - (2)].expr), NULL); } 1387 break; 1388 1389 case 6: 1390#line 78 "heimdal/lib/hx509/sel-gram.y" 1391 { (yyval.expr) = _hx509_make_expr(op_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } 1392 break; 1393 1394 case 7: 1395#line 79 "heimdal/lib/hx509/sel-gram.y" 1396 { (yyval.expr) = _hx509_make_expr(op_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } 1397 break; 1398 1399 case 8: 1400#line 80 "heimdal/lib/hx509/sel-gram.y" 1401 { (yyval.expr) = (yyvsp[(2) - (3)].expr); } 1402 break; 1403 1404 case 9: 1405#line 81 "heimdal/lib/hx509/sel-gram.y" 1406 { (yyval.expr) = _hx509_make_expr(op_COMP, (yyvsp[(1) - (1)].expr), NULL); } 1407 break; 1408 1409 case 10: 1410#line 84 "heimdal/lib/hx509/sel-gram.y" 1411 { (yyval.expr) = _hx509_make_expr(expr_WORDS, (yyvsp[(1) - (1)].expr), NULL); } 1412 break; 1413 1414 case 11: 1415#line 85 "heimdal/lib/hx509/sel-gram.y" 1416 { (yyval.expr) = _hx509_make_expr(expr_WORDS, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } 1417 break; 1418 1419 case 12: 1420#line 88 "heimdal/lib/hx509/sel-gram.y" 1421 { (yyval.expr) = _hx509_make_expr(comp_EQ, (yyvsp[(1) - (4)].expr), (yyvsp[(4) - (4)].expr)); } 1422 break; 1423 1424 case 13: 1425#line 89 "heimdal/lib/hx509/sel-gram.y" 1426 { (yyval.expr) = _hx509_make_expr(comp_NE, (yyvsp[(1) - (4)].expr), (yyvsp[(4) - (4)].expr)); } 1427 break; 1428 1429 case 14: 1430#line 90 "heimdal/lib/hx509/sel-gram.y" 1431 { (yyval.expr) = _hx509_make_expr(comp_TAILEQ, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } 1432 break; 1433 1434 case 15: 1435#line 91 "heimdal/lib/hx509/sel-gram.y" 1436 { (yyval.expr) = _hx509_make_expr(comp_IN, (yyvsp[(1) - (5)].expr), (yyvsp[(4) - (5)].expr)); } 1437 break; 1438 1439 case 16: 1440#line 92 "heimdal/lib/hx509/sel-gram.y" 1441 { (yyval.expr) = _hx509_make_expr(comp_IN, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } 1442 break; 1443 1444 case 17: 1445#line 95 "heimdal/lib/hx509/sel-gram.y" 1446 { (yyval.expr) = (yyvsp[(1) - (1)].expr); } 1447 break; 1448 1449 case 18: 1450#line 96 "heimdal/lib/hx509/sel-gram.y" 1451 { (yyval.expr) = (yyvsp[(1) - (1)].expr); } 1452 break; 1453 1454 case 19: 1455#line 97 "heimdal/lib/hx509/sel-gram.y" 1456 { (yyval.expr) = (yyvsp[(1) - (1)].expr); } 1457 break; 1458 1459 case 20: 1460#line 98 "heimdal/lib/hx509/sel-gram.y" 1461 { (yyval.expr) = (yyvsp[(1) - (1)].expr); } 1462 break; 1463 1464 case 21: 1465#line 101 "heimdal/lib/hx509/sel-gram.y" 1466 { (yyval.expr) = _hx509_make_expr(expr_NUMBER, (yyvsp[(1) - (1)].string), NULL); } 1467 break; 1468 1469 case 22: 1470#line 102 "heimdal/lib/hx509/sel-gram.y" 1471 { (yyval.expr) = _hx509_make_expr(expr_STRING, (yyvsp[(1) - (1)].string), NULL); } 1472 break; 1473 1474 case 23: 1475#line 104 "heimdal/lib/hx509/sel-gram.y" 1476 { 1477 (yyval.expr) = _hx509_make_expr(expr_FUNCTION, (yyvsp[(1) - (4)].string), (yyvsp[(3) - (4)].expr)); } 1478 break; 1479 1480 case 24: 1481#line 107 "heimdal/lib/hx509/sel-gram.y" 1482 { (yyval.expr) = (yyvsp[(3) - (4)].expr); } 1483 break; 1484 1485 case 25: 1486#line 110 "heimdal/lib/hx509/sel-gram.y" 1487 { 1488 (yyval.expr) = _hx509_make_expr(expr_VAR, (yyvsp[(1) - (3)].string), (yyvsp[(3) - (3)].expr)); } 1489 break; 1490 1491 case 26: 1492#line 112 "heimdal/lib/hx509/sel-gram.y" 1493 { 1494 (yyval.expr) = _hx509_make_expr(expr_VAR, (yyvsp[(1) - (1)].string), NULL); } 1495 break; 1496 1497 1498/* Line 1267 of yacc.c. */ 1499#line 1500 "heimdal/lib/hx509/sel-gram.y" 1500 default: break; 1501 } 1502 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 1503 1504 YYPOPSTACK (yylen); 1505 yylen = 0; 1506 YY_STACK_PRINT (yyss, yyssp); 1507 1508 *++yyvsp = yyval; 1509 1510 1511 /* Now `shift' the result of the reduction. Determine what state 1512 that goes to, based on the state we popped back to and the rule 1513 number reduced by. */ 1514 1515 yyn = yyr1[yyn]; 1516 1517 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 1518 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 1519 yystate = yytable[yystate]; 1520 else 1521 yystate = yydefgoto[yyn - YYNTOKENS]; 1522 1523 goto yynewstate; 1524 1525 1526/*------------------------------------. 1527| yyerrlab -- here on detecting error | 1528`------------------------------------*/ 1529yyerrlab: 1530 /* If not already recovering from an error, report this error. */ 1531 if (!yyerrstatus) 1532 { 1533 ++yynerrs; 1534#if ! YYERROR_VERBOSE 1535 yyerror (YY_("syntax error")); 1536#else 1537 { 1538 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); 1539 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) 1540 { 1541 YYSIZE_T yyalloc = 2 * yysize; 1542 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) 1543 yyalloc = YYSTACK_ALLOC_MAXIMUM; 1544 if (yymsg != yymsgbuf) 1545 YYSTACK_FREE (yymsg); 1546 yymsg = (char *) YYSTACK_ALLOC (yyalloc); 1547 if (yymsg) 1548 yymsg_alloc = yyalloc; 1549 else 1550 { 1551 yymsg = yymsgbuf; 1552 yymsg_alloc = sizeof yymsgbuf; 1553 } 1554 } 1555 1556 if (0 < yysize && yysize <= yymsg_alloc) 1557 { 1558 (void) yysyntax_error (yymsg, yystate, yychar); 1559 yyerror (yymsg); 1560 } 1561 else 1562 { 1563 yyerror (YY_("syntax error")); 1564 if (yysize != 0) 1565 goto yyexhaustedlab; 1566 } 1567 } 1568#endif 1569 } 1570 1571 1572 1573 if (yyerrstatus == 3) 1574 { 1575 /* If just tried and failed to reuse look-ahead token after an 1576 error, discard it. */ 1577 1578 if (yychar <= YYEOF) 1579 { 1580 /* Return failure if at end of input. */ 1581 if (yychar == YYEOF) 1582 YYABORT; 1583 } 1584 else 1585 { 1586 yydestruct ("Error: discarding", 1587 yytoken, &yylval); 1588 yychar = YYEMPTY; 1589 } 1590 } 1591 1592 /* Else will try to reuse look-ahead token after shifting the error 1593 token. */ 1594 goto yyerrlab1; 1595 1596 1597/*---------------------------------------------------. 1598| yyerrorlab -- error raised explicitly by YYERROR. | 1599`---------------------------------------------------*/ 1600yyerrorlab: 1601 1602 /* Pacify compilers like GCC when the user code never invokes 1603 YYERROR and the label yyerrorlab therefore never appears in user 1604 code. */ 1605 if (/*CONSTCOND*/ 0) 1606 goto yyerrorlab; 1607 1608 /* Do not reclaim the symbols of the rule which action triggered 1609 this YYERROR. */ 1610 YYPOPSTACK (yylen); 1611 yylen = 0; 1612 YY_STACK_PRINT (yyss, yyssp); 1613 yystate = *yyssp; 1614 goto yyerrlab1; 1615 1616 1617/*-------------------------------------------------------------. 1618| yyerrlab1 -- common code for both syntax error and YYERROR. | 1619`-------------------------------------------------------------*/ 1620yyerrlab1: 1621 yyerrstatus = 3; /* Each real token shifted decrements this. */ 1622 1623 for (;;) 1624 { 1625 yyn = yypact[yystate]; 1626 if (yyn != YYPACT_NINF) 1627 { 1628 yyn += YYTERROR; 1629 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 1630 { 1631 yyn = yytable[yyn]; 1632 if (0 < yyn) 1633 break; 1634 } 1635 } 1636 1637 /* Pop the current state because it cannot handle the error token. */ 1638 if (yyssp == yyss) 1639 YYABORT; 1640 1641 1642 yydestruct ("Error: popping", 1643 yystos[yystate], yyvsp); 1644 YYPOPSTACK (1); 1645 yystate = *yyssp; 1646 YY_STACK_PRINT (yyss, yyssp); 1647 } 1648 1649 if (yyn == YYFINAL) 1650 YYACCEPT; 1651 1652 *++yyvsp = yylval; 1653 1654 1655 /* Shift the error token. */ 1656 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 1657 1658 yystate = yyn; 1659 goto yynewstate; 1660 1661 1662/*-------------------------------------. 1663| yyacceptlab -- YYACCEPT comes here. | 1664`-------------------------------------*/ 1665yyacceptlab: 1666 yyresult = 0; 1667 goto yyreturn; 1668 1669/*-----------------------------------. 1670| yyabortlab -- YYABORT comes here. | 1671`-----------------------------------*/ 1672yyabortlab: 1673 yyresult = 1; 1674 goto yyreturn; 1675 1676#ifndef yyoverflow 1677/*-------------------------------------------------. 1678| yyexhaustedlab -- memory exhaustion comes here. | 1679`-------------------------------------------------*/ 1680yyexhaustedlab: 1681 yyerror (YY_("memory exhausted")); 1682 yyresult = 2; 1683 /* Fall through. */ 1684#endif 1685 1686yyreturn: 1687 if (yychar != YYEOF && yychar != YYEMPTY) 1688 yydestruct ("Cleanup: discarding lookahead", 1689 yytoken, &yylval); 1690 /* Do not reclaim the symbols of the rule which action triggered 1691 this YYABORT or YYACCEPT. */ 1692 YYPOPSTACK (yylen); 1693 YY_STACK_PRINT (yyss, yyssp); 1694 while (yyssp != yyss) 1695 { 1696 yydestruct ("Cleanup: popping", 1697 yystos[*yyssp], yyvsp); 1698 YYPOPSTACK (1); 1699 } 1700#ifndef yyoverflow 1701 if (yyss != yyssa) 1702 YYSTACK_FREE (yyss); 1703#endif 1704#if YYERROR_VERBOSE 1705 if (yymsg != yymsgbuf) 1706 YYSTACK_FREE (yymsg); 1707#endif 1708 /* Make sure YYID is used. */ 1709 return YYID (yyresult); 1710} 1711 1712 1713 1714