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