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