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