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