Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  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, 2005, 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 193 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 defined YYENABLE_NLS && 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,
  488.       85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
  489.       95,    96,    97,   102,   107,   112,   117,   121,   126,   131,
  490.      138,   143,   149,   153,   160,   162,   166,   169,   173,   179,
  491.      184,   185,   190
  492. };
  493. #endif
  494.  
  495. #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
  496. /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
  497.    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
  498. static const char *const yytname[] =
  499. {
  500.   "$end", "error", "$undefined", "NEWLINE", "VERBOSE", "FILENAME",
  501.   "ADDLIB", "LIST", "ADDMOD", "CLEAR", "CREATE", "DELETE", "DIRECTORY",
  502.   "END", "EXTRACT", "FULLDIR", "HELP", "QUIT", "REPLACE", "SAVE", "OPEN",
  503.   "'('", "')'", "','", "$accept", "start", "@1", "session", "command_line",
  504.   "command", "extract_command", "replace_command", "clear_command",
  505.   "delete_command", "addmod_command", "list_command", "save_command",
  506.   "open_command", "create_command", "addlib_command", "directory_command",
  507.   "optional_filename", "modulelist", "modulename", "optcomma",
  508.   "verbose_command", 0
  509. };
  510. #endif
  511.  
  512. # ifdef YYPRINT
  513. /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
  514.    token YYLEX-NUM.  */
  515. static const yytype_uint16 yytoknum[] =
  516. {
  517.        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
  518.      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
  519.      275,    40,    41,    44
  520. };
  521. # endif
  522.  
  523. /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
  524. static const yytype_uint8 yyr1[] =
  525. {
  526.        0,    24,    26,    25,    27,    27,    28,    29,    29,    29,
  527.       29,    29,    29,    29,    29,    29,    29,    29,    29,    29,
  528.       29,    29,    29,    30,    31,    32,    33,    34,    35,    36,
  529.       37,    38,    39,    40,    41,    41,    42,    42,    43,    43,
  530.       44,    44,    45
  531. };
  532.  
  533. /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
  534. static const yytype_uint8 yyr2[] =
  535. {
  536.        0,     2,     0,     2,     2,     0,     2,     1,     1,     1,
  537.        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
  538.        1,     1,     0,     2,     2,     1,     2,     2,     1,     1,
  539.        2,     2,     3,     4,     1,     0,     3,     0,     3,     0,
  540.        1,     0,     1
  541. };
  542.  
  543. /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
  544.    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
  545.    means the default is an error.  */
  546. static const yytype_uint8 yydefact[] =
  547. {
  548.        2,     0,     5,     1,     0,    20,    42,    21,     0,    28,
  549.       39,    25,     0,    39,     0,    19,    39,    39,    29,     0,
  550.        4,     0,    15,    16,    12,    17,    13,    18,    14,     7,
  551.        8,    11,    10,     9,    37,    27,    31,    26,    37,    23,
  552.       24,    30,     6,    39,    32,    40,     0,    35,    41,    38,
  553.       34,    33,    36
  554. };
  555.  
  556. /* YYDEFGOTO[NTERM-NUM].  */
  557. static const yytype_int8 yydefgoto[] =
  558. {
  559.       -1,     1,     2,     4,    20,    21,    22,    23,    24,    25,
  560.       26,    27,    28,    29,    30,    31,    32,    51,    44,    35,
  561.       46,    33
  562. };
  563.  
  564. /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
  565.    STATE-NUM.  */
  566. #define YYPACT_NINF -14
  567. static const yytype_int8 yypact[] =
  568. {
  569.      -14,     1,   -14,   -14,     5,   -14,   -14,   -14,     2,   -14,
  570.      -14,   -14,    21,   -14,    22,   -14,   -14,   -14,   -14,    23,
  571.      -14,    26,   -14,   -14,   -14,   -14,   -14,   -14,   -14,   -14,
  572.      -14,   -14,   -14,   -14,    10,    -3,   -14,    -3,    10,    -3,
  573.       -3,   -14,   -14,   -14,   -14,   -14,    27,    28,    -1,   -14,
  574.      -14,   -14,   -14
  575. };
  576.  
  577. /* YYPGOTO[NTERM-NUM].  */
  578. static const yytype_int8 yypgoto[] =
  579. {
  580.      -14,   -14,   -14,   -14,   -14,   -14,   -14,   -14,   -14,   -14,
  581.      -14,   -14,   -14,   -14,   -14,   -14,   -14,   -14,    -4,   -13,
  582.      -14,   -14
  583. };
  584.  
  585. /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
  586.    positive, shift that token.  If negative, reduce the rule which
  587.    number is the opposite.  If zero, do what YYDEFACT says.
  588.    If YYTABLE_NINF, syntax error.  */
  589. #define YYTABLE_NINF -42
  590. static const yytype_int8 yytable[] =
  591. {
  592.       37,     3,   -41,    39,    40,    -3,     5,    34,   -22,     6,
  593.        7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
  594.       45,    52,    45,    17,    18,    19,    36,    38,    41,    42,
  595.       48,    43,    49,    50,    47
  596. };
  597.  
  598. static const yytype_uint8 yycheck[] =
  599. {
  600.       13,     0,     5,    16,    17,     0,     1,     5,     3,     4,
  601.        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
  602.       23,    22,    23,    18,    19,    20,     5,     5,     5,     3,
  603.       43,    21,     5,     5,    38
  604. };
  605.  
  606. /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
  607.    symbol of state STATE-NUM.  */
  608. static const yytype_uint8 yystos[] =
  609. {
  610.        0,    25,    26,     0,    27,     1,     4,     5,     6,     7,
  611.        8,     9,    10,    11,    12,    13,    14,    18,    19,    20,
  612.       28,    29,    30,    31,    32,    33,    34,    35,    36,    37,
  613.       38,    39,    40,    45,     5,    43,     5,    43,     5,    43,
  614.       43,     5,     3,    21,    42,    23,    44,    42,    43,     5,
  615.        5,    41,    22
  616. };
  617.  
  618. #define yyerrok         (yyerrstatus = 0)
  619. #define yyclearin       (yychar = YYEMPTY)
  620. #define YYEMPTY         (-2)
  621. #define YYEOF           0
  622.  
  623. #define YYACCEPT        goto yyacceptlab
  624. #define YYABORT         goto yyabortlab
  625. #define YYERROR         goto yyerrorlab
  626.  
  627.  
  628. /* Like YYERROR except do call yyerror.  This remains here temporarily
  629.    to ease the transition to the new meaning of YYERROR, for GCC.
  630.    Once GCC version 2 has supplanted version 1, this can go.  */
  631.  
  632. #define YYFAIL          goto yyerrlab
  633.  
  634. #define YYRECOVERING()  (!!yyerrstatus)
  635.  
  636. #define YYBACKUP(Token, Value)                                  \
  637. do                                                              \
  638.   if (yychar == YYEMPTY && yylen == 1)                          \
  639.     {                                                           \
  640.       yychar = (Token);                                         \
  641.       yylval = (Value);                                         \
  642.       yytoken = YYTRANSLATE (yychar);                           \
  643.       YYPOPSTACK (1);                                           \
  644.       goto yybackup;                                            \
  645.     }                                                           \
  646.   else                                                          \
  647.     {                                                           \
  648.       yyerror (YY_("syntax error: cannot back up")); \
  649.       YYERROR;                                                  \
  650.     }                                                           \
  651. while (YYID (0))
  652.  
  653.  
  654. #define YYTERROR        1
  655. #define YYERRCODE       256
  656.  
  657.  
  658. /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
  659.    If N is 0, then set CURRENT to the empty location which ends
  660.    the previous symbol: RHS[0] (always defined).  */
  661.  
  662. #define YYRHSLOC(Rhs, K) ((Rhs)[K])
  663. #ifndef YYLLOC_DEFAULT
  664. # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
  665.     do                                                                  \
  666.       if (YYID (N))                                                    \
  667.         {                                                               \
  668.           (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
  669.           (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
  670.           (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
  671.           (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
  672.         }                                                               \
  673.       else                                                              \
  674.         {                                                               \
  675.           (Current).first_line   = (Current).last_line   =              \
  676.             YYRHSLOC (Rhs, 0).last_line;                                \
  677.           (Current).first_column = (Current).last_column =              \
  678.             YYRHSLOC (Rhs, 0).last_column;                              \
  679.         }                                                               \
  680.     while (YYID (0))
  681. #endif
  682.  
  683.  
  684. /* YY_LOCATION_PRINT -- Print the location on the stream.
  685.    This macro was not mandated originally: define only if we know
  686.    we won't break user code: when these are the locations we know.  */
  687.  
  688. #ifndef YY_LOCATION_PRINT
  689. # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
  690. #  define YY_LOCATION_PRINT(File, Loc)                  \
  691.      fprintf (File, "%d.%d-%d.%d",                      \
  692.               (Loc).first_line, (Loc).first_column,     \
  693.               (Loc).last_line,  (Loc).last_column)
  694. # else
  695. #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
  696. # endif
  697. #endif
  698.  
  699.  
  700. /* YYLEX -- calling `yylex' with the right arguments.  */
  701.  
  702. #ifdef YYLEX_PARAM
  703. # define YYLEX yylex (YYLEX_PARAM)
  704. #else
  705. # define YYLEX yylex ()
  706. #endif
  707.  
  708. /* Enable debugging if requested.  */
  709. #if YYDEBUG
  710.  
  711. # ifndef YYFPRINTF
  712. #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
  713. #  define YYFPRINTF fprintf
  714. # endif
  715.  
  716. # define YYDPRINTF(Args)                        \
  717. do {                                            \
  718.   if (yydebug)                                  \
  719.     YYFPRINTF Args;                             \
  720. } while (YYID (0))
  721.  
  722. # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
  723. do {                                                                      \
  724.   if (yydebug)                                                            \
  725.     {                                                                     \
  726.       YYFPRINTF (stderr, "%s ", Title);                                   \
  727.       yy_symbol_print (stderr,                                            \
  728.                   Type, Value); \
  729.       YYFPRINTF (stderr, "\n");                                           \
  730.     }                                                                     \
  731. } while (YYID (0))
  732.  
  733.  
  734. /*--------------------------------.
  735. | Print this symbol on YYOUTPUT.  |
  736. `--------------------------------*/
  737.  
  738. /*ARGSUSED*/
  739. #if (defined __STDC__ || defined __C99__FUNC__ \
  740.      || defined __cplusplus || defined _MSC_VER)
  741. static void
  742. yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
  743. #else
  744. static void
  745. yy_symbol_value_print (yyoutput, yytype, yyvaluep)
  746.     FILE *yyoutput;
  747.     int yytype;
  748.     YYSTYPE const * const yyvaluep;
  749. #endif
  750. {
  751.   if (!yyvaluep)
  752.     return;
  753. # ifdef YYPRINT
  754.   if (yytype < YYNTOKENS)
  755.     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
  756. # else
  757.   YYUSE (yyoutput);
  758. # endif
  759.   switch (yytype)
  760.     {
  761.       default:
  762.         break;
  763.     }
  764. }
  765.  
  766.  
  767. /*--------------------------------.
  768. | Print this symbol on YYOUTPUT.  |
  769. `--------------------------------*/
  770.  
  771. #if (defined __STDC__ || defined __C99__FUNC__ \
  772.      || defined __cplusplus || defined _MSC_VER)
  773. static void
  774. yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
  775. #else
  776. static void
  777. yy_symbol_print (yyoutput, yytype, yyvaluep)
  778.     FILE *yyoutput;
  779.     int yytype;
  780.     YYSTYPE const * const yyvaluep;
  781. #endif
  782. {
  783.   if (yytype < YYNTOKENS)
  784.     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
  785.   else
  786.     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
  787.  
  788.   yy_symbol_value_print (yyoutput, yytype, yyvaluep);
  789.   YYFPRINTF (yyoutput, ")");
  790. }
  791.  
  792. /*------------------------------------------------------------------.
  793. | yy_stack_print -- Print the state stack from its BOTTOM up to its |
  794. | TOP (included).                                                   |
  795. `------------------------------------------------------------------*/
  796.  
  797. #if (defined __STDC__ || defined __C99__FUNC__ \
  798.      || defined __cplusplus || defined _MSC_VER)
  799. static void
  800. yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
  801. #else
  802. static void
  803. yy_stack_print (bottom, top)
  804.     yytype_int16 *bottom;
  805.     yytype_int16 *top;
  806. #endif
  807. {
  808.   YYFPRINTF (stderr, "Stack now");
  809.   for (; bottom <= top; ++bottom)
  810.     YYFPRINTF (stderr, " %d", *bottom);
  811.   YYFPRINTF (stderr, "\n");
  812. }
  813.  
  814. # define YY_STACK_PRINT(Bottom, Top)                            \
  815. do {                                                            \
  816.   if (yydebug)                                                  \
  817.     yy_stack_print ((Bottom), (Top));                           \
  818. } while (YYID (0))
  819.  
  820.  
  821. /*------------------------------------------------.
  822. | Report that the YYRULE is going to be reduced.  |
  823. `------------------------------------------------*/
  824.  
  825. #if (defined __STDC__ || defined __C99__FUNC__ \
  826.      || defined __cplusplus || defined _MSC_VER)
  827. static void
  828. yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
  829. #else
  830. static void
  831. yy_reduce_print (yyvsp, yyrule)
  832.     YYSTYPE *yyvsp;
  833.     int yyrule;
  834. #endif
  835. {
  836.   int yynrhs = yyr2[yyrule];
  837.   int yyi;
  838.   unsigned long int yylno = yyrline[yyrule];
  839.   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
  840.              yyrule - 1, yylno);
  841.   /* The symbols being reduced.  */
  842.   for (yyi = 0; yyi < yynrhs; yyi++)
  843.     {
  844.       fprintf (stderr, "   $%d = ", yyi + 1);
  845.       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
  846.                        &(yyvsp[(yyi + 1) - (yynrhs)])
  847.                                        );
  848.       fprintf (stderr, "\n");
  849.     }
  850. }
  851.  
  852. # define YY_REDUCE_PRINT(Rule)          \
  853. do {                                    \
  854.   if (yydebug)                          \
  855.     yy_reduce_print (yyvsp, Rule); \
  856. } while (YYID (0))
  857.  
  858. /* Nonzero means print parse trace.  It is left uninitialized so that
  859.    multiple parsers can coexist.  */
  860. int yydebug;
  861. #else /* !YYDEBUG */
  862. # define YYDPRINTF(Args)
  863. # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
  864. # define YY_STACK_PRINT(Bottom, Top)
  865. # define YY_REDUCE_PRINT(Rule)
  866. #endif /* !YYDEBUG */
  867.  
  868.  
  869. /* YYINITDEPTH -- initial size of the parser's stacks.  */
  870. #ifndef YYINITDEPTH
  871. # define YYINITDEPTH 200
  872. #endif
  873.  
  874. /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
  875.    if the built-in stack extension method is used).
  876.  
  877.    Do not make this value too large; the results are undefined if
  878.    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
  879.    evaluated with infinite-precision integer arithmetic.  */
  880.  
  881. #ifndef YYMAXDEPTH
  882. # define YYMAXDEPTH 10000
  883. #endif
  884.  
  885.  
  886. #if YYERROR_VERBOSE
  887.  
  888. # ifndef yystrlen
  889. #  if defined __GLIBC__ && defined _STRING_H
  890. #   define yystrlen strlen
  891. #  else
  892. /* Return the length of YYSTR.  */
  893. #if (defined __STDC__ || defined __C99__FUNC__ \
  894.      || defined __cplusplus || defined _MSC_VER)
  895. static YYSIZE_T
  896. yystrlen (const char *yystr)
  897. #else
  898. static YYSIZE_T
  899. yystrlen (yystr)
  900.     const char *yystr;
  901. #endif
  902. {
  903.   YYSIZE_T yylen;
  904.   for (yylen = 0; yystr[yylen]; yylen++)
  905.     continue;
  906.   return yylen;
  907. }
  908. #  endif
  909. # endif
  910.  
  911. # ifndef yystpcpy
  912. #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
  913. #   define yystpcpy stpcpy
  914. #  else
  915. /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
  916.    YYDEST.  */
  917. #if (defined __STDC__ || defined __C99__FUNC__ \
  918.      || defined __cplusplus || defined _MSC_VER)
  919. static char *
  920. yystpcpy (char *yydest, const char *yysrc)
  921. #else
  922. static char *
  923. yystpcpy (yydest, yysrc)
  924.     char *yydest;
  925.     const char *yysrc;
  926. #endif
  927. {
  928.   char *yyd = yydest;
  929.   const char *yys = yysrc;
  930.  
  931.   while ((*yyd++ = *yys++) != '\0')
  932.     continue;
  933.  
  934.   return yyd - 1;
  935. }
  936. #  endif
  937. # endif
  938.  
  939. # ifndef yytnamerr
  940. /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
  941.    quotes and backslashes, so that it's suitable for yyerror.  The
  942.    heuristic is that double-quoting is unnecessary unless the string
  943.    contains an apostrophe, a comma, or backslash (other than
  944.    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
  945.    null, do not copy; instead, return the length of what the result
  946.    would have been.  */
  947. static YYSIZE_T
  948. yytnamerr (char *yyres, const char *yystr)
  949. {
  950.   if (*yystr == '"')
  951.     {
  952.       YYSIZE_T yyn = 0;
  953.       char const *yyp = yystr;
  954.  
  955.       for (;;)
  956.         switch (*++yyp)
  957.           {
  958.           case '\'':
  959.           case ',':
  960.             goto do_not_strip_quotes;
  961.  
  962.           case '\\':
  963.             if (*++yyp != '\\')
  964.               goto do_not_strip_quotes;
  965.             /* Fall through.  */
  966.           default:
  967.             if (yyres)
  968.               yyres[yyn] = *yyp;
  969.             yyn++;
  970.             break;
  971.  
  972.           case '"':
  973.             if (yyres)
  974.               yyres[yyn] = '\0';
  975.             return yyn;
  976.           }
  977.     do_not_strip_quotes: ;
  978.     }
  979.  
  980.   if (! yyres)
  981.     return yystrlen (yystr);
  982.  
  983.   return yystpcpy (yyres, yystr) - yyres;
  984. }
  985. # endif
  986.  
  987. /* Copy into YYRESULT an error message about the unexpected token
  988.    YYCHAR while in state YYSTATE.  Return the number of bytes copied,
  989.    including the terminating null byte.  If YYRESULT is null, do not
  990.    copy anything; just return the number of bytes that would be
  991.    copied.  As a special case, return 0 if an ordinary "syntax error"
  992.    message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
  993.    size calculation.  */
  994. static YYSIZE_T
  995. yysyntax_error (char *yyresult, int yystate, int yychar)
  996. {
  997.   int yyn = yypact[yystate];
  998.  
  999.   if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
  1000.     return 0;
  1001.   else
  1002.     {
  1003.       int yytype = YYTRANSLATE (yychar);
  1004.       YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
  1005.       YYSIZE_T yysize = yysize0;
  1006.       YYSIZE_T yysize1;
  1007.       int yysize_overflow = 0;
  1008.       enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
  1009.       char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
  1010.       int yyx;
  1011.  
  1012. # if 0
  1013.       /* This is so xgettext sees the translatable formats that are
  1014.          constructed on the fly.  */
  1015.       YY_("syntax error, unexpected %s");
  1016.       YY_("syntax error, unexpected %s, expecting %s");
  1017.       YY_("syntax error, unexpected %s, expecting %s or %s");
  1018.       YY_("syntax error, unexpected %s, expecting %s or %s or %s");
  1019.       YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
  1020. # endif
  1021.       char *yyfmt;
  1022.       char const *yyf;
  1023.       static char const yyunexpected[] = "syntax error, unexpected %s";
  1024.       static char const yyexpecting[] = ", expecting %s";
  1025.       static char const yyor[] = " or %s";
  1026.       char yyformat[sizeof yyunexpected
  1027.                     + sizeof yyexpecting - 1
  1028.                     + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
  1029.                        * (sizeof yyor - 1))];
  1030.       char const *yyprefix = yyexpecting;
  1031.  
  1032.       /* Start YYX at -YYN if negative to avoid negative indexes in
  1033.          YYCHECK.  */
  1034.       int yyxbegin = yyn < 0 ? -yyn : 0;
  1035.  
  1036.       /* Stay within bounds of both yycheck and yytname.  */
  1037.       int yychecklim = YYLAST - yyn + 1;
  1038.       int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
  1039.       int yycount = 1;
  1040.  
  1041.       yyarg[0] = yytname[yytype];
  1042.       yyfmt = yystpcpy (yyformat, yyunexpected);
  1043.  
  1044.       for (yyx = yyxbegin; yyx < yyxend; ++yyx)
  1045.         if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
  1046.           {
  1047.             if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
  1048.               {
  1049.                 yycount = 1;
  1050.                 yysize = yysize0;
  1051.                 yyformat[sizeof yyunexpected - 1] = '\0';
  1052.                 break;
  1053.               }
  1054.             yyarg[yycount++] = yytname[yyx];
  1055.             yysize1 = yysize + yytnamerr (0, yytname[yyx]);
  1056.             yysize_overflow |= (yysize1 < yysize);
  1057.             yysize = yysize1;
  1058.             yyfmt = yystpcpy (yyfmt, yyprefix);
  1059.             yyprefix = yyor;
  1060.           }
  1061.  
  1062.       yyf = YY_(yyformat);
  1063.       yysize1 = yysize + yystrlen (yyf);
  1064.       yysize_overflow |= (yysize1 < yysize);
  1065.       yysize = yysize1;
  1066.  
  1067.       if (yysize_overflow)
  1068.         return YYSIZE_MAXIMUM;
  1069.  
  1070.       if (yyresult)
  1071.         {
  1072.           /* Avoid sprintf, as that infringes on the user's name space.
  1073.              Don't have undefined behavior even if the translation
  1074.              produced a string with the wrong number of "%s"s.  */
  1075.           char *yyp = yyresult;
  1076.           int yyi = 0;
  1077.           while ((*yyp = *yyf) != '\0')
  1078.             {
  1079.               if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
  1080.                 {
  1081.                   yyp += yytnamerr (yyp, yyarg[yyi++]);
  1082.                   yyf += 2;
  1083.                 }
  1084.               else
  1085.                 {
  1086.                   yyp++;
  1087.                   yyf++;
  1088.                 }
  1089.             }
  1090.         }
  1091.       return yysize;
  1092.     }
  1093. }
  1094. #endif /* YYERROR_VERBOSE */
  1095.  
  1096. /*-----------------------------------------------.
  1097. | Release the memory associated to this symbol.  |
  1098. `-----------------------------------------------*/
  1099.  
  1100. /*ARGSUSED*/
  1101. #if (defined __STDC__ || defined __C99__FUNC__ \
  1102.      || defined __cplusplus || defined _MSC_VER)
  1103. static void
  1104. yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
  1105. #else
  1106. static void
  1107. yydestruct (yymsg, yytype, yyvaluep)
  1108.     const char *yymsg;
  1109.     int yytype;
  1110.     YYSTYPE *yyvaluep;
  1111. #endif
  1112. {
  1113.   YYUSE (yyvaluep);
  1114.  
  1115.   if (!yymsg)
  1116.     yymsg = "Deleting";
  1117.   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
  1118.  
  1119.   switch (yytype)
  1120.     {
  1121.  
  1122.       default:
  1123.         break;
  1124.     }
  1125. }
  1126.  
  1127. /* Prevent warnings from -Wmissing-prototypes.  */
  1128.  
  1129. #ifdef YYPARSE_PARAM
  1130. #if defined __STDC__ || defined __cplusplus
  1131. int yyparse (void *YYPARSE_PARAM);
  1132. #else
  1133. int yyparse ();
  1134. #endif
  1135. #else /* ! YYPARSE_PARAM */
  1136. #if defined __STDC__ || defined __cplusplus
  1137. int yyparse (void);
  1138. #else
  1139. int yyparse ();
  1140. #endif
  1141. #endif /* ! YYPARSE_PARAM */
  1142.  
  1143.  
  1144.  
  1145. /* The look-ahead symbol.  */
  1146. int yychar;
  1147.  
  1148. /* The semantic value of the look-ahead symbol.  */
  1149. YYSTYPE yylval;
  1150.  
  1151. /* Number of syntax errors so far.  */
  1152. int yynerrs;
  1153.  
  1154.  
  1155.  
  1156. /*----------.
  1157. | yyparse.  |
  1158. `----------*/
  1159.  
  1160. #ifdef YYPARSE_PARAM
  1161. #if (defined __STDC__ || defined __C99__FUNC__ \
  1162.      || defined __cplusplus || defined _MSC_VER)
  1163. int
  1164. yyparse (void *YYPARSE_PARAM)
  1165. #else
  1166. int
  1167. yyparse (YYPARSE_PARAM)
  1168.     void *YYPARSE_PARAM;
  1169. #endif
  1170. #else /* ! YYPARSE_PARAM */
  1171. #if (defined __STDC__ || defined __C99__FUNC__ \
  1172.      || defined __cplusplus || defined _MSC_VER)
  1173. int
  1174. yyparse (void)
  1175. #else
  1176. int
  1177. yyparse ()
  1178.  
  1179. #endif
  1180. #endif
  1181. {
  1182.  
  1183.   int yystate;
  1184.   int yyn;
  1185.   int yyresult;
  1186.   /* Number of tokens to shift before error messages enabled.  */
  1187.   int yyerrstatus;
  1188.   /* Look-ahead token as an internal (translated) token number.  */
  1189.   int yytoken = 0;
  1190. #if YYERROR_VERBOSE
  1191.   /* Buffer for error messages, and its allocated size.  */
  1192.   char yymsgbuf[128];
  1193.   char *yymsg = yymsgbuf;
  1194.   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
  1195. #endif
  1196.  
  1197.   /* Three stacks and their tools:
  1198.      `yyss': related to states,
  1199.      `yyvs': related to semantic values,
  1200.      `yyls': related to locations.
  1201.  
  1202.      Refer to the stacks thru separate pointers, to allow yyoverflow
  1203.      to reallocate them elsewhere.  */
  1204.  
  1205.   /* The state stack.  */
  1206.   yytype_int16 yyssa[YYINITDEPTH];
  1207.   yytype_int16 *yyss = yyssa;
  1208.   yytype_int16 *yyssp;
  1209.  
  1210.   /* The semantic value stack.  */
  1211.   YYSTYPE yyvsa[YYINITDEPTH];
  1212.   YYSTYPE *yyvs = yyvsa;
  1213.   YYSTYPE *yyvsp;
  1214.  
  1215.  
  1216.  
  1217. #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
  1218.  
  1219.   YYSIZE_T yystacksize = YYINITDEPTH;
  1220.  
  1221.   /* The variables used to return semantic value and location from the
  1222.      action routines.  */
  1223.   YYSTYPE yyval;
  1224.  
  1225.  
  1226.   /* The number of symbols on the RHS of the reduced rule.
  1227.      Keep to zero when no symbol should be popped.  */
  1228.   int yylen = 0;
  1229.  
  1230.   YYDPRINTF ((stderr, "Starting parse\n"));
  1231.  
  1232.   yystate = 0;
  1233.   yyerrstatus = 0;
  1234.   yynerrs = 0;
  1235.   yychar = YYEMPTY;             /* Cause a token to be read.  */
  1236.  
  1237.   /* Initialize stack pointers.
  1238.      Waste one element of value and location stack
  1239.      so that they stay on the same level as the state stack.
  1240.      The wasted elements are never initialized.  */
  1241.  
  1242.   yyssp = yyss;
  1243.   yyvsp = yyvs;
  1244.  
  1245.   goto yysetstate;
  1246.  
  1247. /*------------------------------------------------------------.
  1248. | yynewstate -- Push a new state, which is found in yystate.  |
  1249. `------------------------------------------------------------*/
  1250.  yynewstate:
  1251.   /* In all cases, when you get here, the value and location stacks
  1252.      have just been pushed.  So pushing a state here evens the stacks.  */
  1253.   yyssp++;
  1254.  
  1255.  yysetstate:
  1256.   *yyssp = yystate;
  1257.  
  1258.   if (yyss + yystacksize - 1 <= yyssp)
  1259.     {
  1260.       /* Get the current used size of the three stacks, in elements.  */
  1261.       YYSIZE_T yysize = yyssp - yyss + 1;
  1262.  
  1263. #ifdef yyoverflow
  1264.       {
  1265.         /* Give user a chance to reallocate the stack.  Use copies of
  1266.            these so that the &'s don't force the real ones into
  1267.            memory.  */
  1268.         YYSTYPE *yyvs1 = yyvs;
  1269.         yytype_int16 *yyss1 = yyss;
  1270.  
  1271.  
  1272.         /* Each stack pointer address is followed by the size of the
  1273.            data in use in that stack, in bytes.  This used to be a
  1274.            conditional around just the two extra args, but that might
  1275.            be undefined if yyoverflow is a macro.  */
  1276.         yyoverflow (YY_("memory exhausted"),
  1277.                     &yyss1, yysize * sizeof (*yyssp),
  1278.                     &yyvs1, yysize * sizeof (*yyvsp),
  1279.  
  1280.                     &yystacksize);
  1281.  
  1282.         yyss = yyss1;
  1283.         yyvs = yyvs1;
  1284.       }
  1285. #else /* no yyoverflow */
  1286. # ifndef YYSTACK_RELOCATE
  1287.       goto yyexhaustedlab;
  1288. # else
  1289.       /* Extend the stack our own way.  */
  1290.       if (YYMAXDEPTH <= yystacksize)
  1291.         goto yyexhaustedlab;
  1292.       yystacksize *= 2;
  1293.       if (YYMAXDEPTH < yystacksize)
  1294.         yystacksize = YYMAXDEPTH;
  1295.  
  1296.       {
  1297.         yytype_int16 *yyss1 = yyss;
  1298.         union yyalloc *yyptr =
  1299.           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
  1300.         if (! yyptr)
  1301.           goto yyexhaustedlab;
  1302.         YYSTACK_RELOCATE (yyss);
  1303.         YYSTACK_RELOCATE (yyvs);
  1304.  
  1305. #  undef YYSTACK_RELOCATE
  1306.         if (yyss1 != yyssa)
  1307.           YYSTACK_FREE (yyss1);
  1308.       }
  1309. # endif
  1310. #endif /* no yyoverflow */
  1311.  
  1312.       yyssp = yyss + yysize - 1;
  1313.       yyvsp = yyvs + yysize - 1;
  1314.  
  1315.  
  1316.       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
  1317.                   (unsigned long int) yystacksize));
  1318.  
  1319.       if (yyss + yystacksize - 1 <= yyssp)
  1320.         YYABORT;
  1321.     }
  1322.  
  1323.   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
  1324.  
  1325.   goto yybackup;
  1326.  
  1327. /*-----------.
  1328. | yybackup.  |
  1329. `-----------*/
  1330. yybackup:
  1331.  
  1332.   /* Do appropriate processing given the current state.  Read a
  1333.      look-ahead token if we need one and don't already have one.  */
  1334.  
  1335.   /* First try to decide what to do without reference to look-ahead token.  */
  1336.   yyn = yypact[yystate];
  1337.   if (yyn == YYPACT_NINF)
  1338.     goto yydefault;
  1339.  
  1340.   /* Not known => get a look-ahead token if don't already have one.  */
  1341.  
  1342.   /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
  1343.   if (yychar == YYEMPTY)
  1344.     {
  1345.       YYDPRINTF ((stderr, "Reading a token: "));
  1346.       yychar = YYLEX;
  1347.     }
  1348.  
  1349.   if (yychar <= YYEOF)
  1350.     {
  1351.       yychar = yytoken = YYEOF;
  1352.       YYDPRINTF ((stderr, "Now at end of input.\n"));
  1353.     }
  1354.   else
  1355.     {
  1356.       yytoken = YYTRANSLATE (yychar);
  1357.       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
  1358.     }
  1359.  
  1360.   /* If the proper action on seeing token YYTOKEN is to reduce or to
  1361.      detect an error, take that action.  */
  1362.   yyn += yytoken;
  1363.   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
  1364.     goto yydefault;
  1365.   yyn = yytable[yyn];
  1366.   if (yyn <= 0)
  1367.     {
  1368.       if (yyn == 0 || yyn == YYTABLE_NINF)
  1369.         goto yyerrlab;
  1370.       yyn = -yyn;
  1371.       goto yyreduce;
  1372.     }
  1373.  
  1374.   if (yyn == YYFINAL)
  1375.     YYACCEPT;
  1376.  
  1377.   /* Count tokens shifted since error; after three, turn off error
  1378.      status.  */
  1379.   if (yyerrstatus)
  1380.     yyerrstatus--;
  1381.  
  1382.   /* Shift the look-ahead token.  */
  1383.   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
  1384.  
  1385.   /* Discard the shifted token unless it is eof.  */
  1386.   if (yychar != YYEOF)
  1387.     yychar = YYEMPTY;
  1388.  
  1389.   yystate = yyn;
  1390.   *++yyvsp = yylval;
  1391.  
  1392.   goto yynewstate;
  1393.  
  1394.  
  1395. /*-----------------------------------------------------------.
  1396. | yydefault -- do the default action for the current state.  |
  1397. `-----------------------------------------------------------*/
  1398. yydefault:
  1399.   yyn = yydefact[yystate];
  1400.   if (yyn == 0)
  1401.     goto yyerrlab;
  1402.   goto yyreduce;
  1403.  
  1404.  
  1405. /*-----------------------------.
  1406. | yyreduce -- Do a reduction.  |
  1407. `-----------------------------*/
  1408. yyreduce:
  1409.   /* yyn is the number of a rule to reduce with.  */
  1410.   yylen = yyr2[yyn];
  1411.  
  1412.   /* If YYLEN is nonzero, implement the default value of the action:
  1413.      `$$ = $1'.
  1414.  
  1415.      Otherwise, the following line sets YYVAL to garbage.
  1416.      This behavior is undocumented and Bison
  1417.      users should not rely upon it.  Assigning to YYVAL
  1418.      unconditionally makes the parser a bit smaller, and it avoids a
  1419.      GCC warning that YYVAL may be used uninitialized.  */
  1420.   yyval = yyvsp[1-yylen];
  1421.  
  1422.  
  1423.   YY_REDUCE_PRINT (yyn);
  1424.   switch (yyn)
  1425.     {
  1426.         case 2:
  1427. #line 69 "arparse.y"
  1428.     { prompt(); }
  1429.     break;
  1430.  
  1431.   case 6:
  1432. #line 78 "arparse.y"
  1433.     { prompt(); }
  1434.     break;
  1435.  
  1436.   case 19:
  1437. #line 94 "arparse.y"
  1438.     { ar_end(); return 0; }
  1439.     break;
  1440.  
  1441.   case 21:
  1442. #line 96 "arparse.y"
  1443.     { yyerror("foo"); }
  1444.     break;
  1445.  
  1446.   case 23:
  1447. #line 103 "arparse.y"
  1448.     { ar_extract((yyvsp[(2) - (2)].list)); }
  1449.     break;
  1450.  
  1451.   case 24:
  1452. #line 108 "arparse.y"
  1453.     { ar_replace((yyvsp[(2) - (2)].list)); }
  1454.     break;
  1455.  
  1456.   case 25:
  1457. #line 113 "arparse.y"
  1458.     { ar_clear(); }
  1459.     break;
  1460.  
  1461.   case 26:
  1462. #line 118 "arparse.y"
  1463.     { ar_delete((yyvsp[(2) - (2)].list)); }
  1464.     break;
  1465.  
  1466.   case 27:
  1467. #line 122 "arparse.y"
  1468.     { ar_addmod((yyvsp[(2) - (2)].list)); }
  1469.     break;
  1470.  
  1471.   case 28:
  1472. #line 127 "arparse.y"
  1473.     { ar_list(); }
  1474.     break;
  1475.  
  1476.   case 29:
  1477. #line 132 "arparse.y"
  1478.     { ar_save(); }
  1479.     break;
  1480.  
  1481.   case 30:
  1482. #line 139 "arparse.y"
  1483.     { ar_open((yyvsp[(2) - (2)].name),0); }
  1484.     break;
  1485.  
  1486.   case 31:
  1487. #line 144 "arparse.y"
  1488.     { ar_open((yyvsp[(2) - (2)].name),1); }
  1489.     break;
  1490.  
  1491.   case 32:
  1492. #line 150 "arparse.y"
  1493.     { ar_addlib((yyvsp[(2) - (3)].name),(yyvsp[(3) - (3)].list)); }
  1494.     break;
  1495.  
  1496.   case 33:
  1497. #line 154 "arparse.y"
  1498.     { ar_directory((yyvsp[(2) - (4)].name), (yyvsp[(3) - (4)].list), (yyvsp[(4) - (4)].name)); }
  1499.     break;
  1500.  
  1501.   case 34:
  1502. #line 161 "arparse.y"
  1503.     { (yyval.name) = (yyvsp[(1) - (1)].name); }
  1504.     break;
  1505.  
  1506.   case 35:
  1507. #line 162 "arparse.y"
  1508.     { (yyval.name) = 0; }
  1509.     break;
  1510.  
  1511.   case 36:
  1512. #line 167 "arparse.y"
  1513.     { (yyval.list) = (yyvsp[(2) - (3)].list); }
  1514.     break;
  1515.  
  1516.   case 37:
  1517. #line 169 "arparse.y"
  1518.     { (yyval.list) = 0; }
  1519.     break;
  1520.  
  1521.   case 38:
  1522. #line 174 "arparse.y"
  1523.     {   struct list *n  = (struct list *) malloc(sizeof(struct list));
  1524.                         n->next = (yyvsp[(1) - (3)].list);
  1525.                         n->name = (yyvsp[(3) - (3)].name);
  1526.                         (yyval.list) = n;
  1527.                  }
  1528.     break;
  1529.  
  1530.   case 39:
  1531. #line 179 "arparse.y"
  1532.     { (yyval.list) = 0; }
  1533.     break;
  1534.  
  1535.   case 42:
  1536. #line 191 "arparse.y"
  1537.     { verbose = !verbose; }
  1538.     break;
  1539.  
  1540.  
  1541. /* Line 1267 of yacc.c.  */
  1542. #line 1546 "arparse.c"
  1543.       default: break;
  1544.     }
  1545.   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
  1546.  
  1547.   YYPOPSTACK (yylen);
  1548.   yylen = 0;
  1549.   YY_STACK_PRINT (yyss, yyssp);
  1550.  
  1551.   *++yyvsp = yyval;
  1552.  
  1553.  
  1554.   /* Now `shift' the result of the reduction.  Determine what state
  1555.      that goes to, based on the state we popped back to and the rule
  1556.      number reduced by.  */
  1557.  
  1558.   yyn = yyr1[yyn];
  1559.  
  1560.   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  1561.   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1562.     yystate = yytable[yystate];
  1563.   else
  1564.     yystate = yydefgoto[yyn - YYNTOKENS];
  1565.  
  1566.   goto yynewstate;
  1567.  
  1568.  
  1569. /*------------------------------------.
  1570. | yyerrlab -- here on detecting error |
  1571. `------------------------------------*/
  1572. yyerrlab:
  1573.   /* If not already recovering from an error, report this error.  */
  1574.   if (!yyerrstatus)
  1575.     {
  1576.       ++yynerrs;
  1577. #if ! YYERROR_VERBOSE
  1578.       yyerror (YY_("syntax error"));
  1579. #else
  1580.       {
  1581.         YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
  1582.         if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
  1583.           {
  1584.             YYSIZE_T yyalloc = 2 * yysize;
  1585.             if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
  1586.               yyalloc = YYSTACK_ALLOC_MAXIMUM;
  1587.             if (yymsg != yymsgbuf)
  1588.               YYSTACK_FREE (yymsg);
  1589.             yymsg = (char *) YYSTACK_ALLOC (yyalloc);
  1590.             if (yymsg)
  1591.               yymsg_alloc = yyalloc;
  1592.             else
  1593.               {
  1594.                 yymsg = yymsgbuf;
  1595.                 yymsg_alloc = sizeof yymsgbuf;
  1596.               }
  1597.           }
  1598.  
  1599.         if (0 < yysize && yysize <= yymsg_alloc)
  1600.           {
  1601.             (void) yysyntax_error (yymsg, yystate, yychar);
  1602.             yyerror (yymsg);
  1603.           }
  1604.         else
  1605.           {
  1606.             yyerror (YY_("syntax error"));
  1607.             if (yysize != 0)
  1608.               goto yyexhaustedlab;
  1609.           }
  1610.       }
  1611. #endif
  1612.     }
  1613.  
  1614.  
  1615.  
  1616.   if (yyerrstatus == 3)
  1617.     {
  1618.       /* If just tried and failed to reuse look-ahead token after an
  1619.          error, discard it.  */
  1620.  
  1621.       if (yychar <= YYEOF)
  1622.         {
  1623.           /* Return failure if at end of input.  */
  1624.           if (yychar == YYEOF)
  1625.             YYABORT;
  1626.         }
  1627.       else
  1628.         {
  1629.           yydestruct ("Error: discarding",
  1630.                       yytoken, &yylval);
  1631.           yychar = YYEMPTY;
  1632.         }
  1633.     }
  1634.  
  1635.   /* Else will try to reuse look-ahead token after shifting the error
  1636.      token.  */
  1637.   goto yyerrlab1;
  1638.  
  1639.  
  1640. /*---------------------------------------------------.
  1641. | yyerrorlab -- error raised explicitly by YYERROR.  |
  1642. `---------------------------------------------------*/
  1643. yyerrorlab:
  1644.  
  1645.   /* Pacify compilers like GCC when the user code never invokes
  1646.      YYERROR and the label yyerrorlab therefore never appears in user
  1647.      code.  */
  1648.   if (/*CONSTCOND*/ 0)
  1649.      goto yyerrorlab;
  1650.  
  1651.   /* Do not reclaim the symbols of the rule which action triggered
  1652.      this YYERROR.  */
  1653.   YYPOPSTACK (yylen);
  1654.   yylen = 0;
  1655.   YY_STACK_PRINT (yyss, yyssp);
  1656.   yystate = *yyssp;
  1657.   goto yyerrlab1;
  1658.  
  1659.  
  1660. /*-------------------------------------------------------------.
  1661. | yyerrlab1 -- common code for both syntax error and YYERROR.  |
  1662. `-------------------------------------------------------------*/
  1663. yyerrlab1:
  1664.   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
  1665.  
  1666.   for (;;)
  1667.     {
  1668.       yyn = yypact[yystate];
  1669.       if (yyn != YYPACT_NINF)
  1670.         {
  1671.           yyn += YYTERROR;
  1672.           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
  1673.             {
  1674.               yyn = yytable[yyn];
  1675.               if (0 < yyn)
  1676.                 break;
  1677.             }
  1678.         }
  1679.  
  1680.       /* Pop the current state because it cannot handle the error token.  */
  1681.       if (yyssp == yyss)
  1682.         YYABORT;
  1683.  
  1684.  
  1685.       yydestruct ("Error: popping",
  1686.                   yystos[yystate], yyvsp);
  1687.       YYPOPSTACK (1);
  1688.       yystate = *yyssp;
  1689.       YY_STACK_PRINT (yyss, yyssp);
  1690.     }
  1691.  
  1692.   if (yyn == YYFINAL)
  1693.     YYACCEPT;
  1694.  
  1695.   *++yyvsp = yylval;
  1696.  
  1697.  
  1698.   /* Shift the error token.  */
  1699.   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
  1700.  
  1701.   yystate = yyn;
  1702.   goto yynewstate;
  1703.  
  1704.  
  1705. /*-------------------------------------.
  1706. | yyacceptlab -- YYACCEPT comes here.  |
  1707. `-------------------------------------*/
  1708. yyacceptlab:
  1709.   yyresult = 0;
  1710.   goto yyreturn;
  1711.  
  1712. /*-----------------------------------.
  1713. | yyabortlab -- YYABORT comes here.  |
  1714. `-----------------------------------*/
  1715. yyabortlab:
  1716.   yyresult = 1;
  1717.   goto yyreturn;
  1718.  
  1719. #ifndef yyoverflow
  1720. /*-------------------------------------------------.
  1721. | yyexhaustedlab -- memory exhaustion comes here.  |
  1722. `-------------------------------------------------*/
  1723. yyexhaustedlab:
  1724.   yyerror (YY_("memory exhausted"));
  1725.   yyresult = 2;
  1726.   /* Fall through.  */
  1727. #endif
  1728.  
  1729. yyreturn:
  1730.   if (yychar != YYEOF && yychar != YYEMPTY)
  1731.      yydestruct ("Cleanup: discarding lookahead",
  1732.                  yytoken, &yylval);
  1733.   /* Do not reclaim the symbols of the rule which action triggered
  1734.      this YYABORT or YYACCEPT.  */
  1735.   YYPOPSTACK (yylen);
  1736.   YY_STACK_PRINT (yyss, yyssp);
  1737.   while (yyssp != yyss)
  1738.     {
  1739.       yydestruct ("Cleanup: popping",
  1740.                   yystos[*yyssp], yyvsp);
  1741.       YYPOPSTACK (1);
  1742.     }
  1743. #ifndef yyoverflow
  1744.   if (yyss != yyssa)
  1745.     YYSTACK_FREE (yyss);
  1746. #endif
  1747. #if YYERROR_VERBOSE
  1748.   if (yymsg != yymsgbuf)
  1749.     YYSTACK_FREE (yymsg);
  1750. #endif
  1751.   /* Make sure YYID is used.  */
  1752.   return YYID (yyresult);
  1753. }
  1754.  
  1755.  
  1756. #line 195 "arparse.y"
  1757.  
  1758.  
  1759. static int
  1760. yyerror (const char *x ATTRIBUTE_UNUSED)
  1761. {
  1762.   extern int linenumber;
  1763.  
  1764.   printf (_("Syntax error in archive script, line %d\n"), linenumber + 1);
  1765.   return 0;
  1766. }
  1767.  
  1768.