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

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