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