1,14 → 1,13 |
/* A Bison parser, made by GNU Bison 2.3. */ |
/* A Bison parser, made by GNU Bison 3.0. */ |
|
/* Skeleton implementation for Bison's Yacc-like parsers in C |
/* Bison implementation for Yacc-like parsers in C |
|
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 |
Free Software Foundation, Inc. |
Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. |
|
This program is free software; you can redistribute it and/or modify |
This program is free software: you can redistribute it and/or modify |
it under the terms of the GNU General Public License as published by |
the Free Software Foundation; either version 2, or (at your option) |
any later version. |
the Free Software Foundation, either version 3 of the License, or |
(at your option) any later version. |
|
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
16,9 → 15,7 |
GNU General Public License for more details. |
|
You should have received a copy of the GNU General Public License |
along with this program; if not, write to the Free Software |
Foundation, Inc., 51 Franklin Street, Fifth Floor, |
Boston, MA 02110-1301, USA. */ |
along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
|
/* As a special exception, you may create a larger work that contains |
part or all of the Bison parser skeleton and distribute that work |
47,7 → 44,7 |
#define YYBISON 1 |
|
/* Bison version. */ |
#define YYBISON_VERSION "2.3" |
#define YYBISON_VERSION "3.0" |
|
/* Skeleton name. */ |
#define YYSKELETON_NAME "yacc.c" |
55,67 → 52,21 |
/* Pure parsers. */ |
#define YYPURE 0 |
|
/* Using locations. */ |
#define YYLSP_NEEDED 0 |
/* Push parsers. */ |
#define YYPUSH 0 |
|
/* Pull parsers. */ |
#define YYPULL 1 |
|
|
/* Tokens. */ |
#ifndef YYTOKENTYPE |
# define YYTOKENTYPE |
/* Put the tokens into the symbol table, so that GDB and other debuggers |
know about them. */ |
enum yytokentype { |
NEWLINE = 258, |
VERBOSE = 259, |
FILENAME = 260, |
ADDLIB = 261, |
LIST = 262, |
ADDMOD = 263, |
CLEAR = 264, |
CREATE = 265, |
DELETE = 266, |
DIRECTORY = 267, |
END = 268, |
EXTRACT = 269, |
FULLDIR = 270, |
HELP = 271, |
QUIT = 272, |
REPLACE = 273, |
SAVE = 274, |
OPEN = 275 |
}; |
#endif |
/* Tokens. */ |
#define NEWLINE 258 |
#define VERBOSE 259 |
#define FILENAME 260 |
#define ADDLIB 261 |
#define LIST 262 |
#define ADDMOD 263 |
#define CLEAR 264 |
#define CREATE 265 |
#define DELETE 266 |
#define DIRECTORY 267 |
#define END 268 |
#define EXTRACT 269 |
#define FULLDIR 270 |
#define HELP 271 |
#define QUIT 272 |
#define REPLACE 273 |
#define SAVE 274 |
#define OPEN 275 |
|
|
|
|
/* Copy the first part of user declarations. */ |
#line 1 "arparse.y" |
#line 1 "arparse.y" /* yacc.c:339 */ |
|
/* arparse.y - Stange script language parser */ |
|
/* Copyright 1992, 1993, 1995, 1997, 1999, 2002, 2003, 2005, 2007 |
Free Software Foundation, Inc. |
/* Copyright (C) 1992-2015 Free Software Foundation, Inc. |
|
This file is part of GNU Binutils. |
|
147,11 → 98,15 |
extern int yylex (void); |
static int yyerror (const char *); |
|
#line 102 "arparse.c" /* yacc.c:339 */ |
|
/* Enabling traces. */ |
#ifndef YYDEBUG |
# define YYDEBUG 0 |
# ifndef YY_NULL |
# if defined __cplusplus && 201103L <= __cplusplus |
# define YY_NULL nullptr |
# else |
# define YY_NULL 0 |
#endif |
# endif |
|
/* Enabling verbose error messages. */ |
#ifdef YYERROR_VERBOSE |
161,35 → 116,91 |
# define YYERROR_VERBOSE 0 |
#endif |
|
/* Enabling the token table. */ |
#ifndef YYTOKEN_TABLE |
# define YYTOKEN_TABLE 0 |
/* In a future release of Bison, this section will be replaced |
by #include "y.tab.h". */ |
#ifndef YY_YY_ARPARSE_H_INCLUDED |
# define YY_YY_ARPARSE_H_INCLUDED |
/* Debug traces. */ |
#ifndef YYDEBUG |
# define YYDEBUG 0 |
#endif |
#if YYDEBUG |
extern int yydebug; |
#endif |
|
/* Token type. */ |
#ifndef YYTOKENTYPE |
# define YYTOKENTYPE |
enum yytokentype |
{ |
NEWLINE = 258, |
VERBOSE = 259, |
FILENAME = 260, |
ADDLIB = 261, |
LIST = 262, |
ADDMOD = 263, |
CLEAR = 264, |
CREATE = 265, |
DELETE = 266, |
DIRECTORY = 267, |
END = 268, |
EXTRACT = 269, |
FULLDIR = 270, |
HELP = 271, |
QUIT = 272, |
REPLACE = 273, |
SAVE = 274, |
OPEN = 275 |
}; |
#endif |
/* Tokens. */ |
#define NEWLINE 258 |
#define VERBOSE 259 |
#define FILENAME 260 |
#define ADDLIB 261 |
#define LIST 262 |
#define ADDMOD 263 |
#define CLEAR 264 |
#define CREATE 265 |
#define DELETE 266 |
#define DIRECTORY 267 |
#define END 268 |
#define EXTRACT 269 |
#define FULLDIR 270 |
#define HELP 271 |
#define QUIT 272 |
#define REPLACE 273 |
#define SAVE 274 |
#define OPEN 275 |
|
/* Value type. */ |
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED |
typedef union YYSTYPE |
#line 38 "arparse.y" |
typedef union YYSTYPE YYSTYPE; |
union YYSTYPE |
{ |
#line 37 "arparse.y" /* yacc.c:355 */ |
|
char *name; |
struct list *list ; |
|
} |
/* Line 193 of yacc.c. */ |
#line 179 "arparse.c" |
YYSTYPE; |
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ |
|
#line 188 "arparse.c" /* yacc.c:355 */ |
}; |
# define YYSTYPE_IS_TRIVIAL 1 |
# define YYSTYPE_IS_DECLARED 1 |
# define YYSTYPE_IS_TRIVIAL 1 |
#endif |
|
|
extern YYSTYPE yylval; |
|
int yyparse (void); |
|
#endif /* !YY_YY_ARPARSE_H_INCLUDED */ |
|
/* Copy the second part of user declarations. */ |
|
#line 203 "arparse.c" /* yacc.c:358 */ |
|
/* Line 216 of yacc.c. */ |
#line 192 "arparse.c" |
|
#ifdef short |
# undef short |
#endif |
202,11 → 213,8 |
|
#ifdef YYTYPE_INT8 |
typedef YYTYPE_INT8 yytype_int8; |
#elif (defined __STDC__ || defined __C99__FUNC__ \ |
|| defined __cplusplus || defined _MSC_VER) |
#else |
typedef signed char yytype_int8; |
#else |
typedef short int yytype_int8; |
#endif |
|
#ifdef YYTYPE_UINT16 |
226,8 → 234,7 |
# define YYSIZE_T __SIZE_TYPE__ |
# elif defined size_t |
# define YYSIZE_T size_t |
# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ |
|| defined __cplusplus || defined _MSC_VER) |
# elif ! defined YYSIZE_T |
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
# define YYSIZE_T size_t |
# else |
241,39 → 248,49 |
# if defined YYENABLE_NLS && YYENABLE_NLS |
# if ENABLE_NLS |
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ |
# define YY_(msgid) dgettext ("bison-runtime", msgid) |
# define YY_(Msgid) dgettext ("bison-runtime", Msgid) |
# endif |
# endif |
# ifndef YY_ |
# define YY_(msgid) msgid |
# define YY_(Msgid) Msgid |
# endif |
#endif |
|
#ifndef __attribute__ |
/* This feature is available in gcc versions 2.5 and later. */ |
# if (! defined __GNUC__ || __GNUC__ < 2 \ |
|| (__GNUC__ == 2 && __GNUC_MINOR__ < 5)) |
# define __attribute__(Spec) /* empty */ |
# endif |
#endif |
|
/* Suppress unused-variable warnings by "using" E. */ |
#if ! defined lint || defined __GNUC__ |
# define YYUSE(e) ((void) (e)) |
# define YYUSE(E) ((void) (E)) |
#else |
# define YYUSE(e) /* empty */ |
# define YYUSE(E) /* empty */ |
#endif |
|
/* Identity function, used to suppress warnings about constant conditions. */ |
#ifndef lint |
# define YYID(n) (n) |
#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ |
/* Suppress an incorrect diagnostic about yylval being uninitialized. */ |
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ |
_Pragma ("GCC diagnostic push") \ |
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ |
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") |
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ |
_Pragma ("GCC diagnostic pop") |
#else |
#if (defined __STDC__ || defined __C99__FUNC__ \ |
|| defined __cplusplus || defined _MSC_VER) |
static int |
YYID (int i) |
#else |
static int |
YYID (i) |
int i; |
# define YY_INITIAL_VALUE(Value) Value |
#endif |
{ |
return i; |
} |
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
# define YY_IGNORE_MAYBE_UNINITIALIZED_END |
#endif |
#ifndef YY_INITIAL_VALUE |
# define YY_INITIAL_VALUE(Value) /* Nothing. */ |
#endif |
|
|
#if ! defined yyoverflow || YYERROR_VERBOSE |
|
/* The parser invokes alloca or malloc; define the necessary symbols. */ |
291,11 → 308,11 |
# define alloca _alloca |
# else |
# define YYSTACK_ALLOC alloca |
# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ |
|| defined __cplusplus || defined _MSC_VER) |
# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS |
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
# ifndef _STDLIB_H |
# define _STDLIB_H 1 |
/* Use EXIT_SUCCESS as a witness for stdlib.h. */ |
# ifndef EXIT_SUCCESS |
# define EXIT_SUCCESS 0 |
# endif |
# endif |
# endif |
303,8 → 320,8 |
# endif |
|
# ifdef YYSTACK_ALLOC |
/* Pacify GCC's `empty if-body' warning. */ |
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) |
/* Pacify GCC's 'empty if-body' warning. */ |
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) |
# ifndef YYSTACK_ALLOC_MAXIMUM |
/* The OS might guarantee only one guard page at the bottom of the stack, |
and a page size can be as small as 4096 bytes. So we cannot safely |
318,25 → 335,23 |
# ifndef YYSTACK_ALLOC_MAXIMUM |
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
# endif |
# if (defined __cplusplus && ! defined _STDLIB_H \ |
# if (defined __cplusplus && ! defined EXIT_SUCCESS \ |
&& ! ((defined YYMALLOC || defined malloc) \ |
&& (defined YYFREE || defined free))) |
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
# ifndef _STDLIB_H |
# define _STDLIB_H 1 |
# ifndef EXIT_SUCCESS |
# define EXIT_SUCCESS 0 |
# endif |
# endif |
# ifndef YYMALLOC |
# define YYMALLOC malloc |
# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ |
|| defined __cplusplus || defined _MSC_VER) |
# if ! defined malloc && ! defined EXIT_SUCCESS |
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ |
# endif |
# endif |
# ifndef YYFREE |
# define YYFREE free |
# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ |
|| defined __cplusplus || defined _MSC_VER) |
# if ! defined free && ! defined EXIT_SUCCESS |
void free (void *); /* INFRINGES ON USER NAME SPACE */ |
# endif |
# endif |
351,8 → 366,8 |
/* A type that is properly aligned for any stack member. */ |
union yyalloc |
{ |
yytype_int16 yyss; |
YYSTYPE yyvs; |
yytype_int16 yyss_alloc; |
YYSTYPE yyvs_alloc; |
}; |
|
/* The size of the maximum gap between one aligned stack and the next. */ |
364,23 → 379,7 |
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ |
+ YYSTACK_GAP_MAXIMUM) |
|
/* Copy COUNT objects from FROM to TO. The source and destination do |
not overlap. */ |
# ifndef YYCOPY |
# if defined __GNUC__ && 1 < __GNUC__ |
# define YYCOPY(To, From, Count) \ |
__builtin_memcpy (To, From, (Count) * sizeof (*(From))) |
# else |
# define YYCOPY(To, From, Count) \ |
do \ |
{ \ |
YYSIZE_T yyi; \ |
for (yyi = 0; yyi < (Count); yyi++) \ |
(To)[yyi] = (From)[yyi]; \ |
} \ |
while (YYID (0)) |
# endif |
# endif |
# define YYCOPY_NEEDED 1 |
|
/* Relocate STACK from its old location to the new one. The |
local variables YYSIZE and YYSTACKSIZE give the old and new number of |
387,19 → 386,39 |
elements in the stack, and YYPTR gives the new location of the |
stack. Advance YYPTR to a properly aligned location for the next |
stack. */ |
# define YYSTACK_RELOCATE(Stack) \ |
# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ |
do \ |
{ \ |
YYSIZE_T yynewbytes; \ |
YYCOPY (&yyptr->Stack, Stack, yysize); \ |
Stack = &yyptr->Stack; \ |
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ |
Stack = &yyptr->Stack_alloc; \ |
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ |
yyptr += yynewbytes / sizeof (*yyptr); \ |
} \ |
while (YYID (0)) |
while (0) |
|
#endif |
|
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED |
/* Copy COUNT objects from SRC to DST. The source and destination do |
not overlap. */ |
# ifndef YYCOPY |
# if defined __GNUC__ && 1 < __GNUC__ |
# define YYCOPY(Dst, Src, Count) \ |
__builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) |
# else |
# define YYCOPY(Dst, Src, Count) \ |
do \ |
{ \ |
YYSIZE_T yyi; \ |
for (yyi = 0; yyi < (Count); yyi++) \ |
(Dst)[yyi] = (Src)[yyi]; \ |
} \ |
while (0) |
# endif |
# endif |
#endif /* !YYCOPY_NEEDED */ |
|
/* YYFINAL -- State number of the termination state. */ |
#define YYFINAL 3 |
/* YYLAST -- Last index in YYTABLE. */ |
411,10 → 430,11 |
#define YYNNTS 22 |
/* YYNRULES -- Number of rules. */ |
#define YYNRULES 42 |
/* YYNRULES -- Number of states. */ |
/* YYNSTATES -- Number of states. */ |
#define YYNSTATES 53 |
|
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ |
/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned |
by yylex, with out-of-bounds checking. */ |
#define YYUNDEFTOK 2 |
#define YYMAXUTOK 275 |
|
421,7 → 441,8 |
#define YYTRANSLATE(YYX) \ |
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
|
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ |
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM |
as returned by yylex, without out-of-bounds checking. */ |
static const yytype_uint8 yytranslate[] = |
{ |
0, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
455,44 → 476,18 |
}; |
|
#if YYDEBUG |
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in |
YYRHS. */ |
static const yytype_uint8 yyprhs[] = |
{ |
0, 0, 3, 4, 7, 10, 11, 14, 16, 18, |
20, 22, 24, 26, 28, 30, 32, 34, 36, 38, |
40, 42, 44, 45, 48, 51, 53, 56, 59, 61, |
63, 66, 69, 73, 78, 80, 81, 85, 86, 90, |
91, 93, 94 |
}; |
|
/* YYRHS -- A `-1'-separated list of the rules' RHS. */ |
static const yytype_int8 yyrhs[] = |
{ |
25, 0, -1, -1, 26, 27, -1, 27, 28, -1, |
-1, 29, 3, -1, 37, -1, 38, -1, 45, -1, |
40, -1, 39, -1, 32, -1, 34, -1, 36, -1, |
30, -1, 31, -1, 33, -1, 35, -1, 13, -1, |
1, -1, 5, -1, -1, 14, 43, -1, 18, 43, |
-1, 9, -1, 11, 43, -1, 8, 43, -1, 7, |
-1, 19, -1, 20, 5, -1, 10, 5, -1, 6, |
5, 42, -1, 12, 5, 42, 41, -1, 5, -1, |
-1, 21, 43, 22, -1, -1, 43, 44, 5, -1, |
-1, 23, -1, -1, 4, -1 |
}; |
|
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ |
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ |
static const yytype_uint8 yyrline[] = |
{ |
0, 69, 69, 69, 73, 74, 78, 82, 83, 84, |
85, 86, 87, 88, 89, 90, 91, 92, 93, 94, |
95, 96, 97, 102, 107, 112, 117, 121, 126, 131, |
138, 143, 149, 153, 160, 162, 166, 169, 173, 179, |
184, 185, 190 |
0, 68, 68, 68, 72, 73, 77, 81, 82, 83, |
84, 85, 86, 87, 88, 89, 90, 91, 92, 93, |
94, 95, 96, 101, 106, 111, 116, 120, 125, 130, |
137, 142, 148, 152, 159, 161, 165, 168, 172, 178, |
183, 184, 189 |
}; |
#endif |
|
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE |
#if YYDEBUG || YYERROR_VERBOSE || 0 |
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
static const char *const yytname[] = |
500,18 → 495,18 |
"$end", "error", "$undefined", "NEWLINE", "VERBOSE", "FILENAME", |
"ADDLIB", "LIST", "ADDMOD", "CLEAR", "CREATE", "DELETE", "DIRECTORY", |
"END", "EXTRACT", "FULLDIR", "HELP", "QUIT", "REPLACE", "SAVE", "OPEN", |
"'('", "')'", "','", "$accept", "start", "@1", "session", "command_line", |
"command", "extract_command", "replace_command", "clear_command", |
"delete_command", "addmod_command", "list_command", "save_command", |
"open_command", "create_command", "addlib_command", "directory_command", |
"optional_filename", "modulelist", "modulename", "optcomma", |
"verbose_command", 0 |
"'('", "')'", "','", "$accept", "start", "$@1", "session", |
"command_line", "command", "extract_command", "replace_command", |
"clear_command", "delete_command", "addmod_command", "list_command", |
"save_command", "open_command", "create_command", "addlib_command", |
"directory_command", "optional_filename", "modulelist", "modulename", |
"optcomma", "verbose_command", YY_NULL |
}; |
#endif |
|
# ifdef YYPRINT |
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to |
token YYLEX-NUM. */ |
/* YYTOKNUM[NUM] -- (External) token number corresponding to the |
(internal) symbol number NUM (which must be that of a token). */ |
static const yytype_uint16 yytoknum[] = |
{ |
0, 256, 257, 258, 259, 260, 261, 262, 263, 264, |
520,50 → 515,18 |
}; |
# endif |
|
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
static const yytype_uint8 yyr1[] = |
{ |
0, 24, 26, 25, 27, 27, 28, 29, 29, 29, |
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, |
29, 29, 29, 30, 31, 32, 33, 34, 35, 36, |
37, 38, 39, 40, 41, 41, 42, 42, 43, 43, |
44, 44, 45 |
}; |
#define YYPACT_NINF -14 |
|
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ |
static const yytype_uint8 yyr2[] = |
{ |
0, 2, 0, 2, 2, 0, 2, 1, 1, 1, |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
1, 1, 0, 2, 2, 1, 2, 2, 1, 1, |
2, 2, 3, 4, 1, 0, 3, 0, 3, 0, |
1, 0, 1 |
}; |
#define yypact_value_is_default(Yystate) \ |
(!!((Yystate) == (-14))) |
|
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state |
STATE-NUM when YYTABLE doesn't specify something else to do. Zero |
means the default is an error. */ |
static const yytype_uint8 yydefact[] = |
{ |
2, 0, 5, 1, 0, 20, 42, 21, 0, 28, |
39, 25, 0, 39, 0, 19, 39, 39, 29, 0, |
4, 0, 15, 16, 12, 17, 13, 18, 14, 7, |
8, 11, 10, 9, 37, 27, 31, 26, 37, 23, |
24, 30, 6, 39, 32, 40, 0, 35, 41, 38, |
34, 33, 36 |
}; |
#define YYTABLE_NINF -42 |
|
/* YYDEFGOTO[NTERM-NUM]. */ |
static const yytype_int8 yydefgoto[] = |
{ |
-1, 1, 2, 4, 20, 21, 22, 23, 24, 25, |
26, 27, 28, 29, 30, 31, 32, 51, 44, 35, |
46, 33 |
}; |
#define yytable_value_is_error(Yytable_value) \ |
0 |
|
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
STATE-NUM. */ |
#define YYPACT_NINF -14 |
static const yytype_int8 yypact[] = |
{ |
-14, 1, -14, -14, 5, -14, -14, -14, 2, -14, |
574,6 → 537,19 |
-14, -14, -14 |
}; |
|
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. |
Performed when YYTABLE does not specify something else to do. Zero |
means the default is an error. */ |
static const yytype_uint8 yydefact[] = |
{ |
2, 0, 5, 1, 0, 20, 42, 21, 0, 28, |
39, 25, 0, 39, 0, 19, 39, 39, 29, 0, |
4, 0, 15, 16, 12, 17, 13, 18, 14, 7, |
8, 11, 10, 9, 37, 27, 31, 26, 37, 23, |
24, 30, 6, 39, 32, 40, 0, 35, 41, 38, |
34, 33, 36 |
}; |
|
/* YYPGOTO[NTERM-NUM]. */ |
static const yytype_int8 yypgoto[] = |
{ |
582,11 → 558,17 |
-14, -14 |
}; |
|
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If |
positive, shift that token. If negative, reduce the rule which |
number is the opposite. If zero, do what YYDEFACT says. |
If YYTABLE_NINF, syntax error. */ |
#define YYTABLE_NINF -42 |
/* YYDEFGOTO[NTERM-NUM]. */ |
static const yytype_int8 yydefgoto[] = |
{ |
-1, 1, 2, 4, 20, 21, 22, 23, 24, 25, |
26, 27, 28, 29, 30, 31, 32, 51, 44, 35, |
46, 33 |
}; |
|
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If |
positive, shift that token. If negative, reduce the rule whose |
number is the opposite. If YYTABLE_NINF, syntax error. */ |
static const yytype_int8 yytable[] = |
{ |
37, 3, -41, 39, 40, -3, 5, 34, -22, 6, |
615,6 → 597,27 |
5, 41, 22 |
}; |
|
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
static const yytype_uint8 yyr1[] = |
{ |
0, 24, 26, 25, 27, 27, 28, 29, 29, 29, |
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, |
29, 29, 29, 30, 31, 32, 33, 34, 35, 36, |
37, 38, 39, 40, 41, 41, 42, 42, 43, 43, |
44, 44, 45 |
}; |
|
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ |
static const yytype_uint8 yyr2[] = |
{ |
0, 2, 0, 2, 2, 0, 2, 1, 1, 1, |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
1, 1, 0, 2, 2, 1, 2, 2, 1, 1, |
2, 2, 3, 4, 1, 0, 3, 0, 3, 0, |
1, 0, 1 |
}; |
|
|
#define yyerrok (yyerrstatus = 0) |
#define yyclearin (yychar = YYEMPTY) |
#define YYEMPTY (-2) |
625,22 → 628,16 |
#define YYERROR goto yyerrorlab |
|
|
/* Like YYERROR except do call yyerror. This remains here temporarily |
to ease the transition to the new meaning of YYERROR, for GCC. |
Once GCC version 2 has supplanted version 1, this can go. */ |
|
#define YYFAIL goto yyerrlab |
|
#define YYRECOVERING() (!!yyerrstatus) |
|
#define YYBACKUP(Token, Value) \ |
do \ |
if (yychar == YYEMPTY && yylen == 1) \ |
if (yychar == YYEMPTY) \ |
{ \ |
yychar = (Token); \ |
yylval = (Value); \ |
yytoken = YYTRANSLATE (yychar); \ |
YYPOPSTACK (1); \ |
YYPOPSTACK (yylen); \ |
yystate = *yyssp; \ |
goto yybackup; \ |
} \ |
else \ |
648,63 → 645,14 |
yyerror (YY_("syntax error: cannot back up")); \ |
YYERROR; \ |
} \ |
while (YYID (0)) |
while (0) |
|
|
/* Error token number */ |
#define YYTERROR 1 |
#define YYERRCODE 256 |
|
|
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. |
If N is 0, then set CURRENT to the empty location which ends |
the previous symbol: RHS[0] (always defined). */ |
|
#define YYRHSLOC(Rhs, K) ((Rhs)[K]) |
#ifndef YYLLOC_DEFAULT |
# define YYLLOC_DEFAULT(Current, Rhs, N) \ |
do \ |
if (YYID (N)) \ |
{ \ |
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ |
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ |
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \ |
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \ |
} \ |
else \ |
{ \ |
(Current).first_line = (Current).last_line = \ |
YYRHSLOC (Rhs, 0).last_line; \ |
(Current).first_column = (Current).last_column = \ |
YYRHSLOC (Rhs, 0).last_column; \ |
} \ |
while (YYID (0)) |
#endif |
|
|
/* YY_LOCATION_PRINT -- Print the location on the stream. |
This macro was not mandated originally: define only if we know |
we won't break user code: when these are the locations we know. */ |
|
#ifndef YY_LOCATION_PRINT |
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL |
# define YY_LOCATION_PRINT(File, Loc) \ |
fprintf (File, "%d.%d-%d.%d", \ |
(Loc).first_line, (Loc).first_column, \ |
(Loc).last_line, (Loc).last_column) |
# else |
# define YY_LOCATION_PRINT(File, Loc) ((void) 0) |
# endif |
#endif |
|
|
/* YYLEX -- calling `yylex' with the right arguments. */ |
|
#ifdef YYLEX_PARAM |
# define YYLEX yylex (YYLEX_PARAM) |
#else |
# define YYLEX yylex () |
#endif |
|
/* Enable debugging if requested. */ |
#if YYDEBUG |
|
717,8 → 665,14 |
do { \ |
if (yydebug) \ |
YYFPRINTF Args; \ |
} while (YYID (0)) |
} while (0) |
|
/* This macro is provided for backward compatibility. */ |
#ifndef YY_LOCATION_PRINT |
# define YY_LOCATION_PRINT(File, Loc) ((void) 0) |
#endif |
|
|
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ |
do { \ |
if (yydebug) \ |
728,40 → 682,26 |
Type, Value); \ |
YYFPRINTF (stderr, "\n"); \ |
} \ |
} while (YYID (0)) |
} while (0) |
|
|
/*--------------------------------. |
| Print this symbol on YYOUTPUT. | |
`--------------------------------*/ |
/*----------------------------------------. |
| Print this symbol's value on YYOUTPUT. | |
`----------------------------------------*/ |
|
/*ARGSUSED*/ |
#if (defined __STDC__ || defined __C99__FUNC__ \ |
|| defined __cplusplus || defined _MSC_VER) |
static void |
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) |
#else |
static void |
yy_symbol_value_print (yyoutput, yytype, yyvaluep) |
FILE *yyoutput; |
int yytype; |
YYSTYPE const * const yyvaluep; |
#endif |
{ |
FILE *yyo = yyoutput; |
YYUSE (yyo); |
if (!yyvaluep) |
return; |
# ifdef YYPRINT |
if (yytype < YYNTOKENS) |
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); |
# else |
YYUSE (yyoutput); |
# endif |
switch (yytype) |
{ |
default: |
break; |
YYUSE (yytype); |
} |
} |
|
|
/*--------------------------------. |
768,22 → 708,11 |
| Print this symbol on YYOUTPUT. | |
`--------------------------------*/ |
|
#if (defined __STDC__ || defined __C99__FUNC__ \ |
|| defined __cplusplus || defined _MSC_VER) |
static void |
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) |
#else |
static void |
yy_symbol_print (yyoutput, yytype, yyvaluep) |
FILE *yyoutput; |
int yytype; |
YYSTYPE const * const yyvaluep; |
#endif |
{ |
if (yytype < YYNTOKENS) |
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); |
else |
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); |
YYFPRINTF (yyoutput, "%s %s (", |
yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); |
|
yy_symbol_value_print (yyoutput, yytype, yyvaluep); |
YYFPRINTF (yyoutput, ")"); |
794,20 → 723,15 |
| TOP (included). | |
`------------------------------------------------------------------*/ |
|
#if (defined __STDC__ || defined __C99__FUNC__ \ |
|| defined __cplusplus || defined _MSC_VER) |
static void |
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) |
#else |
static void |
yy_stack_print (bottom, top) |
yytype_int16 *bottom; |
yytype_int16 *top; |
#endif |
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) |
{ |
YYFPRINTF (stderr, "Stack now"); |
for (; bottom <= top; ++bottom) |
YYFPRINTF (stderr, " %d", *bottom); |
for (; yybottom <= yytop; yybottom++) |
{ |
int yybot = *yybottom; |
YYFPRINTF (stderr, " %d", yybot); |
} |
YYFPRINTF (stderr, "\n"); |
} |
|
815,7 → 739,7 |
do { \ |
if (yydebug) \ |
yy_stack_print ((Bottom), (Top)); \ |
} while (YYID (0)) |
} while (0) |
|
|
/*------------------------------------------------. |
822,30 → 746,23 |
| Report that the YYRULE is going to be reduced. | |
`------------------------------------------------*/ |
|
#if (defined __STDC__ || defined __C99__FUNC__ \ |
|| defined __cplusplus || defined _MSC_VER) |
static void |
yy_reduce_print (YYSTYPE *yyvsp, int yyrule) |
#else |
static void |
yy_reduce_print (yyvsp, yyrule) |
YYSTYPE *yyvsp; |
int yyrule; |
#endif |
yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) |
{ |
unsigned long int yylno = yyrline[yyrule]; |
int yynrhs = yyr2[yyrule]; |
int yyi; |
unsigned long int yylno = yyrline[yyrule]; |
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", |
yyrule - 1, yylno); |
/* The symbols being reduced. */ |
for (yyi = 0; yyi < yynrhs; yyi++) |
{ |
fprintf (stderr, " $%d = ", yyi + 1); |
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], |
YYFPRINTF (stderr, " $%d = ", yyi + 1); |
yy_symbol_print (stderr, |
yystos[yyssp[yyi + 1 - yynrhs]], |
&(yyvsp[(yyi + 1) - (yynrhs)]) |
); |
fprintf (stderr, "\n"); |
YYFPRINTF (stderr, "\n"); |
} |
} |
|
852,8 → 769,8 |
# define YY_REDUCE_PRINT(Rule) \ |
do { \ |
if (yydebug) \ |
yy_reduce_print (yyvsp, Rule); \ |
} while (YYID (0)) |
yy_reduce_print (yyssp, yyvsp, Rule); \ |
} while (0) |
|
/* Nonzero means print parse trace. It is left uninitialized so that |
multiple parsers can coexist. */ |
883,7 → 800,6 |
#endif |
|
|
|
#if YYERROR_VERBOSE |
|
# ifndef yystrlen |
891,15 → 807,8 |
# define yystrlen strlen |
# else |
/* Return the length of YYSTR. */ |
#if (defined __STDC__ || defined __C99__FUNC__ \ |
|| defined __cplusplus || defined _MSC_VER) |
static YYSIZE_T |
yystrlen (const char *yystr) |
#else |
static YYSIZE_T |
yystrlen (yystr) |
const char *yystr; |
#endif |
{ |
YYSIZE_T yylen; |
for (yylen = 0; yystr[yylen]; yylen++) |
915,16 → 824,8 |
# else |
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in |
YYDEST. */ |
#if (defined __STDC__ || defined __C99__FUNC__ \ |
|| defined __cplusplus || defined _MSC_VER) |
static char * |
yystpcpy (char *yydest, const char *yysrc) |
#else |
static char * |
yystpcpy (yydest, yysrc) |
char *yydest; |
const char *yysrc; |
#endif |
{ |
char *yyd = yydest; |
const char *yys = yysrc; |
985,251 → 886,226 |
} |
# endif |
|
/* Copy into YYRESULT an error message about the unexpected token |
YYCHAR while in state YYSTATE. Return the number of bytes copied, |
including the terminating null byte. If YYRESULT is null, do not |
copy anything; just return the number of bytes that would be |
copied. As a special case, return 0 if an ordinary "syntax error" |
message will do. Return YYSIZE_MAXIMUM if overflow occurs during |
size calculation. */ |
static YYSIZE_T |
yysyntax_error (char *yyresult, int yystate, int yychar) |
{ |
int yyn = yypact[yystate]; |
/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message |
about the unexpected token YYTOKEN for the state stack whose top is |
YYSSP. |
|
if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) |
return 0; |
else |
Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is |
not large enough to hold the message. In that case, also set |
*YYMSG_ALLOC to the required number of bytes. Return 2 if the |
required number of bytes is too large to store. */ |
static int |
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, |
yytype_int16 *yyssp, int yytoken) |
{ |
int yytype = YYTRANSLATE (yychar); |
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); |
YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); |
YYSIZE_T yysize = yysize0; |
YYSIZE_T yysize1; |
int yysize_overflow = 0; |
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; |
/* Internationalized format string. */ |
const char *yyformat = YY_NULL; |
/* Arguments of yyformat. */ |
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; |
int yyx; |
/* Number of reported tokens (one for the "unexpected", one per |
"expected"). */ |
int yycount = 0; |
|
# if 0 |
/* This is so xgettext sees the translatable formats that are |
constructed on the fly. */ |
YY_("syntax error, unexpected %s"); |
YY_("syntax error, unexpected %s, expecting %s"); |
YY_("syntax error, unexpected %s, expecting %s or %s"); |
YY_("syntax error, unexpected %s, expecting %s or %s or %s"); |
YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); |
# endif |
char *yyfmt; |
char const *yyf; |
static char const yyunexpected[] = "syntax error, unexpected %s"; |
static char const yyexpecting[] = ", expecting %s"; |
static char const yyor[] = " or %s"; |
char yyformat[sizeof yyunexpected |
+ sizeof yyexpecting - 1 |
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) |
* (sizeof yyor - 1))]; |
char const *yyprefix = yyexpecting; |
|
/* There are many possibilities here to consider: |
- If this state is a consistent state with a default action, then |
the only way this function was invoked is if the default action |
is an error action. In that case, don't check for expected |
tokens because there are none. |
- The only way there can be no lookahead present (in yychar) is if |
this state is a consistent state with a default action. Thus, |
detecting the absence of a lookahead is sufficient to determine |
that there is no unexpected or expected token to report. In that |
case, just report a simple "syntax error". |
- Don't assume there isn't a lookahead just because this state is a |
consistent state with a default action. There might have been a |
previous inconsistent state, consistent state with a non-default |
action, or user semantic action that manipulated yychar. |
- Of course, the expected token list depends on states to have |
correct lookahead information, and it depends on the parser not |
to perform extra reductions after fetching a lookahead from the |
scanner and before detecting a syntax error. Thus, state merging |
(from LALR or IELR) and default reductions corrupt the expected |
token list. However, the list is correct for canonical LR with |
one exception: it will still contain any token that will not be |
accepted due to an error action in a later state. |
*/ |
if (yytoken != YYEMPTY) |
{ |
int yyn = yypact[*yyssp]; |
yyarg[yycount++] = yytname[yytoken]; |
if (!yypact_value_is_default (yyn)) |
{ |
/* Start YYX at -YYN if negative to avoid negative indexes in |
YYCHECK. */ |
YYCHECK. In other words, skip the first -YYN actions for |
this state because they are default actions. */ |
int yyxbegin = yyn < 0 ? -yyn : 0; |
|
/* Stay within bounds of both yycheck and yytname. */ |
int yychecklim = YYLAST - yyn + 1; |
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; |
int yycount = 1; |
int yyx; |
|
yyarg[0] = yytname[yytype]; |
yyfmt = yystpcpy (yyformat, yyunexpected); |
|
for (yyx = yyxbegin; yyx < yyxend; ++yyx) |
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) |
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR |
&& !yytable_value_is_error (yytable[yyx + yyn])) |
{ |
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) |
{ |
yycount = 1; |
yysize = yysize0; |
yyformat[sizeof yyunexpected - 1] = '\0'; |
break; |
} |
yyarg[yycount++] = yytname[yyx]; |
yysize1 = yysize + yytnamerr (0, yytname[yyx]); |
yysize_overflow |= (yysize1 < yysize); |
{ |
YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); |
if (! (yysize <= yysize1 |
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM)) |
return 2; |
yysize = yysize1; |
yyfmt = yystpcpy (yyfmt, yyprefix); |
yyprefix = yyor; |
} |
} |
} |
} |
|
yyf = YY_(yyformat); |
yysize1 = yysize + yystrlen (yyf); |
yysize_overflow |= (yysize1 < yysize); |
switch (yycount) |
{ |
# define YYCASE_(N, S) \ |
case N: \ |
yyformat = S; \ |
break |
YYCASE_(0, YY_("syntax error")); |
YYCASE_(1, YY_("syntax error, unexpected %s")); |
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); |
YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); |
YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); |
YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); |
# undef YYCASE_ |
} |
|
{ |
YYSIZE_T yysize1 = yysize + yystrlen (yyformat); |
if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) |
return 2; |
yysize = yysize1; |
} |
|
if (yysize_overflow) |
return YYSIZE_MAXIMUM; |
if (*yymsg_alloc < yysize) |
{ |
*yymsg_alloc = 2 * yysize; |
if (! (yysize <= *yymsg_alloc |
&& *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) |
*yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; |
return 1; |
} |
|
if (yyresult) |
{ |
/* Avoid sprintf, as that infringes on the user's name space. |
Don't have undefined behavior even if the translation |
produced a string with the wrong number of "%s"s. */ |
char *yyp = yyresult; |
{ |
char *yyp = *yymsg; |
int yyi = 0; |
while ((*yyp = *yyf) != '\0') |
while ((*yyp = *yyformat) != '\0') |
if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) |
{ |
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) |
{ |
yyp += yytnamerr (yyp, yyarg[yyi++]); |
yyf += 2; |
yyformat += 2; |
} |
else |
{ |
yyp++; |
yyf++; |
yyformat++; |
} |
} |
return 0; |
} |
return yysize; |
} |
} |
#endif /* YYERROR_VERBOSE */ |
|
|
/*-----------------------------------------------. |
| Release the memory associated to this symbol. | |
`-----------------------------------------------*/ |
|
/*ARGSUSED*/ |
#if (defined __STDC__ || defined __C99__FUNC__ \ |
|| defined __cplusplus || defined _MSC_VER) |
static void |
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) |
#else |
static void |
yydestruct (yymsg, yytype, yyvaluep) |
const char *yymsg; |
int yytype; |
YYSTYPE *yyvaluep; |
#endif |
{ |
YYUSE (yyvaluep); |
|
if (!yymsg) |
yymsg = "Deleting"; |
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); |
|
switch (yytype) |
{ |
|
default: |
break; |
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
YYUSE (yytype); |
YY_IGNORE_MAYBE_UNINITIALIZED_END |
} |
} |
|
|
/* Prevent warnings from -Wmissing-prototypes. */ |
|
#ifdef YYPARSE_PARAM |
#if defined __STDC__ || defined __cplusplus |
int yyparse (void *YYPARSE_PARAM); |
#else |
int yyparse (); |
#endif |
#else /* ! YYPARSE_PARAM */ |
#if defined __STDC__ || defined __cplusplus |
int yyparse (void); |
#else |
int yyparse (); |
#endif |
#endif /* ! YYPARSE_PARAM */ |
|
|
|
/* The look-ahead symbol. */ |
/* The lookahead symbol. */ |
int yychar; |
|
/* The semantic value of the look-ahead symbol. */ |
/* The semantic value of the lookahead symbol. */ |
YYSTYPE yylval; |
|
/* Number of syntax errors so far. */ |
int yynerrs; |
|
|
|
/*----------. |
| yyparse. | |
`----------*/ |
|
#ifdef YYPARSE_PARAM |
#if (defined __STDC__ || defined __C99__FUNC__ \ |
|| defined __cplusplus || defined _MSC_VER) |
int |
yyparse (void *YYPARSE_PARAM) |
#else |
int |
yyparse (YYPARSE_PARAM) |
void *YYPARSE_PARAM; |
#endif |
#else /* ! YYPARSE_PARAM */ |
#if (defined __STDC__ || defined __C99__FUNC__ \ |
|| defined __cplusplus || defined _MSC_VER) |
int |
yyparse (void) |
#else |
int |
yyparse () |
|
#endif |
#endif |
{ |
|
int yystate; |
int yyn; |
int yyresult; |
/* Number of tokens to shift before error messages enabled. */ |
int yyerrstatus; |
/* Look-ahead token as an internal (translated) token number. */ |
int yytoken = 0; |
#if YYERROR_VERBOSE |
/* Buffer for error messages, and its allocated size. */ |
char yymsgbuf[128]; |
char *yymsg = yymsgbuf; |
YYSIZE_T yymsg_alloc = sizeof yymsgbuf; |
#endif |
|
/* Three stacks and their tools: |
`yyss': related to states, |
`yyvs': related to semantic values, |
`yyls': related to locations. |
/* The stacks and their tools: |
'yyss': related to states. |
'yyvs': related to semantic values. |
|
Refer to the stacks thru separate pointers, to allow yyoverflow |
Refer to the stacks through separate pointers, to allow yyoverflow |
to reallocate them elsewhere. */ |
|
/* The state stack. */ |
yytype_int16 yyssa[YYINITDEPTH]; |
yytype_int16 *yyss = yyssa; |
yytype_int16 *yyss; |
yytype_int16 *yyssp; |
|
/* The semantic value stack. */ |
YYSTYPE yyvsa[YYINITDEPTH]; |
YYSTYPE *yyvs = yyvsa; |
YYSTYPE *yyvs; |
YYSTYPE *yyvsp; |
|
YYSIZE_T yystacksize; |
|
|
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) |
|
YYSIZE_T yystacksize = YYINITDEPTH; |
|
int yyn; |
int yyresult; |
/* Lookahead token as an internal (translated) token number. */ |
int yytoken = 0; |
/* The variables used to return semantic value and location from the |
action routines. */ |
YYSTYPE yyval; |
|
#if YYERROR_VERBOSE |
/* Buffer for error messages, and its allocated size. */ |
char yymsgbuf[128]; |
char *yymsg = yymsgbuf; |
YYSIZE_T yymsg_alloc = sizeof yymsgbuf; |
#endif |
|
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) |
|
/* The number of symbols on the RHS of the reduced rule. |
Keep to zero when no symbol should be popped. */ |
int yylen = 0; |
|
yyssp = yyss = yyssa; |
yyvsp = yyvs = yyvsa; |
yystacksize = YYINITDEPTH; |
|
YYDPRINTF ((stderr, "Starting parse\n")); |
|
yystate = 0; |
1236,15 → 1112,6 |
yyerrstatus = 0; |
yynerrs = 0; |
yychar = YYEMPTY; /* Cause a token to be read. */ |
|
/* Initialize stack pointers. |
Waste one element of value and location stack |
so that they stay on the same level as the state stack. |
The wasted elements are never initialized. */ |
|
yyssp = yyss; |
yyvsp = yyvs; |
|
goto yysetstate; |
|
/*------------------------------------------------------------. |
1271,7 → 1138,6 |
YYSTYPE *yyvs1 = yyvs; |
yytype_int16 *yyss1 = yyss; |
|
|
/* Each stack pointer address is followed by the size of the |
data in use in that stack, in bytes. This used to be a |
conditional around just the two extra args, but that might |
1279,7 → 1145,6 |
yyoverflow (YY_("memory exhausted"), |
&yyss1, yysize * sizeof (*yyssp), |
&yyvs1, yysize * sizeof (*yyvsp), |
|
&yystacksize); |
|
yyss = yyss1; |
1302,9 → 1167,8 |
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); |
if (! yyptr) |
goto yyexhaustedlab; |
YYSTACK_RELOCATE (yyss); |
YYSTACK_RELOCATE (yyvs); |
|
YYSTACK_RELOCATE (yyss_alloc, yyss); |
YYSTACK_RELOCATE (yyvs_alloc, yyvs); |
# undef YYSTACK_RELOCATE |
if (yyss1 != yyssa) |
YYSTACK_FREE (yyss1); |
1315,7 → 1179,6 |
yyssp = yyss + yysize - 1; |
yyvsp = yyvs + yysize - 1; |
|
|
YYDPRINTF ((stderr, "Stack size increased to %lu\n", |
(unsigned long int) yystacksize)); |
|
1325,6 → 1188,9 |
|
YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
|
if (yystate == YYFINAL) |
YYACCEPT; |
|
goto yybackup; |
|
/*-----------. |
1333,20 → 1199,20 |
yybackup: |
|
/* Do appropriate processing given the current state. Read a |
look-ahead token if we need one and don't already have one. */ |
lookahead token if we need one and don't already have one. */ |
|
/* First try to decide what to do without reference to look-ahead token. */ |
/* First try to decide what to do without reference to lookahead token. */ |
yyn = yypact[yystate]; |
if (yyn == YYPACT_NINF) |
if (yypact_value_is_default (yyn)) |
goto yydefault; |
|
/* Not known => get a look-ahead token if don't already have one. */ |
/* Not known => get a lookahead token if don't already have one. */ |
|
/* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ |
/* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ |
if (yychar == YYEMPTY) |
{ |
YYDPRINTF ((stderr, "Reading a token: ")); |
yychar = YYLEX; |
yychar = yylex (); |
} |
|
if (yychar <= YYEOF) |
1368,29 → 1234,27 |
yyn = yytable[yyn]; |
if (yyn <= 0) |
{ |
if (yyn == 0 || yyn == YYTABLE_NINF) |
if (yytable_value_is_error (yyn)) |
goto yyerrlab; |
yyn = -yyn; |
goto yyreduce; |
} |
|
if (yyn == YYFINAL) |
YYACCEPT; |
|
/* Count tokens shifted since error; after three, turn off error |
status. */ |
if (yyerrstatus) |
yyerrstatus--; |
|
/* Shift the look-ahead token. */ |
/* Shift the lookahead token. */ |
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
|
/* Discard the shifted token unless it is eof. */ |
if (yychar != YYEOF) |
/* Discard the shifted token. */ |
yychar = YYEMPTY; |
|
yystate = yyn; |
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
*++yyvsp = yylval; |
YY_IGNORE_MAYBE_UNINITIALIZED_END |
|
goto yynewstate; |
|
1413,7 → 1277,7 |
yylen = yyr2[yyn]; |
|
/* If YYLEN is nonzero, implement the default value of the action: |
`$$ = $1'. |
'$$ = $1'. |
|
Otherwise, the following line sets YYVAL to garbage. |
This behavior is undocumented and Bison |
1427,124 → 1291,156 |
switch (yyn) |
{ |
case 2: |
#line 69 "arparse.y" |
#line 68 "arparse.y" /* yacc.c:1661 */ |
{ prompt(); } |
#line 1297 "arparse.c" /* yacc.c:1661 */ |
break; |
|
case 6: |
#line 78 "arparse.y" |
#line 77 "arparse.y" /* yacc.c:1661 */ |
{ prompt(); } |
#line 1303 "arparse.c" /* yacc.c:1661 */ |
break; |
|
case 19: |
#line 94 "arparse.y" |
#line 93 "arparse.y" /* yacc.c:1661 */ |
{ ar_end(); return 0; } |
#line 1309 "arparse.c" /* yacc.c:1661 */ |
break; |
|
case 21: |
#line 96 "arparse.y" |
#line 95 "arparse.y" /* yacc.c:1661 */ |
{ yyerror("foo"); } |
#line 1315 "arparse.c" /* yacc.c:1661 */ |
break; |
|
case 23: |
#line 103 "arparse.y" |
{ ar_extract((yyvsp[(2) - (2)].list)); } |
#line 102 "arparse.y" /* yacc.c:1661 */ |
{ ar_extract((yyvsp[0].list)); } |
#line 1321 "arparse.c" /* yacc.c:1661 */ |
break; |
|
case 24: |
#line 108 "arparse.y" |
{ ar_replace((yyvsp[(2) - (2)].list)); } |
#line 107 "arparse.y" /* yacc.c:1661 */ |
{ ar_replace((yyvsp[0].list)); } |
#line 1327 "arparse.c" /* yacc.c:1661 */ |
break; |
|
case 25: |
#line 113 "arparse.y" |
#line 112 "arparse.y" /* yacc.c:1661 */ |
{ ar_clear(); } |
#line 1333 "arparse.c" /* yacc.c:1661 */ |
break; |
|
case 26: |
#line 118 "arparse.y" |
{ ar_delete((yyvsp[(2) - (2)].list)); } |
#line 117 "arparse.y" /* yacc.c:1661 */ |
{ ar_delete((yyvsp[0].list)); } |
#line 1339 "arparse.c" /* yacc.c:1661 */ |
break; |
|
case 27: |
#line 122 "arparse.y" |
{ ar_addmod((yyvsp[(2) - (2)].list)); } |
#line 121 "arparse.y" /* yacc.c:1661 */ |
{ ar_addmod((yyvsp[0].list)); } |
#line 1345 "arparse.c" /* yacc.c:1661 */ |
break; |
|
case 28: |
#line 127 "arparse.y" |
#line 126 "arparse.y" /* yacc.c:1661 */ |
{ ar_list(); } |
#line 1351 "arparse.c" /* yacc.c:1661 */ |
break; |
|
case 29: |
#line 132 "arparse.y" |
#line 131 "arparse.y" /* yacc.c:1661 */ |
{ ar_save(); } |
#line 1357 "arparse.c" /* yacc.c:1661 */ |
break; |
|
case 30: |
#line 139 "arparse.y" |
{ ar_open((yyvsp[(2) - (2)].name),0); } |
#line 138 "arparse.y" /* yacc.c:1661 */ |
{ ar_open((yyvsp[0].name),0); } |
#line 1363 "arparse.c" /* yacc.c:1661 */ |
break; |
|
case 31: |
#line 144 "arparse.y" |
{ ar_open((yyvsp[(2) - (2)].name),1); } |
#line 143 "arparse.y" /* yacc.c:1661 */ |
{ ar_open((yyvsp[0].name),1); } |
#line 1369 "arparse.c" /* yacc.c:1661 */ |
break; |
|
case 32: |
#line 150 "arparse.y" |
{ ar_addlib((yyvsp[(2) - (3)].name),(yyvsp[(3) - (3)].list)); } |
#line 149 "arparse.y" /* yacc.c:1661 */ |
{ ar_addlib((yyvsp[-1].name),(yyvsp[0].list)); } |
#line 1375 "arparse.c" /* yacc.c:1661 */ |
break; |
|
case 33: |
#line 154 "arparse.y" |
{ ar_directory((yyvsp[(2) - (4)].name), (yyvsp[(3) - (4)].list), (yyvsp[(4) - (4)].name)); } |
#line 153 "arparse.y" /* yacc.c:1661 */ |
{ ar_directory((yyvsp[-2].name), (yyvsp[-1].list), (yyvsp[0].name)); } |
#line 1381 "arparse.c" /* yacc.c:1661 */ |
break; |
|
case 34: |
#line 161 "arparse.y" |
{ (yyval.name) = (yyvsp[(1) - (1)].name); } |
#line 160 "arparse.y" /* yacc.c:1661 */ |
{ (yyval.name) = (yyvsp[0].name); } |
#line 1387 "arparse.c" /* yacc.c:1661 */ |
break; |
|
case 35: |
#line 162 "arparse.y" |
#line 161 "arparse.y" /* yacc.c:1661 */ |
{ (yyval.name) = 0; } |
#line 1393 "arparse.c" /* yacc.c:1661 */ |
break; |
|
case 36: |
#line 167 "arparse.y" |
{ (yyval.list) = (yyvsp[(2) - (3)].list); } |
#line 166 "arparse.y" /* yacc.c:1661 */ |
{ (yyval.list) = (yyvsp[-1].list); } |
#line 1399 "arparse.c" /* yacc.c:1661 */ |
break; |
|
case 37: |
#line 169 "arparse.y" |
#line 168 "arparse.y" /* yacc.c:1661 */ |
{ (yyval.list) = 0; } |
#line 1405 "arparse.c" /* yacc.c:1661 */ |
break; |
|
case 38: |
#line 174 "arparse.y" |
#line 173 "arparse.y" /* yacc.c:1661 */ |
{ struct list *n = (struct list *) malloc(sizeof(struct list)); |
n->next = (yyvsp[(1) - (3)].list); |
n->name = (yyvsp[(3) - (3)].name); |
n->next = (yyvsp[-2].list); |
n->name = (yyvsp[0].name); |
(yyval.list) = n; |
} |
#line 1415 "arparse.c" /* yacc.c:1661 */ |
break; |
|
case 39: |
#line 179 "arparse.y" |
#line 178 "arparse.y" /* yacc.c:1661 */ |
{ (yyval.list) = 0; } |
#line 1421 "arparse.c" /* yacc.c:1661 */ |
break; |
|
case 42: |
#line 191 "arparse.y" |
#line 190 "arparse.y" /* yacc.c:1661 */ |
{ verbose = !verbose; } |
#line 1427 "arparse.c" /* yacc.c:1661 */ |
break; |
|
|
/* Line 1267 of yacc.c. */ |
#line 1546 "arparse.c" |
#line 1431 "arparse.c" /* yacc.c:1661 */ |
default: break; |
} |
/* User semantic actions sometimes alter yychar, and that requires |
that yytoken be updated with the new translation. We take the |
approach of translating immediately before every use of yytoken. |
One alternative is translating here after every semantic action, |
but that translation would be missed if the semantic action invokes |
YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or |
if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an |
incorrect destructor might then be invoked immediately. In the |
case of YYERROR or YYBACKUP, subsequent parser actions might lead |
to an incorrect destructor call or verbose syntax error message |
before the lookahead is translated. */ |
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); |
|
YYPOPSTACK (yylen); |
1553,8 → 1449,7 |
|
*++yyvsp = yyval; |
|
|
/* Now `shift' the result of the reduction. Determine what state |
/* Now 'shift' the result of the reduction. Determine what state |
that goes to, based on the state we popped back to and the rule |
number reduced by. */ |
|
1569,10 → 1464,14 |
goto yynewstate; |
|
|
/*------------------------------------. |
| yyerrlab -- here on detecting error | |
`------------------------------------*/ |
/*--------------------------------------. |
| yyerrlab -- here on detecting error. | |
`--------------------------------------*/ |
yyerrlab: |
/* Make sure we have latest lookahead translation. See comments at |
user semantic actions for why this is necessary. */ |
yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); |
|
/* If not already recovering from an error, report this error. */ |
if (!yyerrstatus) |
{ |
1580,37 → 1479,36 |
#if ! YYERROR_VERBOSE |
yyerror (YY_("syntax error")); |
#else |
# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ |
yyssp, yytoken) |
{ |
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); |
if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) |
char const *yymsgp = YY_("syntax error"); |
int yysyntax_error_status; |
yysyntax_error_status = YYSYNTAX_ERROR; |
if (yysyntax_error_status == 0) |
yymsgp = yymsg; |
else if (yysyntax_error_status == 1) |
{ |
YYSIZE_T yyalloc = 2 * yysize; |
if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) |
yyalloc = YYSTACK_ALLOC_MAXIMUM; |
if (yymsg != yymsgbuf) |
YYSTACK_FREE (yymsg); |
yymsg = (char *) YYSTACK_ALLOC (yyalloc); |
if (yymsg) |
yymsg_alloc = yyalloc; |
else |
yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); |
if (!yymsg) |
{ |
yymsg = yymsgbuf; |
yymsg_alloc = sizeof yymsgbuf; |
yysyntax_error_status = 2; |
} |
} |
|
if (0 < yysize && yysize <= yymsg_alloc) |
else |
{ |
(void) yysyntax_error (yymsg, yystate, yychar); |
yyerror (yymsg); |
yysyntax_error_status = YYSYNTAX_ERROR; |
yymsgp = yymsg; |
} |
else |
{ |
yyerror (YY_("syntax error")); |
if (yysize != 0) |
} |
yyerror (yymsgp); |
if (yysyntax_error_status == 2) |
goto yyexhaustedlab; |
} |
} |
# undef YYSYNTAX_ERROR |
#endif |
} |
|
1618,7 → 1516,7 |
|
if (yyerrstatus == 3) |
{ |
/* If just tried and failed to reuse look-ahead token after an |
/* If just tried and failed to reuse lookahead token after an |
error, discard it. */ |
|
if (yychar <= YYEOF) |
1635,7 → 1533,7 |
} |
} |
|
/* Else will try to reuse look-ahead token after shifting the error |
/* Else will try to reuse lookahead token after shifting the error |
token. */ |
goto yyerrlab1; |
|
1651,7 → 1549,7 |
if (/*CONSTCOND*/ 0) |
goto yyerrorlab; |
|
/* Do not reclaim the symbols of the rule which action triggered |
/* Do not reclaim the symbols of the rule whose action triggered |
this YYERROR. */ |
YYPOPSTACK (yylen); |
yylen = 0; |
1669,7 → 1567,7 |
for (;;) |
{ |
yyn = yypact[yystate]; |
if (yyn != YYPACT_NINF) |
if (!yypact_value_is_default (yyn)) |
{ |
yyn += YYTERROR; |
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) |
1692,10 → 1590,9 |
YY_STACK_PRINT (yyss, yyssp); |
} |
|
if (yyn == YYFINAL) |
YYACCEPT; |
|
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
*++yyvsp = yylval; |
YY_IGNORE_MAYBE_UNINITIALIZED_END |
|
|
/* Shift the error token. */ |
1719,7 → 1616,7 |
yyresult = 1; |
goto yyreturn; |
|
#ifndef yyoverflow |
#if !defined yyoverflow || YYERROR_VERBOSE |
/*-------------------------------------------------. |
| yyexhaustedlab -- memory exhaustion comes here. | |
`-------------------------------------------------*/ |
1730,10 → 1627,15 |
#endif |
|
yyreturn: |
if (yychar != YYEOF && yychar != YYEMPTY) |
if (yychar != YYEMPTY) |
{ |
/* Make sure we have latest lookahead translation. See comments at |
user semantic actions for why this is necessary. */ |
yytoken = YYTRANSLATE (yychar); |
yydestruct ("Cleanup: discarding lookahead", |
yytoken, &yylval); |
/* Do not reclaim the symbols of the rule which action triggered |
} |
/* Do not reclaim the symbols of the rule whose action triggered |
this YYABORT or YYACCEPT. */ |
YYPOPSTACK (yylen); |
YY_STACK_PRINT (yyss, yyssp); |
1751,14 → 1653,11 |
if (yymsg != yymsgbuf) |
YYSTACK_FREE (yymsg); |
#endif |
/* Make sure YYID is used. */ |
return YYID (yyresult); |
return yyresult; |
} |
#line 194 "arparse.y" /* yacc.c:1906 */ |
|
|
#line 195 "arparse.y" |
|
|
static int |
yyerror (const char *x ATTRIBUTE_UNUSED) |
{ |
1767,4 → 1666,3 |
printf (_("Syntax error in archive script, line %d\n"), linenumber + 1); |
return 0; |
} |
|