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