(linenum→info "unix/slp.c:2238")

binutils/2.18/binutils/defparse.c

    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:      NAME = 258,
   70:      LIBRARY = 259,
   71:      DESCRIPTION = 260,
   72:      STACKSIZE = 261,
   73:      HEAPSIZE = 262,
   74:      CODE = 263,
   75:      DATA = 264,
   76:      SECTIONS = 265,
   77:      EXPORTS = 266,
   78:      IMPORTS = 267,
   79:      VERSIONK = 268,
   80:      BASE = 269,
   81:      CONSTANT = 270,
   82:      READ = 271,
   83:      WRITE = 272,
   84:      EXECUTE = 273,
   85:      SHARED = 274,
   86:      NONSHARED = 275,
   87:      NONAME = 276,
   88:      PRIVATE = 277,
   89:      SINGLE = 278,
   90:      MULTIPLE = 279,
   91:      INITINSTANCE = 280,
   92:      INITGLOBAL = 281,
   93:      TERMINSTANCE = 282,
   94:      TERMGLOBAL = 283,
   95:      ID = 284,
   96:      NUMBER = 285
   97:    };
   98: #endif
   99: /* Tokens.  */
  100: #define NAME 258
  101: #define LIBRARY 259
  102: #define DESCRIPTION 260
  103: #define STACKSIZE 261
  104: #define HEAPSIZE 262
  105: #define CODE 263
  106: #define DATA 264
  107: #define SECTIONS 265
  108: #define EXPORTS 266
  109: #define IMPORTS 267
  110: #define VERSIONK 268
  111: #define BASE 269
  112: #define CONSTANT 270
  113: #define READ 271
  114: #define WRITE 272
  115: #define EXECUTE 273
  116: #define SHARED 274
  117: #define NONSHARED 275
  118: #define NONAME 276
  119: #define PRIVATE 277
  120: #define SINGLE 278
  121: #define MULTIPLE 279
  122: #define INITINSTANCE 280
  123: #define INITGLOBAL 281
  124: #define TERMINSTANCE 282
  125: #define TERMGLOBAL 283
  126: #define ID 284
  127: #define NUMBER 285
  128: 
  129: 
  130: 
  131: 
  132: /* Copy the first part of user declarations.  */
  133: #line 1 "defparse.y"
  134:  /* defparse.y - parser for .def files */
  135: 
  136: /* Copyright 1995, 1997, 1998, 1999, 2001, 2004, 2007
  137:    Free Software Foundation, Inc.
  138:    
  139:    This file is part of GNU Binutils.
  140:    
  141:    This program is free software; you can redistribute it and/or modify
  142:    it under the terms of the GNU General Public License as published by
  143:    the Free Software Foundation; either version 3 of the License, or
  144:    (at your option) any later version.
  145:    
  146:    This program is distributed in the hope that it will be useful,
  147:    but WITHOUT ANY WARRANTY; without even the implied warranty of
  148:    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  149:    GNU General Public License for more details.
  150:    
  151:    You should have received a copy of the GNU General Public License
  152:    along with this program; if not, write to the Free Software
  153:    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  154:    MA 02110-1301, USA.  */
  155: 
  156: #include "sysdep.h"
  157: #include "bfd.h"
  158: #include "libiberty.h"
  159: #include "dlltool.h"
  160: 
  161: 
  162: /* Enabling traces.  */
  163: #ifndef YYDEBUG
  164: # define YYDEBUG 0
  165: #endif
  166: 
  167: /* Enabling verbose error messages.  */
  168: #ifdef YYERROR_VERBOSE
  169: # undef YYERROR_VERBOSE
  170: # define YYERROR_VERBOSE 1
  171: #else
  172: # define YYERROR_VERBOSE 0
  173: #endif
  174: 
  175: /* Enabling the token table.  */
  176: #ifndef YYTOKEN_TABLE
  177: # define YYTOKEN_TABLE 0
  178: #endif
  179: 
  180: #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
  181: typedef union YYSTYPE
  182: #line 29 "defparse.y"
  183: {
  184:   char *id;
  185:   int number;
  186: }
  187: /* Line 187 of yacc.c.  */
  188: #line 189 "defparse.c"
  189:         YYSTYPE;
  190: # define yystype YYSTYPE /* obsolescent; will be withdrawn */
  191: # define YYSTYPE_IS_DECLARED 1
  192: # define YYSTYPE_IS_TRIVIAL 1
  193: #endif
  194: 
  195: 
  196: 
  197: /* Copy the second part of user declarations.  */
  198: 
  199: 
  200: /* Line 216 of yacc.c.  */
  201: #line 202 "defparse.c"
  202: 
  203: #ifdef short
  204: # undef short
  205: #endif
  206: 
  207: #ifdef YYTYPE_UINT8
  208: typedef YYTYPE_UINT8 yytype_uint8;
  209: #else
  210: typedef unsigned char yytype_uint8;
  211: #endif
  212: 
  213: #ifdef YYTYPE_INT8
  214: typedef YYTYPE_INT8 yytype_int8;
  215: #elif (defined __STDC__ || defined __C99__FUNC__ \
  216:      || defined __cplusplus || defined _MSC_VER)
  217: typedef signed char yytype_int8;
  218: #else
  219: typedef short int yytype_int8;
  220: #endif
  221: 
  222: #ifdef YYTYPE_UINT16
  223: typedef YYTYPE_UINT16 yytype_uint16;
  224: #else
  225: typedef unsigned short int yytype_uint16;
  226: #endif
  227: 
  228: #ifdef YYTYPE_INT16
  229: typedef YYTYPE_INT16 yytype_int16;
  230: #else
  231: typedef short int yytype_int16;
  232: #endif
  233: 
  234: #ifndef YYSIZE_T
  235: # ifdef __SIZE_TYPE__
  236: #  define YYSIZE_T __SIZE_TYPE__
  237: # elif defined size_t
  238: #  define YYSIZE_T size_t
  239: # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
  240:      || defined __cplusplus || defined _MSC_VER)
  241: #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
  242: #  define YYSIZE_T size_t
  243: # else
  244: #  define YYSIZE_T unsigned int
  245: # endif
  246: #endif
  247: 
  248: #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
  249: 
  250: #ifndef YY_
  251: # if YYENABLE_NLS
  252: #  if ENABLE_NLS
  253: #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
  254: #   define YY_(msgid) dgettext ("bison-runtime", msgid)
  255: #  endif
  256: # endif
  257: # ifndef YY_
  258: #  define YY_(msgid) msgid
  259: # endif
  260: #endif
  261: 
  262: /* Suppress unused-variable warnings by "using" E.  */
  263: #if ! defined lint || defined __GNUC__
  264: # define YYUSE(e) ((void) (e))
  265: #else
  266: # define YYUSE(e) /* empty */
  267: #endif
  268: 
  269: /* Identity function, used to suppress warnings about constant conditions.  */
  270: #ifndef lint
  271: # define YYID(n) (n)
  272: #else
  273: #if (defined __STDC__ || defined __C99__FUNC__ \
  274:      || defined __cplusplus || defined _MSC_VER)
  275: static int
  276: YYID (int i)
  277: #else
  278: static int
  279: YYID (i)
  280:     int i;
  281: #endif
  282: {
  283:   return i;
  284: }
  285: #endif
  286: 
  287: #if ! defined yyoverflow || YYERROR_VERBOSE
  288: 
  289: /* The parser invokes alloca or malloc; define the necessary symbols.  */
  290: 
  291: # ifdef YYSTACK_USE_ALLOCA
  292: #  if YYSTACK_USE_ALLOCA
  293: #   ifdef __GNUC__
  294: #    define YYSTACK_ALLOC __builtin_alloca
  295: #   elif defined __BUILTIN_VA_ARG_INCR
  296: #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
  297: #   elif defined _AIX
  298: #    define YYSTACK_ALLOC __alloca
  299: #   elif defined _MSC_VER
  300: #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
  301: #    define alloca _alloca
  302: #   else
  303: #    define YYSTACK_ALLOC alloca
  304: #    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
  305:      || defined __cplusplus || defined _MSC_VER)
  306: #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  307: #     ifndef _STDLIB_H
  308: #      define _STDLIB_H 1
  309: #     endif
  310: #    endif
  311: #   endif
  312: #  endif
  313: # endif
  314: 
  315: # ifdef YYSTACK_ALLOC
  316:    /* Pacify GCC's `empty if-body' warning.  */
  317: #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
  318: #  ifndef YYSTACK_ALLOC_MAXIMUM
  319:     /* The OS might guarantee only one guard page at the bottom of the stack,
  320:        and a page size can be as small as 4096 bytes.  So we cannot safely
  321:        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
  322:        to allow for a few compiler-allocated temporary stack slots.  */
  323: #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
  324: #  endif
  325: # else
  326: #  define YYSTACK_ALLOC YYMALLOC
  327: #  define YYSTACK_FREE YYFREE
  328: #  ifndef YYSTACK_ALLOC_MAXIMUM
  329: #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
  330: #  endif
  331: #  if (defined __cplusplus && ! defined _STDLIB_H \
  332:        && ! ((defined YYMALLOC || defined malloc) \
  333:              && (defined YYFREE || defined free)))
  334: #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  335: #   ifndef _STDLIB_H
  336: #    define _STDLIB_H 1
  337: #   endif
  338: #  endif
  339: #  ifndef YYMALLOC
  340: #   define YYMALLOC malloc
  341: #   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
  342:      || defined __cplusplus || defined _MSC_VER)
  343: void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
  344: #   endif
  345: #  endif
  346: #  ifndef YYFREE
  347: #   define YYFREE free
  348: #   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
  349:      || defined __cplusplus || defined _MSC_VER)
  350: void free (void *); /* INFRINGES ON USER NAME SPACE */
  351: #   endif
  352: #  endif
  353: # endif
  354: #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
  355: 
  356: 
  357: #if (! defined yyoverflow \
  358:      && (! defined __cplusplus \
  359:          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
  360: 
  361: /* A type that is properly aligned for any stack member.  */
  362: union yyalloc
  363: {
  364:   yytype_int16 yyss;
  365:   YYSTYPE yyvs;
  366:   };
  367: 
  368: /* The size of the maximum gap between one aligned stack and the next.  */
  369: # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
  370: 
  371: /* The size of an array large to enough to hold all stacks, each with
  372:    N elements.  */
  373: # define YYSTACK_BYTES(N) \
  374:      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
  375:       + YYSTACK_GAP_MAXIMUM)
  376: 
  377: /* Copy COUNT objects from FROM to TO.  The source and destination do
  378:    not overlap.  */
  379: # ifndef YYCOPY
  380: #  if defined __GNUC__ && 1 < __GNUC__
  381: #   define YYCOPY(To, From, Count) \
  382:       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
  383: #  else
  384: #   define YYCOPY(To, From, Count)              \
  385:       do                                        \
  386:         {                                      \
  387:           YYSIZE_T yyi;                                \
  388:           for (yyi = 0; yyi < (Count); yyi++)  \
  389:             (To)[yyi] = (From)[yyi];           \
  390:         }                                      \
  391:       while (YYID (0))
  392: #  endif
  393: # endif
  394: 
  395: /* Relocate STACK from its old location to the new one.  The
  396:    local variables YYSIZE and YYSTACKSIZE give the old and new number of
  397:    elements in the stack, and YYPTR gives the new location of the
  398:    stack.  Advance YYPTR to a properly aligned location for the next
  399:    stack.  */
  400: # define YYSTACK_RELOCATE(Stack)                                        \
  401:     do                                                                  \
  402:       {                                                                 \
  403:         YYSIZE_T yynewbytes;                                           \
  404:         YYCOPY (&yyptr->Stack, Stack, yysize);                         \
  405:         Stack = &yyptr->Stack;                                         \
  406:         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
  407:         yyptr += yynewbytes / sizeof (*yyptr);                         \
  408:       }                                                                 \
  409:     while (YYID (0))
  410: 
  411: #endif
  412: 
  413: /* YYFINAL -- State number of the termination state.  */
  414: #define YYFINAL  38
  415: /* YYLAST -- Last index in YYTABLE.  */
  416: #define YYLAST   114
  417: 
  418: /* YYNTOKENS -- Number of terminals.  */
  419: #define YYNTOKENS  35
  420: /* YYNNTS -- Number of nonterminals.  */
  421: #define YYNNTS  23
  422: /* YYNRULES -- Number of rules.  */
  423: #define YYNRULES  68
  424: /* YYNRULES -- Number of states.  */
  425: #define YYNSTATES  98
  426: 
  427: /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
  428: #define YYUNDEFTOK  2
  429: #define YYMAXUTOK   285
  430: 
  431: #define YYTRANSLATE(YYX)                                                \
  432:   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
  433: 
  434: /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
  435: static const yytype_uint8 yytranslate[] =
  436: {
  437:        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  438:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  439:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  440:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  441:        2,     2,     2,     2,    33,     2,    31,     2,     2,     2,
  442:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  443:        2,    32,     2,     2,    34,     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,     2,     2,     2,     2,
  459:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  460:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  461:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  462:        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
  463:        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
  464:       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
  465:       25,    26,    27,    28,    29,    30
  466: };
  467: 
  468: #if YYDEBUG
  469: /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
  470:    YYRHS.  */
  471: static const yytype_uint8 yyprhs[] =
  472: {
  473:        0,     0,     3,     6,     8,    12,    17,    20,    23,    27,
  474:       31,    34,    37,    40,    43,    46,    51,    52,    55,    63,
  475:       66,    68,    76,    84,    90,    96,   102,   108,   112,   116,
  476:      119,   121,   124,   128,   130,   132,   133,   136,   137,   139,
  477:      141,   143,   145,   147,   149,   151,   153,   154,   156,   157,
  478:      159,   160,   162,   163,   165,   169,   170,   173,   174,   177,
  479:      182,   183,   187,   188,   189,   193,   195,   197,   199
  480: };
  481: 
  482: /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
  483: static const yytype_int8 yyrhs[] =
  484: {
  485:       36,     0,    -1,    36,    37,    -1,    37,    -1,     3,    52,
  486:       55,    -1,     4,    52,    55,    56,    -1,    11,