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 NAME = 258, 70 LIBRARY = 259, 71 DESCRIPTION = 260, 72 STACKSIZE = 261, 73 HEAPSIZE = 262, 74 CODE = 263, 75 DATA = 264, 76 SECTIONS = 265, 77 EXPORTS = 266, 78 IMPORTS = 267, 79 VERSIONK = 268, 80 BASE = 269, 81 CONSTANT = 270, 82 READ = 271, 83 WRITE = 272, 84 EXECUTE = 273, 85 SHARED = 274, 86 NONSHARED = 275, 87 NONAME = 276, 88 PRIVATE = 277, 89 SINGLE = 278, 90 MULTIPLE = 279, 91 INITINSTANCE = 280, 92 INITGLOBAL = 281, 93 TERMINSTANCE = 282, 94 TERMGLOBAL = 283, 95 EQUAL = 284, 96 ID = 285, 97 NUMBER = 286 98 }; 99#endif 100/* Tokens. */ 101#define NAME 258 102#define LIBRARY 259 103#define DESCRIPTION 260 104#define STACKSIZE 261 105#define HEAPSIZE 262 106#define CODE 263 107#define DATA 264 108#define SECTIONS 265 109#define EXPORTS 266 110#define IMPORTS 267 111#define VERSIONK 268 112#define BASE 269 113#define CONSTANT 270 114#define READ 271 115#define WRITE 272 116#define EXECUTE 273 117#define SHARED 274 118#define NONSHARED 275 119#define NONAME 276 120#define PRIVATE 277 121#define SINGLE 278 122#define MULTIPLE 279 123#define INITINSTANCE 280 124#define INITGLOBAL 281 125#define TERMINSTANCE 282 126#define TERMGLOBAL 283 127#define EQUAL 284 128#define ID 285 129#define NUMBER 286 130 131 132 133 134/* Copy the first part of user declarations. */ 135#line 1 "defparse.y" 136 /* defparse.y - parser for .def files */ 137 138/* Copyright 1995, 1997, 1998, 1999, 2001, 2004, 2005, 2007 139 Free Software Foundation, Inc. 140 141 This file is part of GNU Binutils. 142 143 This program is free software; you can redistribute it and/or modify 144 it under the terms of the GNU General Public License as published by 145 the Free Software Foundation; either version 3 of the License, or 146 (at your option) any later version. 147 148 This program is distributed in the hope that it will be useful, 149 but WITHOUT ANY WARRANTY; without even the implied warranty of 150 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 151 GNU General Public License for more details. 152 153 You should have received a copy of the GNU General Public License 154 along with this program; if not, write to the Free Software 155 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 156 MA 02110-1301, USA. */ 157 158#include "sysdep.h" 159#include "bfd.h" 160#include "libiberty.h" 161#include "dlltool.h" 162 163 164/* Enabling traces. */ 165#ifndef YYDEBUG 166# define YYDEBUG 0 167#endif 168 169/* Enabling verbose error messages. */ 170#ifdef YYERROR_VERBOSE 171# undef YYERROR_VERBOSE 172# define YYERROR_VERBOSE 1 173#else 174# define YYERROR_VERBOSE 0 175#endif 176 177/* Enabling the token table. */ 178#ifndef YYTOKEN_TABLE 179# define YYTOKEN_TABLE 0 180#endif 181 182#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 183typedef union YYSTYPE 184#line 29 "defparse.y" 185{ 186 char *id; 187 int number; 188} 189/* Line 193 of yacc.c. */ 190#line 191 "defparse.c" 191 YYSTYPE; 192# define yystype YYSTYPE /* obsolescent; will be withdrawn */ 193# define YYSTYPE_IS_DECLARED 1 194# define YYSTYPE_IS_TRIVIAL 1 195#endif 196 197 198 199/* Copy the second part of user declarations. */ 200 201 202/* Line 216 of yacc.c. */ 203#line 204 "defparse.c" 204 205#ifdef short 206# undef short 207#endif 208 209#ifdef YYTYPE_UINT8 210typedef YYTYPE_UINT8 yytype_uint8; 211#else 212typedef unsigned char yytype_uint8; 213#endif 214 215#ifdef YYTYPE_INT8 216typedef YYTYPE_INT8 yytype_int8; 217#elif (defined __STDC__ || defined __C99__FUNC__ \ 218 || defined __cplusplus || defined _MSC_VER) 219typedef signed char yytype_int8; 220#else 221typedef short int yytype_int8; 222#endif 223 224#ifdef YYTYPE_UINT16 225typedef YYTYPE_UINT16 yytype_uint16; 226#else 227typedef unsigned short int yytype_uint16; 228#endif 229 230#ifdef YYTYPE_INT16 231typedef YYTYPE_INT16 yytype_int16; 232#else 233typedef short int yytype_int16; 234#endif 235 236#ifndef YYSIZE_T 237# ifdef __SIZE_TYPE__ 238# define YYSIZE_T __SIZE_TYPE__ 239# elif defined size_t 240# define YYSIZE_T size_t 241# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ 242 || defined __cplusplus || defined _MSC_VER) 243# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 244# define YYSIZE_T size_t 245# else 246# define YYSIZE_T unsigned int 247# endif 248#endif 249 250#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 251 252#ifndef YY_ 253# if defined YYENABLE_NLS && YYENABLE_NLS 254# if ENABLE_NLS 255# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 256# define YY_(msgid) dgettext ("bison-runtime", msgid) 257# endif 258# endif 259# ifndef YY_ 260# define YY_(msgid) msgid 261# endif 262#endif 263 264/* Suppress unused-variable warnings by "using" E. */ 265#if ! defined lint || defined __GNUC__ 266# define YYUSE(e) ((void) (e)) 267#else 268# define YYUSE(e) /* empty */ 269#endif 270 271/* Identity function, used to suppress warnings about constant conditions. */ 272#ifndef lint 273# define YYID(n) (n) 274#else 275#if (defined __STDC__ || defined __C99__FUNC__ \ 276 || defined __cplusplus || defined _MSC_VER) 277static int 278YYID (int i) 279#else 280static int 281YYID (i) 282 int i; 283#endif 284{ 285 return i; 286} 287#endif 288 289#if ! defined yyoverflow || YYERROR_VERBOSE 290 291/* The parser invokes alloca or malloc; define the necessary symbols. */ 292 293# ifdef YYSTACK_USE_ALLOCA 294# if YYSTACK_USE_ALLOCA 295# ifdef __GNUC__ 296# define YYSTACK_ALLOC __builtin_alloca 297# elif defined __BUILTIN_VA_ARG_INCR 298# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ 299# elif defined _AIX 300# define YYSTACK_ALLOC __alloca 301# elif defined _MSC_VER 302# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ 303# define alloca _alloca 304# else 305# define YYSTACK_ALLOC alloca 306# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 307 || defined __cplusplus || defined _MSC_VER) 308# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 309# ifndef _STDLIB_H 310# define _STDLIB_H 1 311# endif 312# endif 313# endif 314# endif 315# endif 316 317# ifdef YYSTACK_ALLOC 318 /* Pacify GCC's `empty if-body' warning. */ 319# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) 320# ifndef YYSTACK_ALLOC_MAXIMUM 321 /* The OS might guarantee only one guard page at the bottom of the stack, 322 and a page size can be as small as 4096 bytes. So we cannot safely 323 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 324 to allow for a few compiler-allocated temporary stack slots. */ 325# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ 326# endif 327# else 328# define YYSTACK_ALLOC YYMALLOC 329# define YYSTACK_FREE YYFREE 330# ifndef YYSTACK_ALLOC_MAXIMUM 331# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 332# endif 333# if (defined __cplusplus && ! defined _STDLIB_H \ 334 && ! ((defined YYMALLOC || defined malloc) \ 335 && (defined YYFREE || defined free))) 336# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 337# ifndef _STDLIB_H 338# define _STDLIB_H 1 339# endif 340# endif 341# ifndef YYMALLOC 342# define YYMALLOC malloc 343# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 344 || defined __cplusplus || defined _MSC_VER) 345void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 346# endif 347# endif 348# ifndef YYFREE 349# define YYFREE free 350# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 351 || defined __cplusplus || defined _MSC_VER) 352void free (void *); /* INFRINGES ON USER NAME SPACE */ 353# endif 354# endif 355# endif 356#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ 357 358 359#if (! defined yyoverflow \ 360 && (! defined __cplusplus \ 361 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 362 363/* A type that is properly aligned for any stack member. */ 364union yyalloc 365{ 366 yytype_int16 yyss; 367 YYSTYPE yyvs; 368 }; 369 370/* The size of the maximum gap between one aligned stack and the next. */ 371# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 372 373/* The size of an array large to enough to hold all stacks, each with 374 N elements. */ 375# define YYSTACK_BYTES(N) \ 376 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 377 + YYSTACK_GAP_MAXIMUM) 378 379/* Copy COUNT objects from FROM to TO. The source and destination do 380 not overlap. */ 381# ifndef YYCOPY 382# if defined __GNUC__ && 1 < __GNUC__ 383# define YYCOPY(To, From, Count) \ 384 __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 385# else 386# define YYCOPY(To, From, Count) \ 387 do \ 388 { \ 389 YYSIZE_T yyi; \ 390 for (yyi = 0; yyi < (Count); yyi++) \ 391 (To)[yyi] = (From)[yyi]; \ 392 } \ 393 while (YYID (0)) 394# endif 395# endif 396 397/* Relocate STACK from its old location to the new one. The 398 local variables YYSIZE and YYSTACKSIZE give the old and new number of 399 elements in the stack, and YYPTR gives the new location of the 400 stack. Advance YYPTR to a properly aligned location for the next 401 stack. */ 402# define YYSTACK_RELOCATE(Stack) \ 403 do \ 404 { \ 405 YYSIZE_T yynewbytes; \ 406 YYCOPY (&yyptr->Stack, Stack, yysize); \ 407 Stack = &yyptr->Stack; \ 408 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 409 yyptr += yynewbytes / sizeof (*yyptr); \ 410 } \ 411 while (YYID (0)) 412 413#endif 414 415/* YYFINAL -- State number of the termination state. */ 416#define YYFINAL 38 417/* YYLAST -- Last index in YYTABLE. */ 418#define YYLAST 120 419 420/* YYNTOKENS -- Number of terminals. */ 421#define YYNTOKENS 36 422/* YYNNTS -- Number of nonterminals. */ 423#define YYNNTS 24 424/* YYNRULES -- Number of rules. */ 425#define YYNRULES 70 426/* YYNRULES -- Number of states. */ 427#define YYNSTATES 109 428 429/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 430#define YYUNDEFTOK 2 431#define YYMAXUTOK 286 432 433#define YYTRANSLATE(YYX) \ 434 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 435 436/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 437static const yytype_uint8 yytranslate[] = 438{ 439 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 441 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 442 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 443 2, 2, 2, 2, 34, 2, 32, 2, 2, 2, 444 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 445 2, 33, 2, 2, 35, 2, 2, 2, 2, 2, 446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 450 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 451 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 452 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 460 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 461 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 463 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 464 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 465 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 466 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 467 25, 26, 27, 28, 29, 30, 31 468}; 469 470#if YYDEBUG 471/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 472 YYRHS. */ 473static const yytype_uint8 yyprhs[] = 474{ 475 0, 0, 3, 6, 8, 12, 17, 20, 23, 27, 476 31, 34, 37, 40, 43, 46, 51, 52, 55, 64, 477 67, 69, 78, 87, 94, 101, 108, 115, 120, 125, 478 128, 130, 133, 137, 139, 141, 142, 145, 146, 148, 479 150, 152, 154, 156, 158, 160, 162, 163, 165, 166, 480 168, 169, 171, 172, 174, 178, 179, 182, 183, 186, 481 187, 190, 195, 196, 200, 201, 202, 206, 208, 210, 482 212 483}; 484 485/* YYRHS -- A `-1'-separated list of the rules' RHS. */ 486static const yytype_int8 yyrhs[] = 487{ 488 37, 0, -1, 37, 38, -1, 38, -1, 3, 53, 489 57, -1, 4, 53, 57, 58, -1, 11, 39, -1, 490 5, 30, -1, 6, 31, 47, -1, 7, 31, 47, 491 -1, 8, 45, -1, 9, 45, -1, 10, 43, -1, 492 12, 41, -1, 13, 31, -1, 13, 31, 32, 31, 493 -1, -1, 39, 40, -1, 30, 56, 54, 50, 49, 494 51, 52, 55, -1, 41, 42, -1, 42, -1, 30, 495 33, 30, 32, 30, 32, 30, 55, -1, 30, 33, 496 30, 32, 30, 32, 31, 55, -1, 30, 33, 30, 497 32, 30, 55, -1, 30, 33, 30, 32, 31, 55, 498 -1, 30, 32, 30, 32, 30, 55, -1, 30, 32, 499 30, 32, 31, 55, -1, 30, 32, 30, 55, -1, 500 30, 32, 31, 55, -1, 43, 44, -1, 44, -1, 501 30, 45, -1, 45, 46, 48, -1, 48, -1, 34, 502 -1, -1, 34, 31, -1, -1, 16, -1, 17, -1, 503 18, -1, 19, -1, 20, -1, 23, -1, 24, -1, 504 15, -1, -1, 21, -1, -1, 9, -1, -1, 22, 505 -1, -1, 30, -1, 30, 32, 30, -1, -1, 35, 506 31, -1, -1, 29, 30, -1, -1, 33, 30, -1, 507 33, 30, 32, 30, -1, -1, 14, 33, 31, -1, 508 -1, -1, 58, 46, 59, -1, 25, -1, 26, -1, 509 27, -1, 28, -1 510}; 511 512/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 513static const yytype_uint8 yyrline[] = 514{ 515 0, 47, 47, 48, 52, 53, 54, 55, 56, 57, 516 58, 59, 60, 61, 62, 63, 67, 69, 73, 78, 517 79, 83, 85, 87, 89, 91, 93, 95, 97, 102, 518 103, 107, 111, 112, 116, 117, 119, 120, 124, 125, 519 126, 127, 128, 129, 130, 134, 135, 139, 140, 144, 520 145, 149, 150, 153, 154, 160, 164, 165, 169, 170, 521 174, 175, 181, 184, 185, 188, 190, 194, 195, 196, 522 197 523}; 524#endif 525 526#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 527/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 528 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 529static const char *const yytname[] = 530{ 531 "$end", "error", "$undefined", "NAME", "LIBRARY", "DESCRIPTION", 532 "STACKSIZE", "HEAPSIZE", "CODE", "DATA", "SECTIONS", "EXPORTS", 533 "IMPORTS", "VERSIONK", "BASE", "CONSTANT", "READ", "WRITE", "EXECUTE", 534 "SHARED", "NONSHARED", "NONAME", "PRIVATE", "SINGLE", "MULTIPLE", 535 "INITINSTANCE", "INITGLOBAL", "TERMINSTANCE", "TERMGLOBAL", "EQUAL", 536 "ID", "NUMBER", "'.'", "'='", "','", "'@'", "$accept", "start", 537 "command", "explist", "expline", "implist", "impline", "seclist", 538 "secline", "attr_list", "opt_comma", "opt_number", "attr", 539 "opt_CONSTANT", "opt_NONAME", "opt_DATA", "opt_PRIVATE", "opt_name", 540 "opt_ordinal", "opt_import_name", "opt_equal_name", "opt_base", 541 "option_list", "option", 0 542}; 543#endif 544 545# ifdef YYPRINT 546/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 547 token YYLEX-NUM. */ 548static const yytype_uint16 yytoknum[] = 549{ 550 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 551 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 552 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 553 285, 286, 46, 61, 44, 64 554}; 555# endif 556 557/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 558static const yytype_uint8 yyr1[] = 559{ 560 0, 36, 37, 37, 38, 38, 38, 38, 38, 38, 561 38, 38, 38, 38, 38, 38, 39, 39, 40, 41, 562 41, 42, 42, 42, 42, 42, 42, 42, 42, 43, 563 43, 44, 45, 45, 46, 46, 47, 47, 48, 48, 564 48, 48, 48, 48, 48, 49, 49, 50, 50, 51, 565 51, 52, 52, 53, 53, 53, 54, 54, 55, 55, 566 56, 56, 56, 57, 57, 58, 58, 59, 59, 59, 567 59 568}; 569 570/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 571static const yytype_uint8 yyr2[] = 572{ 573 0, 2, 2, 1, 3, 4, 2, 2, 3, 3, 574 2, 2, 2, 2, 2, 4, 0, 2, 8, 2, 575 1, 8, 8, 6, 6, 6, 6, 4, 4, 2, 576 1, 2, 3, 1, 1, 0, 2, 0, 1, 1, 577 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 578 0, 1, 0, 1, 3, 0, 2, 0, 2, 0, 579 2, 4, 0, 3, 0, 0, 3, 1, 1, 1, 580 1 581}; 582 583/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state 584 STATE-NUM when YYTABLE doesn't specify something else to do. Zero 585 means the default is an error. */ 586static const yytype_uint8 yydefact[] = 587{ 588 0, 55, 55, 0, 0, 0, 0, 0, 0, 16, 589 0, 0, 0, 3, 53, 64, 64, 7, 37, 37, 590 38, 39, 40, 41, 42, 43, 44, 10, 33, 11, 591 0, 12, 30, 6, 0, 13, 20, 14, 1, 2, 592 0, 0, 4, 65, 0, 8, 9, 34, 0, 31, 593 29, 62, 17, 0, 0, 19, 0, 54, 0, 5, 594 36, 32, 0, 57, 59, 59, 0, 15, 63, 0, 595 60, 0, 48, 0, 0, 27, 28, 0, 67, 68, 596 69, 70, 66, 0, 56, 47, 46, 58, 59, 59, 597 59, 59, 61, 45, 50, 25, 26, 0, 23, 24, 598 49, 52, 59, 59, 51, 59, 21, 22, 18 599}; 600 601/* YYDEFGOTO[NTERM-NUM]. */ 602static const yytype_int8 yydefgoto[] = 603{ 604 -1, 12, 13, 33, 52, 35, 36, 31, 32, 27, 605 48, 45, 28, 94, 86, 101, 105, 15, 72, 75, 606 63, 42, 59, 82 607}; 608 609/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 610 STATE-NUM. */ 611#define YYPACT_NINF -66 612static const yytype_int8 yypact[] = 613{ 614 50, -29, -29, -8, -28, 10, 48, 48, 40, -66, 615 47, 38, 39, -66, 46, 65, 65, -66, 49, 49, 616 -66, -66, -66, -66, -66, -66, -66, -6, -66, -6, 617 48, 40, -66, 51, -12, 47, -66, 52, -66, -66, 618 55, 53, -66, -66, 56, -66, -66, -66, 48, -6, 619 -66, 57, -66, 3, 58, -66, 60, -66, 61, -19, 620 -66, -66, 59, 62, -27, 64, 63, -66, -66, 4, 621 66, 68, 73, 70, 5, -66, -66, 43, -66, -66, 622 -66, -66, -66, 71, -66, -66, 67, -66, 64, 64, 623 -13, 64, -66, -66, 87, -66, -66, 45, -66, -66, 624 -66, 80, 64, 64, -66, 64, -66, -66, -66 625}; 626 627/* YYPGOTO[NTERM-NUM]. */ 628static const yytype_int8 yypgoto[] = 629{ 630 -66, -66, 91, -66, -66, -66, 69, -66, 74, -3, 631 21, 88, 72, -66, -66, -66, -66, 104, -66, -65, 632 -66, 92, -66, -66 633}; 634 635/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 636 positive, shift that token. If negative, reduce the rule which 637 number is the opposite. If zero, do what YYDEFACT says. 638 If YYTABLE_NINF, syntax error. */ 639#define YYTABLE_NINF -36 640static const yytype_int8 yytable[] = 641{ 642 76, 14, 73, 18, 29, 74, -35, -35, -35, -35, 643 -35, -35, -35, -35, -35, 47, 73, -35, -35, 97, 644 53, 54, 17, 95, 96, 98, 99, 49, 47, 78, 645 79, 80, 81, 64, 65, 88, 89, 106, 107, 38, 646 108, 19, 1, 2, 3, 4, 5, 6, 7, 8, 647 9, 10, 11, 1, 2, 3, 4, 5, 6, 7, 648 8, 9, 10, 11, 20, 21, 22, 23, 24, 37, 649 30, 25, 26, 90, 91, 102, 103, 34, 40, 41, 650 69, 51, 93, 44, 56, 57, 58, 60, 66, 70, 651 62, 67, 68, 73, 85, 77, 100, 71, 83, 84, 652 87, 92, 104, 39, 55, 50, 16, 46, 43, 0, 653 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 654 61 655}; 656 657static const yytype_int8 yycheck[] = 658{ 659 65, 30, 29, 31, 7, 32, 25, 26, 27, 28, 660 16, 17, 18, 19, 20, 34, 29, 23, 24, 32, 661 32, 33, 30, 88, 89, 90, 91, 30, 34, 25, 662 26, 27, 28, 30, 31, 30, 31, 102, 103, 0, 663 105, 31, 3, 4, 5, 6, 7, 8, 9, 10, 664 11, 12, 13, 3, 4, 5, 6, 7, 8, 9, 665 10, 11, 12, 13, 16, 17, 18, 19, 20, 31, 666 30, 23, 24, 30, 31, 30, 31, 30, 32, 14, 667 59, 30, 15, 34, 32, 30, 33, 31, 30, 30, 668 33, 31, 31, 29, 21, 32, 9, 35, 32, 31, 669 30, 30, 22, 12, 35, 31, 2, 19, 16, -1, 670 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 671 48 672}; 673 674/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 675 symbol of state STATE-NUM. */ 676static const yytype_uint8 yystos[] = 677{ 678 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 679 12, 13, 37, 38, 30, 53, 53, 30, 31, 31, 680 16, 17, 18, 19, 20, 23, 24, 45, 48, 45, 681 30, 43, 44, 39, 30, 41, 42, 31, 0, 38, 682 32, 14, 57, 57, 34, 47, 47, 34, 46, 45, 683 44, 30, 40, 32, 33, 42, 32, 30, 33, 58, 684 31, 48, 33, 56, 30, 31, 30, 31, 31, 46, 685 30, 35, 54, 29, 32, 55, 55, 32, 25, 26, 686 27, 28, 59, 32, 31, 21, 50, 30, 30, 31, 687 30, 31, 30, 15, 49, 55, 55, 32, 55, 55, 688 9, 51, 30, 31, 22, 52, 55, 55, 55 689}; 690 691#define yyerrok (yyerrstatus = 0) 692#define yyclearin (yychar = YYEMPTY) 693#define YYEMPTY (-2) 694#define YYEOF 0 695 696#define YYACCEPT goto yyacceptlab 697#define YYABORT goto yyabortlab 698#define YYERROR goto yyerrorlab 699 700 701/* Like YYERROR except do call yyerror. This remains here temporarily 702 to ease the transition to the new meaning of YYERROR, for GCC. 703 Once GCC version 2 has supplanted version 1, this can go. */ 704 705#define YYFAIL goto yyerrlab 706 707#define YYRECOVERING() (!!yyerrstatus) 708 709#define YYBACKUP(Token, Value) \ 710do \ 711 if (yychar == YYEMPTY && yylen == 1) \ 712 { \ 713 yychar = (Token); \ 714 yylval = (Value); \ 715 yytoken = YYTRANSLATE (yychar); \ 716 YYPOPSTACK (1); \ 717 goto yybackup; \ 718 } \ 719 else \ 720 { \ 721 yyerror (YY_("syntax error: cannot back up")); \ 722 YYERROR; \ 723 } \ 724while (YYID (0)) 725 726 727#define YYTERROR 1 728#define YYERRCODE 256 729 730 731/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 732 If N is 0, then set CURRENT to the empty location which ends 733 the previous symbol: RHS[0] (always defined). */ 734 735#define YYRHSLOC(Rhs, K) ((Rhs)[K]) 736#ifndef YYLLOC_DEFAULT 737# define YYLLOC_DEFAULT(Current, Rhs, N) \ 738 do \ 739 if (YYID (N)) \ 740 { \ 741 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ 742 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ 743 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ 744 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ 745 } \ 746 else \ 747 { \ 748 (Current).first_line = (Current).last_line = \ 749 YYRHSLOC (Rhs, 0).last_line; \ 750 (Current).first_column = (Current).last_column = \ 751 YYRHSLOC (Rhs, 0).last_column; \ 752 } \ 753 while (YYID (0)) 754#endif 755 756 757/* YY_LOCATION_PRINT -- Print the location on the stream. 758 This macro was not mandated originally: define only if we know 759 we won't break user code: when these are the locations we know. */ 760 761#ifndef YY_LOCATION_PRINT 762# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL 763# define YY_LOCATION_PRINT(File, Loc) \ 764 fprintf (File, "%d.%d-%d.%d", \ 765 (Loc).first_line, (Loc).first_column, \ 766 (Loc).last_line, (Loc).last_column) 767# else 768# define YY_LOCATION_PRINT(File, Loc) ((void) 0) 769# endif 770#endif 771 772 773/* YYLEX -- calling `yylex' with the right arguments. */ 774 775#ifdef YYLEX_PARAM 776# define YYLEX yylex (YYLEX_PARAM) 777#else 778# define YYLEX yylex () 779#endif 780 781/* Enable debugging if requested. */ 782#if YYDEBUG 783 784# ifndef YYFPRINTF 785# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 786# define YYFPRINTF fprintf 787# endif 788 789# define YYDPRINTF(Args) \ 790do { \ 791 if (yydebug) \ 792 YYFPRINTF Args; \ 793} while (YYID (0)) 794 795# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 796do { \ 797 if (yydebug) \ 798 { \ 799 YYFPRINTF (stderr, "%s ", Title); \ 800 yy_symbol_print (stderr, \ 801 Type, Value); \ 802 YYFPRINTF (stderr, "\n"); \ 803 } \ 804} while (YYID (0)) 805 806 807/*--------------------------------. 808| Print this symbol on YYOUTPUT. | 809`--------------------------------*/ 810 811/*ARGSUSED*/ 812#if (defined __STDC__ || defined __C99__FUNC__ \ 813 || defined __cplusplus || defined _MSC_VER) 814static void 815yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 816#else 817static void 818yy_symbol_value_print (yyoutput, yytype, yyvaluep) 819 FILE *yyoutput; 820 int yytype; 821 YYSTYPE const * const yyvaluep; 822#endif 823{ 824 if (!yyvaluep) 825 return; 826# ifdef YYPRINT 827 if (yytype < YYNTOKENS) 828 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 829# else 830 YYUSE (yyoutput); 831# endif 832 switch (yytype) 833 { 834 default: 835 break; 836 } 837} 838 839 840/*--------------------------------. 841| Print this symbol on YYOUTPUT. | 842`--------------------------------*/ 843 844#if (defined __STDC__ || defined __C99__FUNC__ \ 845 || defined __cplusplus || defined _MSC_VER) 846static void 847yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 848#else 849static void 850yy_symbol_print (yyoutput, yytype, yyvaluep) 851 FILE *yyoutput; 852 int yytype; 853 YYSTYPE const * const yyvaluep; 854#endif 855{ 856 if (yytype < YYNTOKENS) 857 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 858 else 859 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 860 861 yy_symbol_value_print (yyoutput, yytype, yyvaluep); 862 YYFPRINTF (yyoutput, ")"); 863} 864 865/*------------------------------------------------------------------. 866| yy_stack_print -- Print the state stack from its BOTTOM up to its | 867| TOP (included). | 868`------------------------------------------------------------------*/ 869 870#if (defined __STDC__ || defined __C99__FUNC__ \ 871 || defined __cplusplus || defined _MSC_VER) 872static void 873yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) 874#else 875static void 876yy_stack_print (bottom, top) 877 yytype_int16 *bottom; 878 yytype_int16 *top; 879#endif 880{ 881 YYFPRINTF (stderr, "Stack now"); 882 for (; bottom <= top; ++bottom) 883 YYFPRINTF (stderr, " %d", *bottom); 884 YYFPRINTF (stderr, "\n"); 885} 886 887# define YY_STACK_PRINT(Bottom, Top) \ 888do { \ 889 if (yydebug) \ 890 yy_stack_print ((Bottom), (Top)); \ 891} while (YYID (0)) 892 893 894/*------------------------------------------------. 895| Report that the YYRULE is going to be reduced. | 896`------------------------------------------------*/ 897 898#if (defined __STDC__ || defined __C99__FUNC__ \ 899 || defined __cplusplus || defined _MSC_VER) 900static void 901yy_reduce_print (YYSTYPE *yyvsp, int yyrule) 902#else 903static void 904yy_reduce_print (yyvsp, yyrule) 905 YYSTYPE *yyvsp; 906 int yyrule; 907#endif 908{ 909 int yynrhs = yyr2[yyrule]; 910 int yyi; 911 unsigned long int yylno = yyrline[yyrule]; 912 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 913 yyrule - 1, yylno); 914 /* The symbols being reduced. */ 915 for (yyi = 0; yyi < yynrhs; yyi++) 916 { 917 fprintf (stderr, " $%d = ", yyi + 1); 918 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 919 &(yyvsp[(yyi + 1) - (yynrhs)]) 920 ); 921 fprintf (stderr, "\n"); 922 } 923} 924 925# define YY_REDUCE_PRINT(Rule) \ 926do { \ 927 if (yydebug) \ 928 yy_reduce_print (yyvsp, Rule); \ 929} while (YYID (0)) 930 931/* Nonzero means print parse trace. It is left uninitialized so that 932 multiple parsers can coexist. */ 933int yydebug; 934#else /* !YYDEBUG */ 935# define YYDPRINTF(Args) 936# define YY_SYMBOL_PRINT(Title, Type, Value, Location) 937# define YY_STACK_PRINT(Bottom, Top) 938# define YY_REDUCE_PRINT(Rule) 939#endif /* !YYDEBUG */ 940 941 942/* YYINITDEPTH -- initial size of the parser's stacks. */ 943#ifndef YYINITDEPTH 944# define YYINITDEPTH 200 945#endif 946 947/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 948 if the built-in stack extension method is used). 949 950 Do not make this value too large; the results are undefined if 951 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 952 evaluated with infinite-precision integer arithmetic. */ 953 954#ifndef YYMAXDEPTH 955# define YYMAXDEPTH 10000 956#endif 957 958 959 960#if YYERROR_VERBOSE 961 962# ifndef yystrlen 963# if defined __GLIBC__ && defined _STRING_H 964# define yystrlen strlen 965# else 966/* Return the length of YYSTR. */ 967#if (defined __STDC__ || defined __C99__FUNC__ \ 968 || defined __cplusplus || defined _MSC_VER) 969static YYSIZE_T 970yystrlen (const char *yystr) 971#else 972static YYSIZE_T 973yystrlen (yystr) 974 const char *yystr; 975#endif 976{ 977 YYSIZE_T yylen; 978 for (yylen = 0; yystr[yylen]; yylen++) 979 continue; 980 return yylen; 981} 982# endif 983# endif 984 985# ifndef yystpcpy 986# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 987# define yystpcpy stpcpy 988# else 989/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 990 YYDEST. */ 991#if (defined __STDC__ || defined __C99__FUNC__ \ 992 || defined __cplusplus || defined _MSC_VER) 993static char * 994yystpcpy (char *yydest, const char *yysrc) 995#else 996static char * 997yystpcpy (yydest, yysrc) 998 char *yydest; 999 const char *yysrc; 1000#endif 1001{ 1002 char *yyd = yydest; 1003 const char *yys = yysrc; 1004 1005 while ((*yyd++ = *yys++) != '\0') 1006 continue; 1007 1008 return yyd - 1; 1009} 1010# endif 1011# endif 1012 1013# ifndef yytnamerr 1014/* Copy to YYRES the contents of YYSTR after stripping away unnecessary 1015 quotes and backslashes, so that it's suitable for yyerror. The 1016 heuristic is that double-quoting is unnecessary unless the string 1017 contains an apostrophe, a comma, or backslash (other than 1018 backslash-backslash). YYSTR is taken from yytname. If YYRES is 1019 null, do not copy; instead, return the length of what the result 1020 would have been. */ 1021static YYSIZE_T 1022yytnamerr (char *yyres, const char *yystr) 1023{ 1024 if (*yystr == '"') 1025 { 1026 YYSIZE_T yyn = 0; 1027 char const *yyp = yystr; 1028 1029 for (;;) 1030 switch (*++yyp) 1031 { 1032 case '\'': 1033 case ',': 1034 goto do_not_strip_quotes; 1035 1036 case '\\': 1037 if (*++yyp != '\\') 1038 goto do_not_strip_quotes; 1039 /* Fall through. */ 1040 default: 1041 if (yyres) 1042 yyres[yyn] = *yyp; 1043 yyn++; 1044 break; 1045 1046 case '"': 1047 if (yyres) 1048 yyres[yyn] = '\0'; 1049 return yyn; 1050 } 1051 do_not_strip_quotes: ; 1052 } 1053 1054 if (! yyres) 1055 return yystrlen (yystr); 1056 1057 return yystpcpy (yyres, yystr) - yyres; 1058} 1059# endif 1060 1061/* Copy into YYRESULT an error message about the unexpected token 1062 YYCHAR while in state YYSTATE. Return the number of bytes copied, 1063 including the terminating null byte. If YYRESULT is null, do not 1064 copy anything; just return the number of bytes that would be 1065 copied. As a special case, return 0 if an ordinary "syntax error" 1066 message will do. Return YYSIZE_MAXIMUM if overflow occurs during 1067 size calculation. */ 1068static YYSIZE_T 1069yysyntax_error (char *yyresult, int yystate, int yychar) 1070{ 1071 int yyn = yypact[yystate]; 1072 1073 if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) 1074 return 0; 1075 else 1076 { 1077 int yytype = YYTRANSLATE (yychar); 1078 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); 1079 YYSIZE_T yysize = yysize0; 1080 YYSIZE_T yysize1; 1081 int yysize_overflow = 0; 1082 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 1083 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 1084 int yyx; 1085 1086# if 0 1087 /* This is so xgettext sees the translatable formats that are 1088 constructed on the fly. */ 1089 YY_("syntax error, unexpected %s"); 1090 YY_("syntax error, unexpected %s, expecting %s"); 1091 YY_("syntax error, unexpected %s, expecting %s or %s"); 1092 YY_("syntax error, unexpected %s, expecting %s or %s or %s"); 1093 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); 1094# endif 1095 char *yyfmt; 1096 char const *yyf; 1097 static char const yyunexpected[] = "syntax error, unexpected %s"; 1098 static char const yyexpecting[] = ", expecting %s"; 1099 static char const yyor[] = " or %s"; 1100 char yyformat[sizeof yyunexpected 1101 + sizeof yyexpecting - 1 1102 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) 1103 * (sizeof yyor - 1))]; 1104 char const *yyprefix = yyexpecting; 1105 1106 /* Start YYX at -YYN if negative to avoid negative indexes in 1107 YYCHECK. */ 1108 int yyxbegin = yyn < 0 ? -yyn : 0; 1109 1110 /* Stay within bounds of both yycheck and yytname. */ 1111 int yychecklim = YYLAST - yyn + 1; 1112 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 1113 int yycount = 1; 1114 1115 yyarg[0] = yytname[yytype]; 1116 yyfmt = yystpcpy (yyformat, yyunexpected); 1117 1118 for (yyx = yyxbegin; yyx < yyxend; ++yyx) 1119 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) 1120 { 1121 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 1122 { 1123 yycount = 1; 1124 yysize = yysize0; 1125 yyformat[sizeof yyunexpected - 1] = '\0'; 1126 break; 1127 } 1128 yyarg[yycount++] = yytname[yyx]; 1129 yysize1 = yysize + yytnamerr (0, yytname[yyx]); 1130 yysize_overflow |= (yysize1 < yysize); 1131 yysize = yysize1; 1132 yyfmt = yystpcpy (yyfmt, yyprefix); 1133 yyprefix = yyor; 1134 } 1135 1136 yyf = YY_(yyformat); 1137 yysize1 = yysize + yystrlen (yyf); 1138 yysize_overflow |= (yysize1 < yysize); 1139 yysize = yysize1; 1140 1141 if (yysize_overflow) 1142 return YYSIZE_MAXIMUM; 1143 1144 if (yyresult) 1145 { 1146 /* Avoid sprintf, as that infringes on the user's name space. 1147 Don't have undefined behavior even if the translation 1148 produced a string with the wrong number of "%s"s. */ 1149 char *yyp = yyresult; 1150 int yyi = 0; 1151 while ((*yyp = *yyf) != '\0') 1152 { 1153 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) 1154 { 1155 yyp += yytnamerr (yyp, yyarg[yyi++]); 1156 yyf += 2; 1157 } 1158 else 1159 { 1160 yyp++; 1161 yyf++; 1162 } 1163 } 1164 } 1165 return yysize; 1166 } 1167} 1168#endif /* YYERROR_VERBOSE */ 1169 1170 1171/*-----------------------------------------------. 1172| Release the memory associated to this symbol. | 1173`-----------------------------------------------*/ 1174 1175/*ARGSUSED*/ 1176#if (defined __STDC__ || defined __C99__FUNC__ \ 1177 || defined __cplusplus || defined _MSC_VER) 1178static void 1179yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 1180#else 1181static void 1182yydestruct (yymsg, yytype, yyvaluep) 1183 const char *yymsg; 1184 int yytype; 1185 YYSTYPE *yyvaluep; 1186#endif 1187{ 1188 YYUSE (yyvaluep); 1189 1190 if (!yymsg) 1191 yymsg = "Deleting"; 1192 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 1193 1194 switch (yytype) 1195 { 1196 1197 default: 1198 break; 1199 } 1200} 1201 1202 1203/* Prevent warnings from -Wmissing-prototypes. */ 1204 1205#ifdef YYPARSE_PARAM 1206#if defined __STDC__ || defined __cplusplus 1207int yyparse (void *YYPARSE_PARAM); 1208#else 1209int yyparse (); 1210#endif 1211#else /* ! YYPARSE_PARAM */ 1212#if defined __STDC__ || defined __cplusplus 1213int yyparse (void); 1214#else 1215int yyparse (); 1216#endif 1217#endif /* ! YYPARSE_PARAM */ 1218 1219 1220 1221/* The look-ahead symbol. */ 1222int yychar; 1223 1224/* The semantic value of the look-ahead symbol. */ 1225YYSTYPE yylval; 1226 1227/* Number of syntax errors so far. */ 1228int yynerrs; 1229 1230 1231 1232/*----------. 1233| yyparse. | 1234`----------*/ 1235 1236#ifdef YYPARSE_PARAM 1237#if (defined __STDC__ || defined __C99__FUNC__ \ 1238 || defined __cplusplus || defined _MSC_VER) 1239int 1240yyparse (void *YYPARSE_PARAM) 1241#else 1242int 1243yyparse (YYPARSE_PARAM) 1244 void *YYPARSE_PARAM; 1245#endif 1246#else /* ! YYPARSE_PARAM */ 1247#if (defined __STDC__ || defined __C99__FUNC__ \ 1248 || defined __cplusplus || defined _MSC_VER) 1249int 1250yyparse (void) 1251#else 1252int 1253yyparse () 1254 1255#endif 1256#endif 1257{ 1258 1259 int yystate; 1260 int yyn; 1261 int yyresult; 1262 /* Number of tokens to shift before error messages enabled. */ 1263 int yyerrstatus; 1264 /* Look-ahead token as an internal (translated) token number. */ 1265 int yytoken = 0; 1266#if YYERROR_VERBOSE 1267 /* Buffer for error messages, and its allocated size. */ 1268 char yymsgbuf[128]; 1269 char *yymsg = yymsgbuf; 1270 YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 1271#endif 1272 1273 /* Three stacks and their tools: 1274 `yyss': related to states, 1275 `yyvs': related to semantic values, 1276 `yyls': related to locations. 1277 1278 Refer to the stacks thru separate pointers, to allow yyoverflow 1279 to reallocate them elsewhere. */ 1280 1281 /* The state stack. */ 1282 yytype_int16 yyssa[YYINITDEPTH]; 1283 yytype_int16 *yyss = yyssa; 1284 yytype_int16 *yyssp; 1285 1286 /* The semantic value stack. */ 1287 YYSTYPE yyvsa[YYINITDEPTH]; 1288 YYSTYPE *yyvs = yyvsa; 1289 YYSTYPE *yyvsp; 1290 1291 1292 1293#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1294 1295 YYSIZE_T yystacksize = YYINITDEPTH; 1296 1297 /* The variables used to return semantic value and location from the 1298 action routines. */ 1299 YYSTYPE yyval; 1300 1301 1302 /* The number of symbols on the RHS of the reduced rule. 1303 Keep to zero when no symbol should be popped. */ 1304 int yylen = 0; 1305 1306 YYDPRINTF ((stderr, "Starting parse\n")); 1307 1308 yystate = 0; 1309 yyerrstatus = 0; 1310 yynerrs = 0; 1311 yychar = YYEMPTY; /* Cause a token to be read. */ 1312 1313 /* Initialize stack pointers. 1314 Waste one element of value and location stack 1315 so that they stay on the same level as the state stack. 1316 The wasted elements are never initialized. */ 1317 1318 yyssp = yyss; 1319 yyvsp = yyvs; 1320 1321 goto yysetstate; 1322 1323/*------------------------------------------------------------. 1324| yynewstate -- Push a new state, which is found in yystate. | 1325`------------------------------------------------------------*/ 1326 yynewstate: 1327 /* In all cases, when you get here, the value and location stacks 1328 have just been pushed. So pushing a state here evens the stacks. */ 1329 yyssp++; 1330 1331 yysetstate: 1332 *yyssp = yystate; 1333 1334 if (yyss + yystacksize - 1 <= yyssp) 1335 { 1336 /* Get the current used size of the three stacks, in elements. */ 1337 YYSIZE_T yysize = yyssp - yyss + 1; 1338 1339#ifdef yyoverflow 1340 { 1341 /* Give user a chance to reallocate the stack. Use copies of 1342 these so that the &'s don't force the real ones into 1343 memory. */ 1344 YYSTYPE *yyvs1 = yyvs; 1345 yytype_int16 *yyss1 = yyss; 1346 1347 1348 /* Each stack pointer address is followed by the size of the 1349 data in use in that stack, in bytes. This used to be a 1350 conditional around just the two extra args, but that might 1351 be undefined if yyoverflow is a macro. */ 1352 yyoverflow (YY_("memory exhausted"), 1353 &yyss1, yysize * sizeof (*yyssp), 1354 &yyvs1, yysize * sizeof (*yyvsp), 1355 1356 &yystacksize); 1357 1358 yyss = yyss1; 1359 yyvs = yyvs1; 1360 } 1361#else /* no yyoverflow */ 1362# ifndef YYSTACK_RELOCATE 1363 goto yyexhaustedlab; 1364# else 1365 /* Extend the stack our own way. */ 1366 if (YYMAXDEPTH <= yystacksize) 1367 goto yyexhaustedlab; 1368 yystacksize *= 2; 1369 if (YYMAXDEPTH < yystacksize) 1370 yystacksize = YYMAXDEPTH; 1371 1372 { 1373 yytype_int16 *yyss1 = yyss; 1374 union yyalloc *yyptr = 1375 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1376 if (! yyptr) 1377 goto yyexhaustedlab; 1378 YYSTACK_RELOCATE (yyss); 1379 YYSTACK_RELOCATE (yyvs); 1380 1381# undef YYSTACK_RELOCATE 1382 if (yyss1 != yyssa) 1383 YYSTACK_FREE (yyss1); 1384 } 1385# endif 1386#endif /* no yyoverflow */ 1387 1388 yyssp = yyss + yysize - 1; 1389 yyvsp = yyvs + yysize - 1; 1390 1391 1392 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1393 (unsigned long int) yystacksize)); 1394 1395 if (yyss + yystacksize - 1 <= yyssp) 1396 YYABORT; 1397 } 1398 1399 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 1400 1401 goto yybackup; 1402 1403/*-----------. 1404| yybackup. | 1405`-----------*/ 1406yybackup: 1407 1408 /* Do appropriate processing given the current state. Read a 1409 look-ahead token if we need one and don't already have one. */ 1410 1411 /* First try to decide what to do without reference to look-ahead token. */ 1412 yyn = yypact[yystate]; 1413 if (yyn == YYPACT_NINF) 1414 goto yydefault; 1415 1416 /* Not known => get a look-ahead token if don't already have one. */ 1417 1418 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ 1419 if (yychar == YYEMPTY) 1420 { 1421 YYDPRINTF ((stderr, "Reading a token: ")); 1422 yychar = YYLEX; 1423 } 1424 1425 if (yychar <= YYEOF) 1426 { 1427 yychar = yytoken = YYEOF; 1428 YYDPRINTF ((stderr, "Now at end of input.\n")); 1429 } 1430 else 1431 { 1432 yytoken = YYTRANSLATE (yychar); 1433 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 1434 } 1435 1436 /* If the proper action on seeing token YYTOKEN is to reduce or to 1437 detect an error, take that action. */ 1438 yyn += yytoken; 1439 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 1440 goto yydefault; 1441 yyn = yytable[yyn]; 1442 if (yyn <= 0) 1443 { 1444 if (yyn == 0 || yyn == YYTABLE_NINF) 1445 goto yyerrlab; 1446 yyn = -yyn; 1447 goto yyreduce; 1448 } 1449 1450 if (yyn == YYFINAL) 1451 YYACCEPT; 1452 1453 /* Count tokens shifted since error; after three, turn off error 1454 status. */ 1455 if (yyerrstatus) 1456 yyerrstatus--; 1457 1458 /* Shift the look-ahead token. */ 1459 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 1460 1461 /* Discard the shifted token unless it is eof. */ 1462 if (yychar != YYEOF) 1463 yychar = YYEMPTY; 1464 1465 yystate = yyn; 1466 *++yyvsp = yylval; 1467 1468 goto yynewstate; 1469 1470 1471/*-----------------------------------------------------------. 1472| yydefault -- do the default action for the current state. | 1473`-----------------------------------------------------------*/ 1474yydefault: 1475 yyn = yydefact[yystate]; 1476 if (yyn == 0) 1477 goto yyerrlab; 1478 goto yyreduce; 1479 1480 1481/*-----------------------------. 1482| yyreduce -- Do a reduction. | 1483`-----------------------------*/ 1484yyreduce: 1485 /* yyn is the number of a rule to reduce with. */ 1486 yylen = yyr2[yyn]; 1487 1488 /* If YYLEN is nonzero, implement the default value of the action: 1489 `$$ = $1'. 1490 1491 Otherwise, the following line sets YYVAL to garbage. 1492 This behavior is undocumented and Bison 1493 users should not rely upon it. Assigning to YYVAL 1494 unconditionally makes the parser a bit smaller, and it avoids a 1495 GCC warning that YYVAL may be used uninitialized. */ 1496 yyval = yyvsp[1-yylen]; 1497 1498 1499 YY_REDUCE_PRINT (yyn); 1500 switch (yyn) 1501 { 1502 case 4: 1503#line 52 "defparse.y" 1504 { def_name ((yyvsp[(2) - (3)].id), (yyvsp[(3) - (3)].number)); } 1505 break; 1506 1507 case 5: 1508#line 53 "defparse.y" 1509 { def_library ((yyvsp[(2) - (4)].id), (yyvsp[(3) - (4)].number)); } 1510 break; 1511 1512 case 7: 1513#line 55 "defparse.y" 1514 { def_description ((yyvsp[(2) - (2)].id));} 1515 break; 1516 1517 case 8: 1518#line 56 "defparse.y" 1519 { def_stacksize ((yyvsp[(2) - (3)].number), (yyvsp[(3) - (3)].number));} 1520 break; 1521 1522 case 9: 1523#line 57 "defparse.y" 1524 { def_heapsize ((yyvsp[(2) - (3)].number), (yyvsp[(3) - (3)].number));} 1525 break; 1526 1527 case 10: 1528#line 58 "defparse.y" 1529 { def_code ((yyvsp[(2) - (2)].number));} 1530 break; 1531 1532 case 11: 1533#line 59 "defparse.y" 1534 { def_data ((yyvsp[(2) - (2)].number));} 1535 break; 1536 1537 case 14: 1538#line 62 "defparse.y" 1539 { def_version ((yyvsp[(2) - (2)].number),0);} 1540 break; 1541 1542 case 15: 1543#line 63 "defparse.y" 1544 { def_version ((yyvsp[(2) - (4)].number),(yyvsp[(4) - (4)].number));} 1545 break; 1546 1547 case 18: 1548#line 75 "defparse.y" 1549 { def_exports ((yyvsp[(1) - (8)].id), (yyvsp[(2) - (8)].id), (yyvsp[(3) - (8)].number), (yyvsp[(4) - (8)].number), (yyvsp[(5) - (8)].number), (yyvsp[(6) - (8)].number), (yyvsp[(7) - (8)].number), (yyvsp[(8) - (8)].id));} 1550 break; 1551 1552 case 21: 1553#line 84 "defparse.y" 1554 { def_import ((yyvsp[(1) - (8)].id),(yyvsp[(3) - (8)].id),(yyvsp[(5) - (8)].id),(yyvsp[(7) - (8)].id), 0, (yyvsp[(8) - (8)].id)); } 1555 break; 1556 1557 case 22: 1558#line 86 "defparse.y" 1559 { def_import ((yyvsp[(1) - (8)].id),(yyvsp[(3) - (8)].id),(yyvsp[(5) - (8)].id), 0,(yyvsp[(7) - (8)].number), (yyvsp[(8) - (8)].id)); } 1560 break; 1561 1562 case 23: 1563#line 88 "defparse.y" 1564 { def_import ((yyvsp[(1) - (6)].id),(yyvsp[(3) - (6)].id), 0,(yyvsp[(5) - (6)].id), 0, (yyvsp[(6) - (6)].id)); } 1565 break; 1566 1567 case 24: 1568#line 90 "defparse.y" 1569 { def_import ((yyvsp[(1) - (6)].id),(yyvsp[(3) - (6)].id), 0, 0,(yyvsp[(5) - (6)].number), (yyvsp[(6) - (6)].id)); } 1570 break; 1571 1572 case 25: 1573#line 92 "defparse.y" 1574 { def_import ( 0,(yyvsp[(1) - (6)].id),(yyvsp[(3) - (6)].id),(yyvsp[(5) - (6)].id), 0, (yyvsp[(6) - (6)].id)); } 1575 break; 1576 1577 case 26: 1578#line 94 "defparse.y" 1579 { def_import ( 0,(yyvsp[(1) - (6)].id),(yyvsp[(3) - (6)].id), 0,(yyvsp[(5) - (6)].number), (yyvsp[(6) - (6)].id)); } 1580 break; 1581 1582 case 27: 1583#line 96 "defparse.y" 1584 { def_import ( 0,(yyvsp[(1) - (4)].id), 0,(yyvsp[(3) - (4)].id), 0, (yyvsp[(4) - (4)].id)); } 1585 break; 1586 1587 case 28: 1588#line 98 "defparse.y" 1589 { def_import ( 0,(yyvsp[(1) - (4)].id), 0, 0,(yyvsp[(3) - (4)].number), (yyvsp[(4) - (4)].id)); } 1590 break; 1591 1592 case 31: 1593#line 107 "defparse.y" 1594 { def_section ((yyvsp[(1) - (2)].id),(yyvsp[(2) - (2)].number));} 1595 break; 1596 1597 case 36: 1598#line 119 "defparse.y" 1599 { (yyval.number)=(yyvsp[(2) - (2)].number);} 1600 break; 1601 1602 case 37: 1603#line 120 "defparse.y" 1604 { (yyval.number)=-1;} 1605 break; 1606 1607 case 38: 1608#line 124 "defparse.y" 1609 { (yyval.number) = 1; } 1610 break; 1611 1612 case 39: 1613#line 125 "defparse.y" 1614 { (yyval.number) = 2; } 1615 break; 1616 1617 case 40: 1618#line 126 "defparse.y" 1619 { (yyval.number) = 4; } 1620 break; 1621 1622 case 41: 1623#line 127 "defparse.y" 1624 { (yyval.number) = 8; } 1625 break; 1626 1627 case 42: 1628#line 128 "defparse.y" 1629 { (yyval.number) = 0; } 1630 break; 1631 1632 case 43: 1633#line 129 "defparse.y" 1634 { (yyval.number) = 0; } 1635 break; 1636 1637 case 44: 1638#line 130 "defparse.y" 1639 { (yyval.number) = 0; } 1640 break; 1641 1642 case 45: 1643#line 134 "defparse.y" 1644 {(yyval.number)=1;} 1645 break; 1646 1647 case 46: 1648#line 135 "defparse.y" 1649 {(yyval.number)=0;} 1650 break; 1651 1652 case 47: 1653#line 139 "defparse.y" 1654 {(yyval.number)=1;} 1655 break; 1656 1657 case 48: 1658#line 140 "defparse.y" 1659 {(yyval.number)=0;} 1660 break; 1661 1662 case 49: 1663#line 144 "defparse.y" 1664 { (yyval.number) = 1; } 1665 break; 1666 1667 case 50: 1668#line 145 "defparse.y" 1669 { (yyval.number) = 0; } 1670 break; 1671 1672 case 51: 1673#line 149 "defparse.y" 1674 { (yyval.number) = 1; } 1675 break; 1676 1677 case 52: 1678#line 150 "defparse.y" 1679 { (yyval.number) = 0; } 1680 break; 1681 1682 case 53: 1683#line 153 "defparse.y" 1684 { (yyval.id) =(yyvsp[(1) - (1)].id); } 1685 break; 1686 1687 case 54: 1688#line 155 "defparse.y" 1689 { 1690 char *name = xmalloc (strlen ((yyvsp[(1) - (3)].id)) + 1 + strlen ((yyvsp[(3) - (3)].id)) + 1); 1691 sprintf (name, "%s.%s", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id)); 1692 (yyval.id) = name; 1693 } 1694 break; 1695 1696 case 55: 1697#line 160 "defparse.y" 1698 { (yyval.id)=""; } 1699 break; 1700 1701 case 56: 1702#line 164 "defparse.y" 1703 { (yyval.number)=(yyvsp[(2) - (2)].number);} 1704 break; 1705 1706 case 57: 1707#line 165 "defparse.y" 1708 { (yyval.number)=-1;} 1709 break; 1710 1711 case 58: 1712#line 169 "defparse.y" 1713 { (yyval.id) = (yyvsp[(2) - (2)].id); } 1714 break; 1715 1716 case 59: 1717#line 170 "defparse.y" 1718 { (yyval.id) = 0; } 1719 break; 1720 1721 case 60: 1722#line 174 "defparse.y" 1723 { (yyval.id) = (yyvsp[(2) - (2)].id); } 1724 break; 1725 1726 case 61: 1727#line 176 "defparse.y" 1728 { 1729 char *name = xmalloc (strlen ((yyvsp[(2) - (4)].id)) + 1 + strlen ((yyvsp[(4) - (4)].id)) + 1); 1730 sprintf (name, "%s.%s", (yyvsp[(2) - (4)].id), (yyvsp[(4) - (4)].id)); 1731 (yyval.id) = name; 1732 } 1733 break; 1734 1735 case 62: 1736#line 181 "defparse.y" 1737 { (yyval.id) = 0; } 1738 break; 1739 1740 case 63: 1741#line 184 "defparse.y" 1742 { (yyval.number)= (yyvsp[(3) - (3)].number);} 1743 break; 1744 1745 case 64: 1746#line 185 "defparse.y" 1747 { (yyval.number)=-1;} 1748 break; 1749 1750 1751/* Line 1267 of yacc.c. */ 1752#line 1753 "defparse.c" 1753 default: break; 1754 } 1755 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 1756 1757 YYPOPSTACK (yylen); 1758 yylen = 0; 1759 YY_STACK_PRINT (yyss, yyssp); 1760 1761 *++yyvsp = yyval; 1762 1763 1764 /* Now `shift' the result of the reduction. Determine what state 1765 that goes to, based on the state we popped back to and the rule 1766 number reduced by. */ 1767 1768 yyn = yyr1[yyn]; 1769 1770 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 1771 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 1772 yystate = yytable[yystate]; 1773 else 1774 yystate = yydefgoto[yyn - YYNTOKENS]; 1775 1776 goto yynewstate; 1777 1778 1779/*------------------------------------. 1780| yyerrlab -- here on detecting error | 1781`------------------------------------*/ 1782yyerrlab: 1783 /* If not already recovering from an error, report this error. */ 1784 if (!yyerrstatus) 1785 { 1786 ++yynerrs; 1787#if ! YYERROR_VERBOSE 1788 yyerror (YY_("syntax error")); 1789#else 1790 { 1791 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); 1792 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) 1793 { 1794 YYSIZE_T yyalloc = 2 * yysize; 1795 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) 1796 yyalloc = YYSTACK_ALLOC_MAXIMUM; 1797 if (yymsg != yymsgbuf) 1798 YYSTACK_FREE (yymsg); 1799 yymsg = (char *) YYSTACK_ALLOC (yyalloc); 1800 if (yymsg) 1801 yymsg_alloc = yyalloc; 1802 else 1803 { 1804 yymsg = yymsgbuf; 1805 yymsg_alloc = sizeof yymsgbuf; 1806 } 1807 } 1808 1809 if (0 < yysize && yysize <= yymsg_alloc) 1810 { 1811 (void) yysyntax_error (yymsg, yystate, yychar); 1812 yyerror (yymsg); 1813 } 1814 else 1815 { 1816 yyerror (YY_("syntax error")); 1817 if (yysize != 0) 1818 goto yyexhaustedlab; 1819 } 1820 } 1821#endif 1822 } 1823 1824 1825 1826 if (yyerrstatus == 3) 1827 { 1828 /* If just tried and failed to reuse look-ahead token after an 1829 error, discard it. */ 1830 1831 if (yychar <= YYEOF) 1832 { 1833 /* Return failure if at end of input. */ 1834 if (yychar == YYEOF) 1835 YYABORT; 1836 } 1837 else 1838 { 1839 yydestruct ("Error: discarding", 1840 yytoken, &yylval); 1841 yychar = YYEMPTY; 1842 } 1843 } 1844 1845 /* Else will try to reuse look-ahead token after shifting the error 1846 token. */ 1847 goto yyerrlab1; 1848 1849 1850/*---------------------------------------------------. 1851| yyerrorlab -- error raised explicitly by YYERROR. | 1852`---------------------------------------------------*/ 1853yyerrorlab: 1854 1855 /* Pacify compilers like GCC when the user code never invokes 1856 YYERROR and the label yyerrorlab therefore never appears in user 1857 code. */ 1858 if (/*CONSTCOND*/ 0) 1859 goto yyerrorlab; 1860 1861 /* Do not reclaim the symbols of the rule which action triggered 1862 this YYERROR. */ 1863 YYPOPSTACK (yylen); 1864 yylen = 0; 1865 YY_STACK_PRINT (yyss, yyssp); 1866 yystate = *yyssp; 1867 goto yyerrlab1; 1868 1869 1870/*-------------------------------------------------------------. 1871| yyerrlab1 -- common code for both syntax error and YYERROR. | 1872`-------------------------------------------------------------*/ 1873yyerrlab1: 1874 yyerrstatus = 3; /* Each real token shifted decrements this. */ 1875 1876 for (;;) 1877 { 1878 yyn = yypact[yystate]; 1879 if (yyn != YYPACT_NINF) 1880 { 1881 yyn += YYTERROR; 1882 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 1883 { 1884 yyn = yytable[yyn]; 1885 if (0 < yyn) 1886 break; 1887 } 1888 } 1889 1890 /* Pop the current state because it cannot handle the error token. */ 1891 if (yyssp == yyss) 1892 YYABORT; 1893 1894 1895 yydestruct ("Error: popping", 1896 yystos[yystate], yyvsp); 1897 YYPOPSTACK (1); 1898 yystate = *yyssp; 1899 YY_STACK_PRINT (yyss, yyssp); 1900 } 1901 1902 if (yyn == YYFINAL) 1903 YYACCEPT; 1904 1905 *++yyvsp = yylval; 1906 1907 1908 /* Shift the error token. */ 1909 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 1910 1911 yystate = yyn; 1912 goto yynewstate; 1913 1914 1915/*-------------------------------------. 1916| yyacceptlab -- YYACCEPT comes here. | 1917`-------------------------------------*/ 1918yyacceptlab: 1919 yyresult = 0; 1920 goto yyreturn; 1921 1922/*-----------------------------------. 1923| yyabortlab -- YYABORT comes here. | 1924`-----------------------------------*/ 1925yyabortlab: 1926 yyresult = 1; 1927 goto yyreturn; 1928 1929#ifndef yyoverflow 1930/*-------------------------------------------------. 1931| yyexhaustedlab -- memory exhaustion comes here. | 1932`-------------------------------------------------*/ 1933yyexhaustedlab: 1934 yyerror (YY_("memory exhausted")); 1935 yyresult = 2; 1936 /* Fall through. */ 1937#endif 1938 1939yyreturn: 1940 if (yychar != YYEOF && yychar != YYEMPTY) 1941 yydestruct ("Cleanup: discarding lookahead", 1942 yytoken, &yylval); 1943 /* Do not reclaim the symbols of the rule which action triggered 1944 this YYABORT or YYACCEPT. */ 1945 YYPOPSTACK (yylen); 1946 YY_STACK_PRINT (yyss, yyssp); 1947 while (yyssp != yyss) 1948 { 1949 yydestruct ("Cleanup: popping", 1950 yystos[*yyssp], yyvsp); 1951 YYPOPSTACK (1); 1952 } 1953#ifndef yyoverflow 1954 if (yyss != yyssa) 1955 YYSTACK_FREE (yyss); 1956#endif 1957#if YYERROR_VERBOSE 1958 if (yymsg != yymsgbuf) 1959 YYSTACK_FREE (yymsg); 1960#endif 1961 /* Make sure YYID is used. */ 1962 return YYID (yyresult); 1963} 1964 1965 1966 1967