Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 1 | /* A Bison parser, made by GNU Bison 2.7. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 3 | /* Bison implementation for Yacc-like parsers in C |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 4 | |
Jan Beulich | dc53324 | 2014-04-03 14:46:37 -0700 | [diff] [blame] | 5 | Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 6 | |
| 7 | This program is free software: you can redistribute it and/or modify |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 8 | it under the terms of the GNU General Public License as published by |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 9 | the Free Software Foundation, either version 3 of the License, or |
| 10 | (at your option) any later version. |
| 11 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 12 | This program is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | GNU General Public License for more details. |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 16 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 17 | You should have received a copy of the GNU General Public License |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 19 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 20 | /* As a special exception, you may create a larger work that contains |
| 21 | part or all of the Bison parser skeleton and distribute that work |
| 22 | under terms of your choice, so long as that work isn't itself a |
| 23 | parser generator using the skeleton or a modified version thereof |
| 24 | as a parser skeleton. Alternatively, if you modify or redistribute |
| 25 | the parser skeleton itself, you may (at your option) remove this |
| 26 | special exception, which will cause the skeleton and the resulting |
| 27 | Bison output files to be licensed under the GNU General Public |
| 28 | License without this special exception. |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 29 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 30 | This special exception was added by the Free Software Foundation in |
| 31 | version 2.2 of Bison. */ |
| 32 | |
| 33 | /* C LALR(1) parser skeleton written by Richard Stallman, by |
| 34 | simplifying the original so-called "semantic" parser. */ |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 35 | |
| 36 | /* All symbols defined below should begin with yy or YY, to avoid |
| 37 | infringing on user name space. This should be done even for local |
| 38 | variables, as they might otherwise be expanded by user macros. |
| 39 | There are some unavoidable exceptions within include files to |
| 40 | define necessary library symbols; they are noted "INFRINGES ON |
| 41 | USER NAME SPACE" below. */ |
| 42 | |
| 43 | /* Identify Bison output. */ |
| 44 | #define YYBISON 1 |
| 45 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 46 | /* Bison version. */ |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 47 | #define YYBISON_VERSION "2.7" |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 48 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 49 | /* Skeleton name. */ |
| 50 | #define YYSKELETON_NAME "yacc.c" |
| 51 | |
| 52 | /* Pure parsers. */ |
| 53 | #define YYPURE 0 |
| 54 | |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 55 | /* Push parsers. */ |
| 56 | #define YYPUSH 0 |
| 57 | |
| 58 | /* Pull parsers. */ |
| 59 | #define YYPULL 1 |
| 60 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 61 | |
| 62 | |
| 63 | |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 64 | /* Copy the first part of user declarations. */ |
| 65 | |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 66 | |
| 67 | |
| 68 | #include <assert.h> |
| 69 | #include <stdlib.h> |
| 70 | #include <string.h> |
| 71 | #include "genksyms.h" |
| 72 | |
| 73 | static int is_typedef; |
| 74 | static int is_extern; |
| 75 | static char *current_name; |
| 76 | static struct string_list *decl_spec; |
| 77 | |
| 78 | static void yyerror(const char *); |
| 79 | |
| 80 | static inline void |
| 81 | remove_node(struct string_list **p) |
| 82 | { |
| 83 | struct string_list *node = *p; |
| 84 | *p = node->next; |
| 85 | free_node(node); |
| 86 | } |
| 87 | |
| 88 | static inline void |
| 89 | remove_list(struct string_list **pb, struct string_list **pe) |
| 90 | { |
| 91 | struct string_list *b = *pb, *e = *pe; |
| 92 | *pb = e; |
| 93 | free_list(b, e); |
| 94 | } |
| 95 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 96 | /* Record definition of a struct/union/enum */ |
| 97 | static void record_compound(struct string_list **keyw, |
| 98 | struct string_list **ident, |
| 99 | struct string_list **body, |
| 100 | enum symbol_type type) |
| 101 | { |
| 102 | struct string_list *b = *body, *i = *ident, *r; |
| 103 | |
| 104 | if (i->in_source_file) { |
| 105 | remove_node(keyw); |
| 106 | (*ident)->tag = type; |
| 107 | remove_list(body, ident); |
| 108 | return; |
| 109 | } |
| 110 | r = copy_node(i); r->tag = type; |
| 111 | r->next = (*keyw)->next; *body = r; (*keyw)->next = NULL; |
| 112 | add_symbol(i->string, type, b, is_extern); |
| 113 | } |
| 114 | |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 115 | |
| 116 | |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 117 | |
Jan Beulich | dc53324 | 2014-04-03 14:46:37 -0700 | [diff] [blame] | 118 | # ifndef YY_NULL |
| 119 | # if defined __cplusplus && 201103L <= __cplusplus |
| 120 | # define YY_NULL nullptr |
| 121 | # else |
| 122 | # define YY_NULL 0 |
| 123 | # endif |
| 124 | # endif |
| 125 | |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 126 | /* Enabling verbose error messages. */ |
| 127 | #ifdef YYERROR_VERBOSE |
| 128 | # undef YYERROR_VERBOSE |
| 129 | # define YYERROR_VERBOSE 1 |
| 130 | #else |
| 131 | # define YYERROR_VERBOSE 0 |
| 132 | #endif |
| 133 | |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 134 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 135 | /* Enabling traces. */ |
| 136 | #ifndef YYDEBUG |
| 137 | # define YYDEBUG 1 |
| 138 | #endif |
| 139 | #if YYDEBUG |
| 140 | extern int yydebug; |
| 141 | #endif |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 142 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 143 | /* Tokens. */ |
| 144 | #ifndef YYTOKENTYPE |
| 145 | # define YYTOKENTYPE |
| 146 | /* Put the tokens into the symbol table, so that GDB and other debuggers |
| 147 | know about them. */ |
| 148 | enum yytokentype { |
| 149 | ASM_KEYW = 258, |
| 150 | ATTRIBUTE_KEYW = 259, |
| 151 | AUTO_KEYW = 260, |
| 152 | BOOL_KEYW = 261, |
| 153 | CHAR_KEYW = 262, |
| 154 | CONST_KEYW = 263, |
| 155 | DOUBLE_KEYW = 264, |
| 156 | ENUM_KEYW = 265, |
| 157 | EXTERN_KEYW = 266, |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 158 | EXTENSION_KEYW = 267, |
| 159 | FLOAT_KEYW = 268, |
| 160 | INLINE_KEYW = 269, |
| 161 | INT_KEYW = 270, |
| 162 | LONG_KEYW = 271, |
| 163 | REGISTER_KEYW = 272, |
| 164 | RESTRICT_KEYW = 273, |
| 165 | SHORT_KEYW = 274, |
| 166 | SIGNED_KEYW = 275, |
| 167 | STATIC_KEYW = 276, |
| 168 | STRUCT_KEYW = 277, |
| 169 | TYPEDEF_KEYW = 278, |
| 170 | UNION_KEYW = 279, |
| 171 | UNSIGNED_KEYW = 280, |
| 172 | VOID_KEYW = 281, |
| 173 | VOLATILE_KEYW = 282, |
| 174 | TYPEOF_KEYW = 283, |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 175 | VA_LIST_KEYW = 284, |
| 176 | EXPORT_SYMBOL_KEYW = 285, |
| 177 | ASM_PHRASE = 286, |
| 178 | ATTRIBUTE_PHRASE = 287, |
| 179 | TYPEOF_PHRASE = 288, |
| 180 | BRACE_PHRASE = 289, |
| 181 | BRACKET_PHRASE = 290, |
| 182 | EXPRESSION_PHRASE = 291, |
| 183 | CHAR = 292, |
| 184 | DOTS = 293, |
| 185 | IDENT = 294, |
| 186 | INT = 295, |
| 187 | REAL = 296, |
| 188 | STRING = 297, |
| 189 | TYPE = 298, |
| 190 | OTHER = 299, |
| 191 | FILENAME = 300 |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 192 | }; |
| 193 | #endif |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 194 | |
| 195 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 196 | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 197 | typedef int YYSTYPE; |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 198 | # define YYSTYPE_IS_TRIVIAL 1 |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 199 | # define yystype YYSTYPE /* obsolescent; will be withdrawn */ |
| 200 | # define YYSTYPE_IS_DECLARED 1 |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 201 | #endif |
| 202 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 203 | extern YYSTYPE yylval; |
| 204 | |
| 205 | #ifdef YYPARSE_PARAM |
| 206 | #if defined __STDC__ || defined __cplusplus |
| 207 | int yyparse (void *YYPARSE_PARAM); |
| 208 | #else |
| 209 | int yyparse (); |
| 210 | #endif |
| 211 | #else /* ! YYPARSE_PARAM */ |
| 212 | #if defined __STDC__ || defined __cplusplus |
| 213 | int yyparse (void); |
| 214 | #else |
| 215 | int yyparse (); |
| 216 | #endif |
| 217 | #endif /* ! YYPARSE_PARAM */ |
| 218 | |
| 219 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 220 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 221 | /* Copy the second part of user declarations. */ |
| 222 | |
| 223 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 224 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 225 | #ifdef short |
| 226 | # undef short |
| 227 | #endif |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 228 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 229 | #ifdef YYTYPE_UINT8 |
| 230 | typedef YYTYPE_UINT8 yytype_uint8; |
| 231 | #else |
| 232 | typedef unsigned char yytype_uint8; |
| 233 | #endif |
| 234 | |
| 235 | #ifdef YYTYPE_INT8 |
| 236 | typedef YYTYPE_INT8 yytype_int8; |
| 237 | #elif (defined __STDC__ || defined __C99__FUNC__ \ |
| 238 | || defined __cplusplus || defined _MSC_VER) |
| 239 | typedef signed char yytype_int8; |
| 240 | #else |
| 241 | typedef short int yytype_int8; |
| 242 | #endif |
| 243 | |
| 244 | #ifdef YYTYPE_UINT16 |
| 245 | typedef YYTYPE_UINT16 yytype_uint16; |
| 246 | #else |
| 247 | typedef unsigned short int yytype_uint16; |
| 248 | #endif |
| 249 | |
| 250 | #ifdef YYTYPE_INT16 |
| 251 | typedef YYTYPE_INT16 yytype_int16; |
| 252 | #else |
| 253 | typedef short int yytype_int16; |
| 254 | #endif |
| 255 | |
| 256 | #ifndef YYSIZE_T |
| 257 | # ifdef __SIZE_TYPE__ |
| 258 | # define YYSIZE_T __SIZE_TYPE__ |
| 259 | # elif defined size_t |
| 260 | # define YYSIZE_T size_t |
| 261 | # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ |
| 262 | || defined __cplusplus || defined _MSC_VER) |
| 263 | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
| 264 | # define YYSIZE_T size_t |
| 265 | # else |
| 266 | # define YYSIZE_T unsigned int |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 267 | # endif |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 268 | #endif |
| 269 | |
| 270 | #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
| 271 | |
| 272 | #ifndef YY_ |
Arnaud Lacombe | 58ef81c | 2011-05-23 01:52:59 -0400 | [diff] [blame] | 273 | # if defined YYENABLE_NLS && YYENABLE_NLS |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 274 | # if ENABLE_NLS |
| 275 | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 276 | # define YY_(Msgid) dgettext ("bison-runtime", Msgid) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 277 | # endif |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 278 | # endif |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 279 | # ifndef YY_ |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 280 | # define YY_(Msgid) Msgid |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 281 | # endif |
| 282 | #endif |
| 283 | |
| 284 | /* Suppress unused-variable warnings by "using" E. */ |
| 285 | #if ! defined lint || defined __GNUC__ |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 286 | # define YYUSE(E) ((void) (E)) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 287 | #else |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 288 | # define YYUSE(E) /* empty */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 289 | #endif |
| 290 | |
| 291 | /* Identity function, used to suppress warnings about constant conditions. */ |
| 292 | #ifndef lint |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 293 | # define YYID(N) (N) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 294 | #else |
| 295 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 296 | || defined __cplusplus || defined _MSC_VER) |
| 297 | static int |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 298 | YYID (int yyi) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 299 | #else |
| 300 | static int |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 301 | YYID (yyi) |
| 302 | int yyi; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 303 | #endif |
| 304 | { |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 305 | return yyi; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 306 | } |
| 307 | #endif |
| 308 | |
| 309 | #if ! defined yyoverflow || YYERROR_VERBOSE |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 310 | |
| 311 | /* The parser invokes alloca or malloc; define the necessary symbols. */ |
| 312 | |
| 313 | # ifdef YYSTACK_USE_ALLOCA |
| 314 | # if YYSTACK_USE_ALLOCA |
| 315 | # ifdef __GNUC__ |
| 316 | # define YYSTACK_ALLOC __builtin_alloca |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 317 | # elif defined __BUILTIN_VA_ARG_INCR |
| 318 | # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ |
| 319 | # elif defined _AIX |
| 320 | # define YYSTACK_ALLOC __alloca |
| 321 | # elif defined _MSC_VER |
| 322 | # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ |
| 323 | # define alloca _alloca |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 324 | # else |
| 325 | # define YYSTACK_ALLOC alloca |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 326 | # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 327 | || defined __cplusplus || defined _MSC_VER) |
| 328 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
Jan Beulich | dc53324 | 2014-04-03 14:46:37 -0700 | [diff] [blame] | 329 | /* Use EXIT_SUCCESS as a witness for stdlib.h. */ |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 330 | # ifndef EXIT_SUCCESS |
| 331 | # define EXIT_SUCCESS 0 |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 332 | # endif |
| 333 | # endif |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 334 | # endif |
| 335 | # endif |
| 336 | # endif |
| 337 | |
| 338 | # ifdef YYSTACK_ALLOC |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 339 | /* Pacify GCC's `empty if-body' warning. */ |
| 340 | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) |
| 341 | # ifndef YYSTACK_ALLOC_MAXIMUM |
| 342 | /* The OS might guarantee only one guard page at the bottom of the stack, |
| 343 | and a page size can be as small as 4096 bytes. So we cannot safely |
| 344 | invoke alloca (N) if N exceeds 4096. Use a slightly smaller number |
| 345 | to allow for a few compiler-allocated temporary stack slots. */ |
| 346 | # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 347 | # endif |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 348 | # else |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 349 | # define YYSTACK_ALLOC YYMALLOC |
| 350 | # define YYSTACK_FREE YYFREE |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 351 | # ifndef YYSTACK_ALLOC_MAXIMUM |
| 352 | # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
| 353 | # endif |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 354 | # if (defined __cplusplus && ! defined EXIT_SUCCESS \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 355 | && ! ((defined YYMALLOC || defined malloc) \ |
| 356 | && (defined YYFREE || defined free))) |
| 357 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 358 | # ifndef EXIT_SUCCESS |
| 359 | # define EXIT_SUCCESS 0 |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 360 | # endif |
| 361 | # endif |
| 362 | # ifndef YYMALLOC |
| 363 | # define YYMALLOC malloc |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 364 | # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 365 | || defined __cplusplus || defined _MSC_VER) |
| 366 | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ |
| 367 | # endif |
| 368 | # endif |
| 369 | # ifndef YYFREE |
| 370 | # define YYFREE free |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 371 | # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 372 | || defined __cplusplus || defined _MSC_VER) |
| 373 | void free (void *); /* INFRINGES ON USER NAME SPACE */ |
| 374 | # endif |
| 375 | # endif |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 376 | # endif |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 377 | #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 378 | |
| 379 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 380 | #if (! defined yyoverflow \ |
| 381 | && (! defined __cplusplus \ |
| 382 | || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 383 | |
| 384 | /* A type that is properly aligned for any stack member. */ |
| 385 | union yyalloc |
| 386 | { |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 387 | yytype_int16 yyss_alloc; |
| 388 | YYSTYPE yyvs_alloc; |
| 389 | }; |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 390 | |
| 391 | /* The size of the maximum gap between one aligned stack and the next. */ |
| 392 | # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
| 393 | |
| 394 | /* The size of an array large to enough to hold all stacks, each with |
| 395 | N elements. */ |
| 396 | # define YYSTACK_BYTES(N) \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 397 | ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 398 | + YYSTACK_GAP_MAXIMUM) |
| 399 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 400 | # define YYCOPY_NEEDED 1 |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 401 | |
| 402 | /* Relocate STACK from its old location to the new one. The |
| 403 | local variables YYSIZE and YYSTACKSIZE give the old and new number of |
| 404 | elements in the stack, and YYPTR gives the new location of the |
| 405 | stack. Advance YYPTR to a properly aligned location for the next |
| 406 | stack. */ |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 407 | # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 408 | do \ |
| 409 | { \ |
| 410 | YYSIZE_T yynewbytes; \ |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 411 | YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ |
| 412 | Stack = &yyptr->Stack_alloc; \ |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 413 | yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ |
| 414 | yyptr += yynewbytes / sizeof (*yyptr); \ |
| 415 | } \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 416 | while (YYID (0)) |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 417 | |
| 418 | #endif |
| 419 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 420 | #if defined YYCOPY_NEEDED && YYCOPY_NEEDED |
Jan Beulich | dc53324 | 2014-04-03 14:46:37 -0700 | [diff] [blame] | 421 | /* Copy COUNT objects from SRC to DST. The source and destination do |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 422 | not overlap. */ |
| 423 | # ifndef YYCOPY |
| 424 | # if defined __GNUC__ && 1 < __GNUC__ |
Jan Beulich | dc53324 | 2014-04-03 14:46:37 -0700 | [diff] [blame] | 425 | # define YYCOPY(Dst, Src, Count) \ |
| 426 | __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 427 | # else |
Jan Beulich | dc53324 | 2014-04-03 14:46:37 -0700 | [diff] [blame] | 428 | # define YYCOPY(Dst, Src, Count) \ |
| 429 | do \ |
| 430 | { \ |
| 431 | YYSIZE_T yyi; \ |
| 432 | for (yyi = 0; yyi < (Count); yyi++) \ |
| 433 | (Dst)[yyi] = (Src)[yyi]; \ |
| 434 | } \ |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 435 | while (YYID (0)) |
| 436 | # endif |
| 437 | # endif |
| 438 | #endif /* !YYCOPY_NEEDED */ |
| 439 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 440 | /* YYFINAL -- State number of the termination state. */ |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 441 | #define YYFINAL 4 |
| 442 | /* YYLAST -- Last index in YYTABLE. */ |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 443 | #define YYLAST 522 |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 444 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 445 | /* YYNTOKENS -- Number of terminals. */ |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 446 | #define YYNTOKENS 55 |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 447 | /* YYNNTS -- Number of nonterminals. */ |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 448 | #define YYNNTS 49 |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 449 | /* YYNRULES -- Number of rules. */ |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 450 | #define YYNRULES 133 |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 451 | /* YYNRULES -- Number of states. */ |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 452 | #define YYNSTATES 187 |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 453 | |
| 454 | /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ |
| 455 | #define YYUNDEFTOK 2 |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 456 | #define YYMAXUTOK 300 |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 457 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 458 | #define YYTRANSLATE(YYX) \ |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 459 | ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
| 460 | |
| 461 | /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 462 | static const yytype_uint8 yytranslate[] = |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 463 | { |
| 464 | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 465 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 466 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 467 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 468 | 49, 50, 51, 2, 48, 2, 2, 2, 2, 2, |
| 469 | 2, 2, 2, 2, 2, 2, 2, 2, 54, 46, |
| 470 | 2, 52, 2, 2, 2, 2, 2, 2, 2, 2, |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 471 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 472 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 473 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 474 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 475 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 476 | 2, 2, 2, 53, 2, 47, 2, 2, 2, 2, |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 477 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 478 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 479 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 480 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 481 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 482 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 483 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 484 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 485 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 486 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 487 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 488 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 489 | 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, |
| 490 | 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, |
| 491 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, |
| 492 | 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 493 | 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, |
| 494 | 45 |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 495 | }; |
| 496 | |
| 497 | #if YYDEBUG |
| 498 | /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in |
| 499 | YYRHS. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 500 | static const yytype_uint16 yyprhs[] = |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 501 | { |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 502 | 0, 0, 3, 5, 8, 9, 12, 13, 18, 19, |
| 503 | 23, 25, 27, 29, 31, 34, 37, 41, 42, 44, |
| 504 | 46, 50, 55, 56, 58, 60, 63, 65, 67, 69, |
Jan Beulich | dc53324 | 2014-04-03 14:46:37 -0700 | [diff] [blame] | 505 | 71, 73, 75, 77, 79, 81, 86, 88, 91, 94, |
| 506 | 97, 101, 105, 109, 112, 115, 118, 120, 122, 124, |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 507 | 126, 128, 130, 132, 134, 136, 138, 140, 142, 145, |
| 508 | 146, 148, 150, 153, 155, 157, 159, 161, 164, 166, |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 509 | 168, 170, 175, 180, 183, 187, 190, 192, 194, 196, |
| 510 | 201, 206, 209, 213, 217, 220, 222, 226, 227, 229, |
| 511 | 231, 235, 238, 241, 243, 244, 246, 248, 253, 258, |
| 512 | 261, 265, 269, 273, 274, 276, 279, 283, 287, 288, |
| 513 | 290, 292, 295, 299, 302, 303, 305, 307, 311, 314, |
| 514 | 317, 319, 322, 323, 326, 330, 335, 337, 341, 343, |
| 515 | 347, 350, 351, 353 |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 516 | }; |
| 517 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 518 | /* YYRHS -- A `-1'-separated list of the rules' RHS. */ |
| 519 | static const yytype_int8 yyrhs[] = |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 520 | { |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 521 | 56, 0, -1, 57, -1, 56, 57, -1, -1, 58, |
| 522 | 59, -1, -1, 12, 23, 60, 62, -1, -1, 23, |
| 523 | 61, 62, -1, 62, -1, 86, -1, 101, -1, 103, |
| 524 | -1, 1, 46, -1, 1, 47, -1, 66, 63, 46, |
| 525 | -1, -1, 64, -1, 65, -1, 64, 48, 65, -1, |
| 526 | 76, 102, 97, 87, -1, -1, 67, -1, 68, -1, |
| 527 | 67, 68, -1, 69, -1, 70, -1, 5, -1, 17, |
| 528 | -1, 21, -1, 11, -1, 14, -1, 71, -1, 75, |
| 529 | -1, 28, 49, 83, 50, -1, 33, -1, 22, 39, |
| 530 | -1, 24, 39, -1, 10, 39, -1, 22, 39, 89, |
| 531 | -1, 24, 39, 89, -1, 10, 39, 98, -1, 10, |
| 532 | 98, -1, 22, 89, -1, 24, 89, -1, 7, -1, |
Jan Beulich | dc53324 | 2014-04-03 14:46:37 -0700 | [diff] [blame] | 533 | 19, -1, 15, -1, 16, -1, 20, -1, 25, -1, |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 534 | 13, -1, 9, -1, 26, -1, 6, -1, 29, -1, |
| 535 | 43, -1, 51, 73, -1, -1, 74, -1, 75, -1, |
| 536 | 74, 75, -1, 8, -1, 27, -1, 32, -1, 18, |
| 537 | -1, 72, 76, -1, 77, -1, 39, -1, 43, -1, |
| 538 | 77, 49, 80, 50, -1, 77, 49, 1, 50, -1, |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 539 | 77, 35, -1, 49, 76, 50, -1, 72, 78, -1, |
| 540 | 79, -1, 39, -1, 43, -1, 79, 49, 80, 50, |
| 541 | -1, 79, 49, 1, 50, -1, 79, 35, -1, 49, |
| 542 | 78, 50, -1, 49, 1, 50, -1, 81, 38, -1, |
| 543 | 81, -1, 82, 48, 38, -1, -1, 82, -1, 83, |
| 544 | -1, 82, 48, 83, -1, 67, 84, -1, 72, 84, |
| 545 | -1, 85, -1, -1, 39, -1, 43, -1, 85, 49, |
| 546 | 80, 50, -1, 85, 49, 1, 50, -1, 85, 35, |
| 547 | -1, 49, 84, 50, -1, 49, 1, 50, -1, 66, |
| 548 | 76, 34, -1, -1, 88, -1, 52, 36, -1, 53, |
| 549 | 90, 47, -1, 53, 1, 47, -1, -1, 91, -1, |
| 550 | 92, -1, 91, 92, -1, 66, 93, 46, -1, 1, |
| 551 | 46, -1, -1, 94, -1, 95, -1, 94, 48, 95, |
| 552 | -1, 78, 97, -1, 39, 96, -1, 96, -1, 54, |
| 553 | 36, -1, -1, 97, 32, -1, 53, 99, 47, -1, |
| 554 | 53, 99, 48, 47, -1, 100, -1, 99, 48, 100, |
| 555 | -1, 39, -1, 39, 52, 36, -1, 31, 46, -1, |
| 556 | -1, 31, -1, 30, 49, 39, 50, 46, -1 |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 557 | }; |
| 558 | |
| 559 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 560 | static const yytype_uint16 yyrline[] = |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 561 | { |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 562 | 0, 125, 125, 126, 130, 130, 136, 136, 138, 138, |
| 563 | 140, 141, 142, 143, 144, 145, 149, 163, 164, 168, |
| 564 | 176, 189, 195, 196, 200, 201, 205, 211, 215, 216, |
| 565 | 217, 218, 219, 223, 224, 225, 226, 230, 232, 234, |
| 566 | 238, 240, 242, 247, 250, 251, 255, 256, 257, 258, |
| 567 | 259, 260, 261, 262, 263, 264, 265, 266, 270, 275, |
| 568 | 276, 280, 281, 285, 285, 285, 286, 294, 295, 299, |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 569 | 308, 317, 319, 321, 323, 330, 331, 335, 336, 337, |
| 570 | 339, 341, 343, 345, 350, 351, 352, 356, 357, 361, |
| 571 | 362, 367, 372, 374, 378, 379, 387, 391, 393, 395, |
| 572 | 397, 399, 404, 413, 414, 419, 424, 425, 429, 430, |
| 573 | 434, 435, 439, 441, 446, 447, 451, 452, 456, 457, |
| 574 | 458, 462, 466, 467, 471, 472, 476, 477, 480, 485, |
| 575 | 493, 497, 498, 502 |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 576 | }; |
| 577 | #endif |
| 578 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 579 | #if YYDEBUG || YYERROR_VERBOSE || 0 |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 580 | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
| 581 | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 582 | static const char *const yytname[] = |
| 583 | { |
| 584 | "$end", "error", "$undefined", "ASM_KEYW", "ATTRIBUTE_KEYW", |
| 585 | "AUTO_KEYW", "BOOL_KEYW", "CHAR_KEYW", "CONST_KEYW", "DOUBLE_KEYW", |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 586 | "ENUM_KEYW", "EXTERN_KEYW", "EXTENSION_KEYW", "FLOAT_KEYW", |
| 587 | "INLINE_KEYW", "INT_KEYW", "LONG_KEYW", "REGISTER_KEYW", "RESTRICT_KEYW", |
| 588 | "SHORT_KEYW", "SIGNED_KEYW", "STATIC_KEYW", "STRUCT_KEYW", |
| 589 | "TYPEDEF_KEYW", "UNION_KEYW", "UNSIGNED_KEYW", "VOID_KEYW", |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 590 | "VOLATILE_KEYW", "TYPEOF_KEYW", "VA_LIST_KEYW", "EXPORT_SYMBOL_KEYW", |
| 591 | "ASM_PHRASE", "ATTRIBUTE_PHRASE", "TYPEOF_PHRASE", "BRACE_PHRASE", |
| 592 | "BRACKET_PHRASE", "EXPRESSION_PHRASE", "CHAR", "DOTS", "IDENT", "INT", |
| 593 | "REAL", "STRING", "TYPE", "OTHER", "FILENAME", "';'", "'}'", "','", |
| 594 | "'('", "')'", "'*'", "'='", "'{'", "':'", "$accept", "declaration_seq", |
| 595 | "declaration", "$@1", "declaration1", "$@2", "$@3", "simple_declaration", |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 596 | "init_declarator_list_opt", "init_declarator_list", "init_declarator", |
| 597 | "decl_specifier_seq_opt", "decl_specifier_seq", "decl_specifier", |
| 598 | "storage_class_specifier", "type_specifier", "simple_type_specifier", |
| 599 | "ptr_operator", "cvar_qualifier_seq_opt", "cvar_qualifier_seq", |
| 600 | "cvar_qualifier", "declarator", "direct_declarator", "nested_declarator", |
| 601 | "direct_nested_declarator", "parameter_declaration_clause", |
| 602 | "parameter_declaration_list_opt", "parameter_declaration_list", |
| 603 | "parameter_declaration", "m_abstract_declarator", |
| 604 | "direct_m_abstract_declarator", "function_definition", "initializer_opt", |
| 605 | "initializer", "class_body", "member_specification_opt", |
| 606 | "member_specification", "member_declaration", |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 607 | "member_declarator_list_opt", "member_declarator_list", |
| 608 | "member_declarator", "member_bitfield_declarator", "attribute_opt", |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 609 | "enum_body", "enumerator_list", "enumerator", "asm_definition", |
Jan Beulich | dc53324 | 2014-04-03 14:46:37 -0700 | [diff] [blame] | 610 | "asm_phrase_opt", "export_definition", YY_NULL |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 611 | }; |
| 612 | #endif |
| 613 | |
| 614 | # ifdef YYPRINT |
| 615 | /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to |
| 616 | token YYLEX-NUM. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 617 | static const yytype_uint16 yytoknum[] = |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 618 | { |
| 619 | 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, |
| 620 | 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, |
| 621 | 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, |
| 622 | 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 623 | 295, 296, 297, 298, 299, 300, 59, 125, 44, 40, |
| 624 | 41, 42, 61, 123, 58 |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 625 | }; |
| 626 | # endif |
| 627 | |
| 628 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 629 | static const yytype_uint8 yyr1[] = |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 630 | { |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 631 | 0, 55, 56, 56, 58, 57, 60, 59, 61, 59, |
| 632 | 59, 59, 59, 59, 59, 59, 62, 63, 63, 64, |
| 633 | 64, 65, 66, 66, 67, 67, 68, 68, 69, 69, |
| 634 | 69, 69, 69, 70, 70, 70, 70, 70, 70, 70, |
| 635 | 70, 70, 70, 70, 70, 70, 71, 71, 71, 71, |
| 636 | 71, 71, 71, 71, 71, 71, 71, 71, 72, 73, |
| 637 | 73, 74, 74, 75, 75, 75, 75, 76, 76, 77, |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 638 | 77, 77, 77, 77, 77, 78, 78, 79, 79, 79, |
| 639 | 79, 79, 79, 79, 80, 80, 80, 81, 81, 82, |
| 640 | 82, 83, 84, 84, 85, 85, 85, 85, 85, 85, |
| 641 | 85, 85, 86, 87, 87, 88, 89, 89, 90, 90, |
| 642 | 91, 91, 92, 92, 93, 93, 94, 94, 95, 95, |
| 643 | 95, 96, 97, 97, 98, 98, 99, 99, 100, 100, |
| 644 | 101, 102, 102, 103 |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 645 | }; |
| 646 | |
| 647 | /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 648 | static const yytype_uint8 yyr2[] = |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 649 | { |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 650 | 0, 2, 1, 2, 0, 2, 0, 4, 0, 3, |
| 651 | 1, 1, 1, 1, 2, 2, 3, 0, 1, 1, |
| 652 | 3, 4, 0, 1, 1, 2, 1, 1, 1, 1, |
Jan Beulich | dc53324 | 2014-04-03 14:46:37 -0700 | [diff] [blame] | 653 | 1, 1, 1, 1, 1, 4, 1, 2, 2, 2, |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 654 | 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 655 | 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, |
| 656 | 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 657 | 1, 4, 4, 2, 3, 2, 1, 1, 1, 4, |
| 658 | 4, 2, 3, 3, 2, 1, 3, 0, 1, 1, |
| 659 | 3, 2, 2, 1, 0, 1, 1, 4, 4, 2, |
| 660 | 3, 3, 3, 0, 1, 2, 3, 3, 0, 1, |
| 661 | 1, 2, 3, 2, 0, 1, 1, 3, 2, 2, |
| 662 | 1, 2, 0, 2, 3, 4, 1, 3, 1, 3, |
| 663 | 2, 0, 1, 5 |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 664 | }; |
| 665 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 666 | /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. |
| 667 | Performed when YYTABLE doesn't specify something else to do. Zero |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 668 | means the default is an error. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 669 | static const yytype_uint8 yydefact[] = |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 670 | { |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 671 | 4, 4, 2, 0, 1, 3, 0, 28, 55, 46, |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 672 | 63, 53, 0, 31, 0, 52, 32, 48, 49, 29, |
| 673 | 66, 47, 50, 30, 0, 8, 0, 51, 54, 64, |
| 674 | 0, 56, 0, 0, 65, 36, 57, 5, 10, 17, |
| 675 | 23, 24, 26, 27, 33, 34, 11, 12, 13, 14, |
| 676 | 15, 39, 0, 43, 6, 37, 0, 44, 22, 38, |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 677 | 45, 0, 0, 130, 69, 70, 0, 59, 0, 18, |
| 678 | 19, 0, 131, 68, 25, 42, 128, 0, 126, 22, |
| 679 | 40, 0, 114, 0, 0, 110, 9, 17, 41, 94, |
| 680 | 0, 0, 0, 58, 60, 61, 16, 0, 67, 132, |
| 681 | 102, 122, 73, 0, 0, 124, 0, 7, 113, 107, |
| 682 | 77, 78, 0, 0, 0, 122, 76, 0, 115, 116, |
| 683 | 120, 106, 0, 111, 131, 95, 57, 0, 94, 91, |
| 684 | 93, 35, 0, 74, 62, 20, 103, 0, 0, 85, |
| 685 | 88, 89, 129, 125, 127, 119, 0, 77, 0, 121, |
| 686 | 75, 118, 81, 0, 112, 0, 0, 96, 0, 92, |
| 687 | 99, 0, 133, 123, 0, 21, 104, 72, 71, 84, |
| 688 | 0, 83, 82, 0, 0, 117, 101, 100, 0, 0, |
| 689 | 105, 86, 90, 80, 79, 98, 97 |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 690 | }; |
| 691 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 692 | /* YYDEFGOTO[NTERM-NUM]. */ |
| 693 | static const yytype_int16 yydefgoto[] = |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 694 | { |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 695 | -1, 1, 2, 3, 37, 79, 58, 38, 68, 69, |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 696 | 70, 82, 40, 41, 42, 43, 44, 71, 93, 94, |
| 697 | 45, 124, 73, 115, 116, 138, 139, 140, 141, 129, |
| 698 | 130, 46, 165, 166, 57, 83, 84, 85, 117, 118, |
| 699 | 119, 120, 136, 53, 77, 78, 47, 101, 48 |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 700 | }; |
| 701 | |
| 702 | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
| 703 | STATE-NUM. */ |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 704 | #define YYPACT_NINF -94 |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 705 | static const yytype_int16 yypact[] = |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 706 | { |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 707 | -94, 15, -94, 208, -94, -94, 34, -94, -94, -94, |
| 708 | -94, -94, -27, -94, -5, -94, -94, -94, -94, -94, |
| 709 | -94, -94, -94, -94, -25, -94, -16, -94, -94, -94, |
| 710 | -4, -94, 19, -24, -94, -94, -94, -94, -94, 24, |
| 711 | 479, -94, -94, -94, -94, -94, -94, -94, -94, -94, |
| 712 | -94, 29, 48, -94, -94, 37, 106, -94, 479, 37, |
| 713 | -94, 479, 54, -94, -94, -94, 24, -2, 49, 53, |
| 714 | -94, 24, -14, -11, -94, -94, 47, 38, -94, 479, |
| 715 | -94, 51, 23, 55, 157, -94, -94, 24, -94, 393, |
| 716 | 56, 58, 68, -94, -2, -94, -94, 24, -94, -94, |
| 717 | -94, -94, -94, 255, 67, -94, 5, -94, -94, -94, |
| 718 | 50, -94, 7, 69, 40, -94, -8, 83, 88, -94, |
| 719 | -94, -94, 91, -94, 109, -94, -94, 4, 45, -94, |
| 720 | 16, -94, 95, -94, -94, -94, -23, 92, 93, 108, |
| 721 | 96, -94, -94, -94, -94, -94, 97, -94, 98, -94, |
| 722 | -94, 118, -94, 301, -94, 23, 101, -94, 104, -94, |
| 723 | -94, 347, -94, -94, 120, -94, -94, -94, -94, -94, |
| 724 | 440, -94, -94, 111, 119, -94, -94, -94, 130, 137, |
| 725 | -94, -94, -94, -94, -94, -94, -94 |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 726 | }; |
| 727 | |
| 728 | /* YYPGOTO[NTERM-NUM]. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 729 | static const yytype_int16 yypgoto[] = |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 730 | { |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 731 | -94, -94, 158, -94, -94, -94, -94, -45, -94, -94, |
| 732 | 94, -1, -61, -29, -94, -94, -94, -79, -94, -94, |
| 733 | -63, -7, -94, -93, -94, -92, -94, -94, -60, -57, |
| 734 | -94, -94, -94, -94, -19, -94, -94, 110, -94, -94, |
| 735 | 33, 82, 78, 144, -94, 99, -94, -94, -94 |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 736 | }; |
| 737 | |
| 738 | /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If |
| 739 | positive, shift that token. If negative, reduce the rule which |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 740 | number is the opposite. If YYTABLE_NINF, syntax error. */ |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 741 | #define YYTABLE_NINF -110 |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 742 | static const yytype_int16 yytable[] = |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 743 | { |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 744 | 89, 90, 39, 114, 95, 156, 10, 60, 146, 163, |
| 745 | 128, 74, 51, 86, 55, 4, 20, 99, 54, 148, |
| 746 | 100, 150, 63, 59, 102, 29, 52, 152, 56, 164, |
| 747 | 34, 134, 72, 114, 107, 114, 80, 56, 103, -94, |
| 748 | 88, 153, 89, 125, 76, 61, 147, 157, 128, 128, |
| 749 | 111, 160, 143, 127, -94, 67, 112, 87, 67, 92, |
| 750 | 74, 174, 110, 64, 98, 161, 111, 65, 62, 179, |
| 751 | 158, 159, 112, 66, 67, 67, 114, 113, 87, 147, |
| 752 | 49, 50, 52, 111, 125, 105, 106, 76, 157, 112, |
| 753 | 56, 67, 89, 91, 127, 96, 67, 108, 109, 104, |
| 754 | 89, 97, 121, 142, 113, 149, 131, 81, 132, 89, |
| 755 | 182, 7, 8, 9, 10, 11, 12, 13, 133, 15, |
| 756 | 16, 17, 18, 19, 20, 21, 22, 23, 24, 154, |
| 757 | 26, 27, 28, 29, 30, 31, 155, 108, 34, 35, |
| 758 | 99, 162, 167, 168, 170, -22, 169, 171, 172, 36, |
| 759 | 163, 176, -22, -108, 177, -22, 180, -22, 122, 5, |
| 760 | -22, 183, 7, 8, 9, 10, 11, 12, 13, 184, |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 761 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 762 | 185, 26, 27, 28, 29, 30, 31, 186, 175, 34, |
| 763 | 35, 135, 145, 151, 123, 75, -22, 0, 0, 0, |
| 764 | 36, 0, 0, -22, -109, 144, -22, 0, -22, 6, |
| 765 | 0, -22, 0, 7, 8, 9, 10, 11, 12, 13, |
| 766 | 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, |
| 767 | 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, |
| 768 | 34, 35, 0, 0, 0, 0, 0, -22, 0, 0, |
| 769 | 0, 36, 0, 0, -22, 0, 137, -22, 0, -22, |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 770 | 7, 8, 9, 10, 11, 12, 13, 0, 15, 16, |
| 771 | 17, 18, 19, 20, 21, 22, 23, 24, 0, 26, |
| 772 | 27, 28, 29, 30, 31, 0, 0, 34, 35, 0, |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 773 | 0, 0, 0, -87, 0, 0, 0, 0, 36, 0, |
| 774 | 0, 0, 173, 0, 0, -87, 7, 8, 9, 10, |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 775 | 11, 12, 13, 0, 15, 16, 17, 18, 19, 20, |
| 776 | 21, 22, 23, 24, 0, 26, 27, 28, 29, 30, |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 777 | 31, 0, 0, 34, 35, 0, 0, 0, 0, -87, |
| 778 | 0, 0, 0, 0, 36, 0, 0, 0, 178, 0, |
| 779 | 0, -87, 7, 8, 9, 10, 11, 12, 13, 0, |
| 780 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, |
| 781 | 0, 26, 27, 28, 29, 30, 31, 0, 0, 34, |
| 782 | 35, 0, 0, 0, 0, -87, 0, 0, 0, 0, |
| 783 | 36, 0, 0, 0, 0, 0, 0, -87, 7, 8, |
| 784 | 9, 10, 11, 12, 13, 0, 15, 16, 17, 18, |
| 785 | 19, 20, 21, 22, 23, 24, 0, 26, 27, 28, |
| 786 | 29, 30, 31, 0, 0, 34, 35, 0, 0, 0, |
| 787 | 0, 0, 125, 0, 0, 0, 126, 0, 0, 0, |
| 788 | 0, 0, 127, 0, 67, 7, 8, 9, 10, 11, |
| 789 | 12, 13, 0, 15, 16, 17, 18, 19, 20, 21, |
| 790 | 22, 23, 24, 0, 26, 27, 28, 29, 30, 31, |
| 791 | 0, 0, 34, 35, 0, 0, 0, 0, 181, 0, |
| 792 | 0, 0, 0, 36, 7, 8, 9, 10, 11, 12, |
| 793 | 13, 0, 15, 16, 17, 18, 19, 20, 21, 22, |
| 794 | 23, 24, 0, 26, 27, 28, 29, 30, 31, 0, |
| 795 | 0, 34, 35, 0, 0, 0, 0, 0, 0, 0, |
| 796 | 0, 0, 36 |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 797 | }; |
| 798 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 799 | #define yypact_value_is_default(Yystate) \ |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 800 | (!!((Yystate) == (-94))) |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 801 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 802 | #define yytable_value_is_error(Yytable_value) \ |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 803 | YYID (0) |
| 804 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 805 | static const yytype_int16 yycheck[] = |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 806 | { |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 807 | 61, 61, 3, 82, 67, 1, 8, 26, 1, 32, |
| 808 | 89, 40, 39, 58, 39, 0, 18, 31, 23, 112, |
| 809 | 34, 114, 46, 39, 35, 27, 53, 35, 53, 52, |
| 810 | 32, 94, 39, 112, 79, 114, 55, 53, 49, 35, |
| 811 | 59, 49, 103, 39, 39, 49, 39, 43, 127, 128, |
| 812 | 43, 35, 47, 49, 50, 51, 49, 58, 51, 66, |
| 813 | 89, 153, 39, 39, 71, 49, 43, 43, 49, 161, |
| 814 | 127, 128, 49, 49, 51, 51, 155, 54, 79, 39, |
| 815 | 46, 47, 53, 43, 39, 47, 48, 39, 43, 49, |
| 816 | 53, 51, 153, 39, 49, 46, 51, 46, 47, 52, |
| 817 | 161, 48, 47, 36, 54, 36, 50, 1, 50, 170, |
| 818 | 170, 5, 6, 7, 8, 9, 10, 11, 50, 13, |
| 819 | 14, 15, 16, 17, 18, 19, 20, 21, 22, 46, |
| 820 | 24, 25, 26, 27, 28, 29, 48, 46, 32, 33, |
| 821 | 31, 46, 50, 50, 48, 39, 38, 50, 50, 43, |
| 822 | 32, 50, 46, 47, 50, 49, 36, 51, 1, 1, |
| 823 | 54, 50, 5, 6, 7, 8, 9, 10, 11, 50, |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 824 | 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 825 | 50, 24, 25, 26, 27, 28, 29, 50, 155, 32, |
| 826 | 33, 97, 110, 115, 84, 51, 39, -1, -1, -1, |
| 827 | 43, -1, -1, 46, 47, 106, 49, -1, 51, 1, |
| 828 | -1, 54, -1, 5, 6, 7, 8, 9, 10, 11, |
| 829 | 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, |
| 830 | 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, |
| 831 | 32, 33, -1, -1, -1, -1, -1, 39, -1, -1, |
| 832 | -1, 43, -1, -1, 46, -1, 1, 49, -1, 51, |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 833 | 5, 6, 7, 8, 9, 10, 11, -1, 13, 14, |
| 834 | 15, 16, 17, 18, 19, 20, 21, 22, -1, 24, |
| 835 | 25, 26, 27, 28, 29, -1, -1, 32, 33, -1, |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 836 | -1, -1, -1, 38, -1, -1, -1, -1, 43, -1, |
| 837 | -1, -1, 1, -1, -1, 50, 5, 6, 7, 8, |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 838 | 9, 10, 11, -1, 13, 14, 15, 16, 17, 18, |
| 839 | 19, 20, 21, 22, -1, 24, 25, 26, 27, 28, |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 840 | 29, -1, -1, 32, 33, -1, -1, -1, -1, 38, |
| 841 | -1, -1, -1, -1, 43, -1, -1, -1, 1, -1, |
| 842 | -1, 50, 5, 6, 7, 8, 9, 10, 11, -1, |
| 843 | 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, |
| 844 | -1, 24, 25, 26, 27, 28, 29, -1, -1, 32, |
| 845 | 33, -1, -1, -1, -1, 38, -1, -1, -1, -1, |
| 846 | 43, -1, -1, -1, -1, -1, -1, 50, 5, 6, |
| 847 | 7, 8, 9, 10, 11, -1, 13, 14, 15, 16, |
| 848 | 17, 18, 19, 20, 21, 22, -1, 24, 25, 26, |
| 849 | 27, 28, 29, -1, -1, 32, 33, -1, -1, -1, |
| 850 | -1, -1, 39, -1, -1, -1, 43, -1, -1, -1, |
| 851 | -1, -1, 49, -1, 51, 5, 6, 7, 8, 9, |
| 852 | 10, 11, -1, 13, 14, 15, 16, 17, 18, 19, |
| 853 | 20, 21, 22, -1, 24, 25, 26, 27, 28, 29, |
| 854 | -1, -1, 32, 33, -1, -1, -1, -1, 38, -1, |
| 855 | -1, -1, -1, 43, 5, 6, 7, 8, 9, 10, |
| 856 | 11, -1, 13, 14, 15, 16, 17, 18, 19, 20, |
| 857 | 21, 22, -1, 24, 25, 26, 27, 28, 29, -1, |
| 858 | -1, 32, 33, -1, -1, -1, -1, -1, -1, -1, |
| 859 | -1, -1, 43 |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 860 | }; |
| 861 | |
| 862 | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
| 863 | symbol of state STATE-NUM. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 864 | static const yytype_uint8 yystos[] = |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 865 | { |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 866 | 0, 56, 57, 58, 0, 57, 1, 5, 6, 7, |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 867 | 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, |
| 868 | 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 869 | 28, 29, 30, 31, 32, 33, 43, 59, 62, 66, |
| 870 | 67, 68, 69, 70, 71, 75, 86, 101, 103, 46, |
| 871 | 47, 39, 53, 98, 23, 39, 53, 89, 61, 39, |
| 872 | 89, 49, 49, 46, 39, 43, 49, 51, 63, 64, |
| 873 | 65, 72, 76, 77, 68, 98, 39, 99, 100, 60, |
| 874 | 89, 1, 66, 90, 91, 92, 62, 66, 89, 67, |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 875 | 83, 39, 76, 73, 74, 75, 46, 48, 76, 31, |
| 876 | 34, 102, 35, 49, 52, 47, 48, 62, 46, 47, |
| 877 | 39, 43, 49, 54, 72, 78, 79, 93, 94, 95, |
| 878 | 96, 47, 1, 92, 76, 39, 43, 49, 72, 84, |
| 879 | 85, 50, 50, 50, 75, 65, 97, 1, 80, 81, |
| 880 | 82, 83, 36, 47, 100, 96, 1, 39, 78, 36, |
| 881 | 78, 97, 35, 49, 46, 48, 1, 43, 84, 84, |
| 882 | 35, 49, 46, 32, 52, 87, 88, 50, 50, 38, |
| 883 | 48, 50, 50, 1, 80, 95, 50, 50, 1, 80, |
| 884 | 36, 38, 83, 50, 50, 50, 50 |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 885 | }; |
| 886 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 887 | #define yyerrok (yyerrstatus = 0) |
| 888 | #define yyclearin (yychar = YYEMPTY) |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 889 | #define YYEMPTY (-2) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 890 | #define YYEOF 0 |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 891 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 892 | #define YYACCEPT goto yyacceptlab |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 893 | #define YYABORT goto yyabortlab |
| 894 | #define YYERROR goto yyerrorlab |
| 895 | |
| 896 | |
| 897 | /* Like YYERROR except do call yyerror. This remains here temporarily |
| 898 | to ease the transition to the new meaning of YYERROR, for GCC. |
Arnaud Lacombe | 58ef81c | 2011-05-23 01:52:59 -0400 | [diff] [blame] | 899 | Once GCC version 2 has supplanted version 1, this can go. However, |
| 900 | YYFAIL appears to be in use. Nevertheless, it is formally deprecated |
| 901 | in Bison 2.4.2's NEWS entry, where a plan to phase it out is |
| 902 | discussed. */ |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 903 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 904 | #define YYFAIL goto yyerrlab |
Arnaud Lacombe | 58ef81c | 2011-05-23 01:52:59 -0400 | [diff] [blame] | 905 | #if defined YYFAIL |
| 906 | /* This is here to suppress warnings from the GCC cpp's |
| 907 | -Wunused-macros. Normally we don't worry about that warning, but |
| 908 | some users do, and we want to make it easy for users to remove |
| 909 | YYFAIL uses, which will produce warnings from Bison 2.5. */ |
| 910 | #endif |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 911 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 912 | #define YYRECOVERING() (!!yyerrstatus) |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 913 | |
Jan Beulich | dc53324 | 2014-04-03 14:46:37 -0700 | [diff] [blame] | 914 | #define YYBACKUP(Token, Value) \ |
| 915 | do \ |
| 916 | if (yychar == YYEMPTY) \ |
| 917 | { \ |
| 918 | yychar = (Token); \ |
| 919 | yylval = (Value); \ |
| 920 | YYPOPSTACK (yylen); \ |
| 921 | yystate = *yyssp; \ |
| 922 | goto yybackup; \ |
| 923 | } \ |
| 924 | else \ |
| 925 | { \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 926 | yyerror (YY_("syntax error: cannot back up")); \ |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 927 | YYERROR; \ |
| 928 | } \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 929 | while (YYID (0)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 930 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 931 | /* Error token number */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 932 | #define YYTERROR 1 |
| 933 | #define YYERRCODE 256 |
| 934 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 935 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 936 | /* This macro is provided for backward compatibility. */ |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 937 | #ifndef YY_LOCATION_PRINT |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 938 | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 939 | #endif |
| 940 | |
| 941 | |
| 942 | /* YYLEX -- calling `yylex' with the right arguments. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 943 | #ifdef YYLEX_PARAM |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 944 | # define YYLEX yylex (YYLEX_PARAM) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 945 | #else |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 946 | # define YYLEX yylex () |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 947 | #endif |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 948 | |
| 949 | /* Enable debugging if requested. */ |
| 950 | #if YYDEBUG |
| 951 | |
| 952 | # ifndef YYFPRINTF |
| 953 | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ |
| 954 | # define YYFPRINTF fprintf |
| 955 | # endif |
| 956 | |
| 957 | # define YYDPRINTF(Args) \ |
| 958 | do { \ |
| 959 | if (yydebug) \ |
| 960 | YYFPRINTF Args; \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 961 | } while (YYID (0)) |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 962 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 963 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ |
| 964 | do { \ |
| 965 | if (yydebug) \ |
| 966 | { \ |
| 967 | YYFPRINTF (stderr, "%s ", Title); \ |
| 968 | yy_symbol_print (stderr, \ |
| 969 | Type, Value); \ |
| 970 | YYFPRINTF (stderr, "\n"); \ |
| 971 | } \ |
| 972 | } while (YYID (0)) |
| 973 | |
| 974 | |
| 975 | /*--------------------------------. |
| 976 | | Print this symbol on YYOUTPUT. | |
| 977 | `--------------------------------*/ |
| 978 | |
| 979 | /*ARGSUSED*/ |
| 980 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 981 | || defined __cplusplus || defined _MSC_VER) |
| 982 | static void |
| 983 | yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) |
| 984 | #else |
| 985 | static void |
| 986 | yy_symbol_value_print (yyoutput, yytype, yyvaluep) |
| 987 | FILE *yyoutput; |
| 988 | int yytype; |
| 989 | YYSTYPE const * const yyvaluep; |
| 990 | #endif |
| 991 | { |
Jan Beulich | dc53324 | 2014-04-03 14:46:37 -0700 | [diff] [blame] | 992 | FILE *yyo = yyoutput; |
| 993 | YYUSE (yyo); |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 994 | if (!yyvaluep) |
| 995 | return; |
| 996 | # ifdef YYPRINT |
| 997 | if (yytype < YYNTOKENS) |
| 998 | YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); |
| 999 | # else |
| 1000 | YYUSE (yyoutput); |
| 1001 | # endif |
| 1002 | switch (yytype) |
| 1003 | { |
| 1004 | default: |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 1005 | break; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1006 | } |
| 1007 | } |
| 1008 | |
| 1009 | |
| 1010 | /*--------------------------------. |
| 1011 | | Print this symbol on YYOUTPUT. | |
| 1012 | `--------------------------------*/ |
| 1013 | |
| 1014 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 1015 | || defined __cplusplus || defined _MSC_VER) |
| 1016 | static void |
| 1017 | yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) |
| 1018 | #else |
| 1019 | static void |
| 1020 | yy_symbol_print (yyoutput, yytype, yyvaluep) |
| 1021 | FILE *yyoutput; |
| 1022 | int yytype; |
| 1023 | YYSTYPE const * const yyvaluep; |
| 1024 | #endif |
| 1025 | { |
| 1026 | if (yytype < YYNTOKENS) |
| 1027 | YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); |
| 1028 | else |
| 1029 | YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); |
| 1030 | |
| 1031 | yy_symbol_value_print (yyoutput, yytype, yyvaluep); |
| 1032 | YYFPRINTF (yyoutput, ")"); |
| 1033 | } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1034 | |
| 1035 | /*------------------------------------------------------------------. |
| 1036 | | yy_stack_print -- Print the state stack from its BOTTOM up to its | |
| 1037 | | TOP (included). | |
| 1038 | `------------------------------------------------------------------*/ |
| 1039 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1040 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 1041 | || defined __cplusplus || defined _MSC_VER) |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1042 | static void |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1043 | yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1044 | #else |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1045 | static void |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1046 | yy_stack_print (yybottom, yytop) |
| 1047 | yytype_int16 *yybottom; |
| 1048 | yytype_int16 *yytop; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1049 | #endif |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1050 | { |
| 1051 | YYFPRINTF (stderr, "Stack now"); |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1052 | for (; yybottom <= yytop; yybottom++) |
| 1053 | { |
| 1054 | int yybot = *yybottom; |
| 1055 | YYFPRINTF (stderr, " %d", yybot); |
| 1056 | } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1057 | YYFPRINTF (stderr, "\n"); |
| 1058 | } |
| 1059 | |
| 1060 | # define YY_STACK_PRINT(Bottom, Top) \ |
| 1061 | do { \ |
| 1062 | if (yydebug) \ |
| 1063 | yy_stack_print ((Bottom), (Top)); \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1064 | } while (YYID (0)) |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1065 | |
| 1066 | |
| 1067 | /*------------------------------------------------. |
| 1068 | | Report that the YYRULE is going to be reduced. | |
| 1069 | `------------------------------------------------*/ |
| 1070 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1071 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 1072 | || defined __cplusplus || defined _MSC_VER) |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1073 | static void |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1074 | yy_reduce_print (YYSTYPE *yyvsp, int yyrule) |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1075 | #else |
| 1076 | static void |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1077 | yy_reduce_print (yyvsp, yyrule) |
| 1078 | YYSTYPE *yyvsp; |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1079 | int yyrule; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1080 | #endif |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1081 | { |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1082 | int yynrhs = yyr2[yyrule]; |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1083 | int yyi; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1084 | unsigned long int yylno = yyrline[yyrule]; |
| 1085 | YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", |
| 1086 | yyrule - 1, yylno); |
| 1087 | /* The symbols being reduced. */ |
| 1088 | for (yyi = 0; yyi < yynrhs; yyi++) |
| 1089 | { |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1090 | YYFPRINTF (stderr, " $%d = ", yyi + 1); |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1091 | yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], |
| 1092 | &(yyvsp[(yyi + 1) - (yynrhs)]) |
| 1093 | ); |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1094 | YYFPRINTF (stderr, "\n"); |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1095 | } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1096 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1097 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1098 | # define YY_REDUCE_PRINT(Rule) \ |
| 1099 | do { \ |
| 1100 | if (yydebug) \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1101 | yy_reduce_print (yyvsp, Rule); \ |
| 1102 | } while (YYID (0)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1103 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1104 | /* Nonzero means print parse trace. It is left uninitialized so that |
| 1105 | multiple parsers can coexist. */ |
| 1106 | int yydebug; |
| 1107 | #else /* !YYDEBUG */ |
| 1108 | # define YYDPRINTF(Args) |
| 1109 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) |
| 1110 | # define YY_STACK_PRINT(Bottom, Top) |
| 1111 | # define YY_REDUCE_PRINT(Rule) |
| 1112 | #endif /* !YYDEBUG */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1113 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1114 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1115 | /* YYINITDEPTH -- initial size of the parser's stacks. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1116 | #ifndef YYINITDEPTH |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1117 | # define YYINITDEPTH 200 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1118 | #endif |
| 1119 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1120 | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only |
| 1121 | if the built-in stack extension method is used). |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1122 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1123 | Do not make this value too large; the results are undefined if |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1124 | YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1125 | evaluated with infinite-precision integer arithmetic. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1126 | |
| 1127 | #ifndef YYMAXDEPTH |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1128 | # define YYMAXDEPTH 10000 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1129 | #endif |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1130 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1131 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1132 | #if YYERROR_VERBOSE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1133 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1134 | # ifndef yystrlen |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1135 | # if defined __GLIBC__ && defined _STRING_H |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1136 | # define yystrlen strlen |
| 1137 | # else |
| 1138 | /* Return the length of YYSTR. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1139 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 1140 | || defined __cplusplus || defined _MSC_VER) |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1141 | static YYSIZE_T |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1142 | yystrlen (const char *yystr) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1143 | #else |
| 1144 | static YYSIZE_T |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1145 | yystrlen (yystr) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1146 | const char *yystr; |
| 1147 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1148 | { |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1149 | YYSIZE_T yylen; |
| 1150 | for (yylen = 0; yystr[yylen]; yylen++) |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1151 | continue; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1152 | return yylen; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1153 | } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1154 | # endif |
| 1155 | # endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1156 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1157 | # ifndef yystpcpy |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1158 | # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1159 | # define yystpcpy stpcpy |
| 1160 | # else |
| 1161 | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in |
| 1162 | YYDEST. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1163 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 1164 | || defined __cplusplus || defined _MSC_VER) |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1165 | static char * |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1166 | yystpcpy (char *yydest, const char *yysrc) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1167 | #else |
| 1168 | static char * |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1169 | yystpcpy (yydest, yysrc) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1170 | char *yydest; |
| 1171 | const char *yysrc; |
| 1172 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1173 | { |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1174 | char *yyd = yydest; |
| 1175 | const char *yys = yysrc; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1176 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1177 | while ((*yyd++ = *yys++) != '\0') |
| 1178 | continue; |
| 1179 | |
| 1180 | return yyd - 1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1181 | } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1182 | # endif |
| 1183 | # endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1184 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1185 | # ifndef yytnamerr |
| 1186 | /* Copy to YYRES the contents of YYSTR after stripping away unnecessary |
| 1187 | quotes and backslashes, so that it's suitable for yyerror. The |
| 1188 | heuristic is that double-quoting is unnecessary unless the string |
| 1189 | contains an apostrophe, a comma, or backslash (other than |
| 1190 | backslash-backslash). YYSTR is taken from yytname. If YYRES is |
| 1191 | null, do not copy; instead, return the length of what the result |
| 1192 | would have been. */ |
| 1193 | static YYSIZE_T |
| 1194 | yytnamerr (char *yyres, const char *yystr) |
| 1195 | { |
| 1196 | if (*yystr == '"') |
| 1197 | { |
| 1198 | YYSIZE_T yyn = 0; |
| 1199 | char const *yyp = yystr; |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1200 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1201 | for (;;) |
| 1202 | switch (*++yyp) |
| 1203 | { |
| 1204 | case '\'': |
| 1205 | case ',': |
| 1206 | goto do_not_strip_quotes; |
| 1207 | |
| 1208 | case '\\': |
| 1209 | if (*++yyp != '\\') |
| 1210 | goto do_not_strip_quotes; |
| 1211 | /* Fall through. */ |
| 1212 | default: |
| 1213 | if (yyres) |
| 1214 | yyres[yyn] = *yyp; |
| 1215 | yyn++; |
| 1216 | break; |
| 1217 | |
| 1218 | case '"': |
| 1219 | if (yyres) |
| 1220 | yyres[yyn] = '\0'; |
| 1221 | return yyn; |
| 1222 | } |
| 1223 | do_not_strip_quotes: ; |
| 1224 | } |
| 1225 | |
| 1226 | if (! yyres) |
| 1227 | return yystrlen (yystr); |
| 1228 | |
| 1229 | return yystpcpy (yyres, yystr) - yyres; |
| 1230 | } |
| 1231 | # endif |
| 1232 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1233 | /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message |
| 1234 | about the unexpected token YYTOKEN for the state stack whose top is |
| 1235 | YYSSP. |
| 1236 | |
| 1237 | Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is |
| 1238 | not large enough to hold the message. In that case, also set |
| 1239 | *YYMSG_ALLOC to the required number of bytes. Return 2 if the |
| 1240 | required number of bytes is too large to store. */ |
| 1241 | static int |
| 1242 | yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, |
| 1243 | yytype_int16 *yyssp, int yytoken) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1244 | { |
Jan Beulich | dc53324 | 2014-04-03 14:46:37 -0700 | [diff] [blame] | 1245 | YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1246 | YYSIZE_T yysize = yysize0; |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1247 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; |
| 1248 | /* Internationalized format string. */ |
Jan Beulich | dc53324 | 2014-04-03 14:46:37 -0700 | [diff] [blame] | 1249 | const char *yyformat = YY_NULL; |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1250 | /* Arguments of yyformat. */ |
| 1251 | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; |
| 1252 | /* Number of reported tokens (one for the "unexpected", one per |
| 1253 | "expected"). */ |
| 1254 | int yycount = 0; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1255 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1256 | /* There are many possibilities here to consider: |
| 1257 | - Assume YYFAIL is not used. It's too flawed to consider. See |
| 1258 | <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> |
| 1259 | for details. YYERROR is fine as it does not invoke this |
| 1260 | function. |
| 1261 | - If this state is a consistent state with a default action, then |
| 1262 | the only way this function was invoked is if the default action |
| 1263 | is an error action. In that case, don't check for expected |
| 1264 | tokens because there are none. |
| 1265 | - The only way there can be no lookahead present (in yychar) is if |
| 1266 | this state is a consistent state with a default action. Thus, |
| 1267 | detecting the absence of a lookahead is sufficient to determine |
| 1268 | that there is no unexpected or expected token to report. In that |
| 1269 | case, just report a simple "syntax error". |
| 1270 | - Don't assume there isn't a lookahead just because this state is a |
| 1271 | consistent state with a default action. There might have been a |
| 1272 | previous inconsistent state, consistent state with a non-default |
| 1273 | action, or user semantic action that manipulated yychar. |
| 1274 | - Of course, the expected token list depends on states to have |
| 1275 | correct lookahead information, and it depends on the parser not |
| 1276 | to perform extra reductions after fetching a lookahead from the |
| 1277 | scanner and before detecting a syntax error. Thus, state merging |
| 1278 | (from LALR or IELR) and default reductions corrupt the expected |
| 1279 | token list. However, the list is correct for canonical LR with |
| 1280 | one exception: it will still contain any token that will not be |
| 1281 | accepted due to an error action in a later state. |
| 1282 | */ |
| 1283 | if (yytoken != YYEMPTY) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1284 | { |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1285 | int yyn = yypact[*yyssp]; |
| 1286 | yyarg[yycount++] = yytname[yytoken]; |
| 1287 | if (!yypact_value_is_default (yyn)) |
| 1288 | { |
| 1289 | /* Start YYX at -YYN if negative to avoid negative indexes in |
| 1290 | YYCHECK. In other words, skip the first -YYN actions for |
| 1291 | this state because they are default actions. */ |
| 1292 | int yyxbegin = yyn < 0 ? -yyn : 0; |
| 1293 | /* Stay within bounds of both yycheck and yytname. */ |
| 1294 | int yychecklim = YYLAST - yyn + 1; |
| 1295 | int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; |
| 1296 | int yyx; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1297 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1298 | for (yyx = yyxbegin; yyx < yyxend; ++yyx) |
| 1299 | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR |
| 1300 | && !yytable_value_is_error (yytable[yyx + yyn])) |
| 1301 | { |
| 1302 | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) |
| 1303 | { |
| 1304 | yycount = 1; |
| 1305 | yysize = yysize0; |
| 1306 | break; |
| 1307 | } |
| 1308 | yyarg[yycount++] = yytname[yyx]; |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 1309 | { |
| 1310 | YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); |
| 1311 | if (! (yysize <= yysize1 |
| 1312 | && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) |
| 1313 | return 2; |
| 1314 | yysize = yysize1; |
| 1315 | } |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1316 | } |
| 1317 | } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1318 | } |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1319 | |
| 1320 | switch (yycount) |
| 1321 | { |
| 1322 | # define YYCASE_(N, S) \ |
| 1323 | case N: \ |
| 1324 | yyformat = S; \ |
| 1325 | break |
| 1326 | YYCASE_(0, YY_("syntax error")); |
| 1327 | YYCASE_(1, YY_("syntax error, unexpected %s")); |
| 1328 | YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); |
| 1329 | YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); |
| 1330 | YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); |
| 1331 | YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); |
| 1332 | # undef YYCASE_ |
| 1333 | } |
| 1334 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 1335 | { |
| 1336 | YYSIZE_T yysize1 = yysize + yystrlen (yyformat); |
| 1337 | if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) |
| 1338 | return 2; |
| 1339 | yysize = yysize1; |
| 1340 | } |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1341 | |
| 1342 | if (*yymsg_alloc < yysize) |
| 1343 | { |
| 1344 | *yymsg_alloc = 2 * yysize; |
| 1345 | if (! (yysize <= *yymsg_alloc |
| 1346 | && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) |
| 1347 | *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; |
| 1348 | return 1; |
| 1349 | } |
| 1350 | |
| 1351 | /* Avoid sprintf, as that infringes on the user's name space. |
| 1352 | Don't have undefined behavior even if the translation |
| 1353 | produced a string with the wrong number of "%s"s. */ |
| 1354 | { |
| 1355 | char *yyp = *yymsg; |
| 1356 | int yyi = 0; |
| 1357 | while ((*yyp = *yyformat) != '\0') |
| 1358 | if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) |
| 1359 | { |
| 1360 | yyp += yytnamerr (yyp, yyarg[yyi++]); |
| 1361 | yyformat += 2; |
| 1362 | } |
| 1363 | else |
| 1364 | { |
| 1365 | yyp++; |
| 1366 | yyformat++; |
| 1367 | } |
| 1368 | } |
| 1369 | return 0; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1370 | } |
| 1371 | #endif /* YYERROR_VERBOSE */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1372 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1373 | /*-----------------------------------------------. |
| 1374 | | Release the memory associated to this symbol. | |
| 1375 | `-----------------------------------------------*/ |
| 1376 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1377 | /*ARGSUSED*/ |
| 1378 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 1379 | || defined __cplusplus || defined _MSC_VER) |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1380 | static void |
| 1381 | yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) |
| 1382 | #else |
| 1383 | static void |
| 1384 | yydestruct (yymsg, yytype, yyvaluep) |
| 1385 | const char *yymsg; |
| 1386 | int yytype; |
| 1387 | YYSTYPE *yyvaluep; |
| 1388 | #endif |
| 1389 | { |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1390 | YYUSE (yyvaluep); |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1391 | |
| 1392 | if (!yymsg) |
| 1393 | yymsg = "Deleting"; |
| 1394 | YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); |
| 1395 | |
| 1396 | switch (yytype) |
| 1397 | { |
| 1398 | |
| 1399 | default: |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 1400 | break; |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1401 | } |
| 1402 | } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1403 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1404 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1405 | |
| 1406 | |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1407 | /* The lookahead symbol. */ |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1408 | int yychar; |
| 1409 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 1410 | |
| 1411 | #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
| 1412 | # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
| 1413 | # define YY_IGNORE_MAYBE_UNINITIALIZED_END |
| 1414 | #endif |
| 1415 | #ifndef YY_INITIAL_VALUE |
| 1416 | # define YY_INITIAL_VALUE(Value) /* Nothing. */ |
| 1417 | #endif |
| 1418 | |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1419 | /* The semantic value of the lookahead symbol. */ |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 1420 | YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1421 | |
| 1422 | /* Number of syntax errors so far. */ |
| 1423 | int yynerrs; |
| 1424 | |
| 1425 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1426 | /*----------. |
| 1427 | | yyparse. | |
| 1428 | `----------*/ |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1429 | |
| 1430 | #ifdef YYPARSE_PARAM |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1431 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 1432 | || defined __cplusplus || defined _MSC_VER) |
| 1433 | int |
| 1434 | yyparse (void *YYPARSE_PARAM) |
| 1435 | #else |
| 1436 | int |
| 1437 | yyparse (YYPARSE_PARAM) |
| 1438 | void *YYPARSE_PARAM; |
| 1439 | #endif |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1440 | #else /* ! YYPARSE_PARAM */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1441 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 1442 | || defined __cplusplus || defined _MSC_VER) |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1443 | int |
| 1444 | yyparse (void) |
| 1445 | #else |
| 1446 | int |
| 1447 | yyparse () |
| 1448 | |
| 1449 | #endif |
| 1450 | #endif |
| 1451 | { |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1452 | int yystate; |
| 1453 | /* Number of tokens to shift before error messages enabled. */ |
| 1454 | int yyerrstatus; |
| 1455 | |
| 1456 | /* The stacks and their tools: |
| 1457 | `yyss': related to states. |
| 1458 | `yyvs': related to semantic values. |
| 1459 | |
Jan Beulich | dc53324 | 2014-04-03 14:46:37 -0700 | [diff] [blame] | 1460 | Refer to the stacks through separate pointers, to allow yyoverflow |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1461 | to reallocate them elsewhere. */ |
| 1462 | |
| 1463 | /* The state stack. */ |
| 1464 | yytype_int16 yyssa[YYINITDEPTH]; |
| 1465 | yytype_int16 *yyss; |
| 1466 | yytype_int16 *yyssp; |
| 1467 | |
| 1468 | /* The semantic value stack. */ |
| 1469 | YYSTYPE yyvsa[YYINITDEPTH]; |
| 1470 | YYSTYPE *yyvs; |
| 1471 | YYSTYPE *yyvsp; |
| 1472 | |
| 1473 | YYSIZE_T yystacksize; |
| 1474 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1475 | int yyn; |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1476 | int yyresult; |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1477 | /* Lookahead token as an internal (translated) token number. */ |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 1478 | int yytoken = 0; |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1479 | /* The variables used to return semantic value and location from the |
| 1480 | action routines. */ |
| 1481 | YYSTYPE yyval; |
| 1482 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1483 | #if YYERROR_VERBOSE |
| 1484 | /* Buffer for error messages, and its allocated size. */ |
| 1485 | char yymsgbuf[128]; |
| 1486 | char *yymsg = yymsgbuf; |
| 1487 | YYSIZE_T yymsg_alloc = sizeof yymsgbuf; |
| 1488 | #endif |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1489 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1490 | #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1491 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1492 | /* The number of symbols on the RHS of the reduced rule. |
| 1493 | Keep to zero when no symbol should be popped. */ |
| 1494 | int yylen = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1495 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 1496 | yyssp = yyss = yyssa; |
| 1497 | yyvsp = yyvs = yyvsa; |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1498 | yystacksize = YYINITDEPTH; |
| 1499 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1500 | YYDPRINTF ((stderr, "Starting parse\n")); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1501 | |
| 1502 | yystate = 0; |
| 1503 | yyerrstatus = 0; |
| 1504 | yynerrs = 0; |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1505 | yychar = YYEMPTY; /* Cause a token to be read. */ |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1506 | goto yysetstate; |
| 1507 | |
| 1508 | /*------------------------------------------------------------. |
| 1509 | | yynewstate -- Push a new state, which is found in yystate. | |
| 1510 | `------------------------------------------------------------*/ |
| 1511 | yynewstate: |
| 1512 | /* In all cases, when you get here, the value and location stacks |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1513 | have just been pushed. So pushing a state here evens the stacks. */ |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1514 | yyssp++; |
| 1515 | |
| 1516 | yysetstate: |
| 1517 | *yyssp = yystate; |
| 1518 | |
| 1519 | if (yyss + yystacksize - 1 <= yyssp) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1520 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1521 | /* Get the current used size of the three stacks, in elements. */ |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1522 | YYSIZE_T yysize = yyssp - yyss + 1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1523 | |
| 1524 | #ifdef yyoverflow |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1525 | { |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1526 | /* Give user a chance to reallocate the stack. Use copies of |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1527 | these so that the &'s don't force the real ones into |
| 1528 | memory. */ |
| 1529 | YYSTYPE *yyvs1 = yyvs; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1530 | yytype_int16 *yyss1 = yyss; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1531 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1532 | /* Each stack pointer address is followed by the size of the |
| 1533 | data in use in that stack, in bytes. This used to be a |
| 1534 | conditional around just the two extra args, but that might |
| 1535 | be undefined if yyoverflow is a macro. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1536 | yyoverflow (YY_("memory exhausted"), |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1537 | &yyss1, yysize * sizeof (*yyssp), |
| 1538 | &yyvs1, yysize * sizeof (*yyvsp), |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1539 | &yystacksize); |
| 1540 | |
| 1541 | yyss = yyss1; |
| 1542 | yyvs = yyvs1; |
| 1543 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1544 | #else /* no yyoverflow */ |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1545 | # ifndef YYSTACK_RELOCATE |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1546 | goto yyexhaustedlab; |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1547 | # else |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1548 | /* Extend the stack our own way. */ |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1549 | if (YYMAXDEPTH <= yystacksize) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1550 | goto yyexhaustedlab; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1551 | yystacksize *= 2; |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1552 | if (YYMAXDEPTH < yystacksize) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1553 | yystacksize = YYMAXDEPTH; |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1554 | |
| 1555 | { |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1556 | yytype_int16 *yyss1 = yyss; |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1557 | union yyalloc *yyptr = |
| 1558 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); |
| 1559 | if (! yyptr) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1560 | goto yyexhaustedlab; |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1561 | YYSTACK_RELOCATE (yyss_alloc, yyss); |
| 1562 | YYSTACK_RELOCATE (yyvs_alloc, yyvs); |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1563 | # undef YYSTACK_RELOCATE |
| 1564 | if (yyss1 != yyssa) |
| 1565 | YYSTACK_FREE (yyss1); |
| 1566 | } |
| 1567 | # endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1568 | #endif /* no yyoverflow */ |
| 1569 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1570 | yyssp = yyss + yysize - 1; |
| 1571 | yyvsp = yyvs + yysize - 1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1572 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1573 | YYDPRINTF ((stderr, "Stack size increased to %lu\n", |
| 1574 | (unsigned long int) yystacksize)); |
| 1575 | |
| 1576 | if (yyss + yystacksize - 1 <= yyssp) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1577 | YYABORT; |
| 1578 | } |
| 1579 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1580 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1581 | |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1582 | if (yystate == YYFINAL) |
| 1583 | YYACCEPT; |
| 1584 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1585 | goto yybackup; |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1586 | |
| 1587 | /*-----------. |
| 1588 | | yybackup. | |
| 1589 | `-----------*/ |
| 1590 | yybackup: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1591 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1592 | /* Do appropriate processing given the current state. Read a |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1593 | lookahead token if we need one and don't already have one. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1594 | |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1595 | /* First try to decide what to do without reference to lookahead token. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1596 | yyn = yypact[yystate]; |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1597 | if (yypact_value_is_default (yyn)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1598 | goto yydefault; |
| 1599 | |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1600 | /* Not known => get a lookahead token if don't already have one. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1601 | |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1602 | /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1603 | if (yychar == YYEMPTY) |
| 1604 | { |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1605 | YYDPRINTF ((stderr, "Reading a token: ")); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1606 | yychar = YYLEX; |
| 1607 | } |
| 1608 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1609 | if (yychar <= YYEOF) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1610 | { |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1611 | yychar = yytoken = YYEOF; |
| 1612 | YYDPRINTF ((stderr, "Now at end of input.\n")); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1613 | } |
| 1614 | else |
| 1615 | { |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1616 | yytoken = YYTRANSLATE (yychar); |
| 1617 | YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1618 | } |
| 1619 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1620 | /* If the proper action on seeing token YYTOKEN is to reduce or to |
| 1621 | detect an error, take that action. */ |
| 1622 | yyn += yytoken; |
| 1623 | if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1624 | goto yydefault; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1625 | yyn = yytable[yyn]; |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1626 | if (yyn <= 0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1627 | { |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1628 | if (yytable_value_is_error (yyn)) |
| 1629 | goto yyerrlab; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1630 | yyn = -yyn; |
| 1631 | goto yyreduce; |
| 1632 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1633 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1634 | /* Count tokens shifted since error; after three, turn off error |
| 1635 | status. */ |
| 1636 | if (yyerrstatus) |
| 1637 | yyerrstatus--; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1638 | |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1639 | /* Shift the lookahead token. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1640 | YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
| 1641 | |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1642 | /* Discard the shifted token. */ |
| 1643 | yychar = YYEMPTY; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1644 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1645 | yystate = yyn; |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 1646 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1647 | *++yyvsp = yylval; |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 1648 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1649 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1650 | goto yynewstate; |
| 1651 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1652 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1653 | /*-----------------------------------------------------------. |
| 1654 | | yydefault -- do the default action for the current state. | |
| 1655 | `-----------------------------------------------------------*/ |
| 1656 | yydefault: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1657 | yyn = yydefact[yystate]; |
| 1658 | if (yyn == 0) |
| 1659 | goto yyerrlab; |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1660 | goto yyreduce; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1661 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1662 | |
| 1663 | /*-----------------------------. |
| 1664 | | yyreduce -- Do a reduction. | |
| 1665 | `-----------------------------*/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1666 | yyreduce: |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1667 | /* yyn is the number of a rule to reduce with. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1668 | yylen = yyr2[yyn]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1669 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1670 | /* If YYLEN is nonzero, implement the default value of the action: |
| 1671 | `$$ = $1'. |
| 1672 | |
| 1673 | Otherwise, the following line sets YYVAL to garbage. |
| 1674 | This behavior is undocumented and Bison |
| 1675 | users should not rely upon it. Assigning to YYVAL |
| 1676 | unconditionally makes the parser a bit smaller, and it avoids a |
| 1677 | GCC warning that YYVAL may be used uninitialized. */ |
| 1678 | yyval = yyvsp[1-yylen]; |
| 1679 | |
| 1680 | |
| 1681 | YY_REDUCE_PRINT (yyn); |
| 1682 | switch (yyn) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1683 | { |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1684 | case 4: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1685 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1686 | { is_typedef = 0; is_extern = 0; current_name = NULL; decl_spec = NULL; } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1687 | break; |
| 1688 | |
| 1689 | case 5: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1690 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1691 | { free_list(*(yyvsp[(2) - (2)]), NULL); *(yyvsp[(2) - (2)]) = NULL; } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1692 | break; |
| 1693 | |
| 1694 | case 6: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1695 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1696 | { is_typedef = 1; } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1697 | break; |
| 1698 | |
| 1699 | case 7: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1700 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1701 | { (yyval) = (yyvsp[(4) - (4)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1702 | break; |
| 1703 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1704 | case 8: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1705 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1706 | { is_typedef = 1; } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1707 | break; |
| 1708 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1709 | case 9: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1710 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1711 | { (yyval) = (yyvsp[(3) - (3)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1712 | break; |
| 1713 | |
| 1714 | case 14: |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1715 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1716 | { (yyval) = (yyvsp[(2) - (2)]); } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1717 | break; |
| 1718 | |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1719 | case 15: |
| 1720 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1721 | { (yyval) = (yyvsp[(2) - (2)]); } |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1722 | break; |
| 1723 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1724 | case 16: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1725 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1726 | { if (current_name) { |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1727 | struct string_list *decl = (*(yyvsp[(3) - (3)]))->next; |
| 1728 | (*(yyvsp[(3) - (3)]))->next = NULL; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1729 | add_symbol(current_name, |
| 1730 | is_typedef ? SYM_TYPEDEF : SYM_NORMAL, |
| 1731 | decl, is_extern); |
| 1732 | current_name = NULL; |
| 1733 | } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1734 | (yyval) = (yyvsp[(3) - (3)]); |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1735 | } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1736 | break; |
| 1737 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1738 | case 17: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1739 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1740 | { (yyval) = NULL; } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1741 | break; |
| 1742 | |
| 1743 | case 19: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1744 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1745 | { struct string_list *decl = *(yyvsp[(1) - (1)]); |
| 1746 | *(yyvsp[(1) - (1)]) = NULL; |
| 1747 | add_symbol(current_name, |
| 1748 | is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern); |
| 1749 | current_name = NULL; |
| 1750 | (yyval) = (yyvsp[(1) - (1)]); |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1751 | } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1752 | break; |
| 1753 | |
| 1754 | case 20: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1755 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1756 | { struct string_list *decl = *(yyvsp[(3) - (3)]); |
| 1757 | *(yyvsp[(3) - (3)]) = NULL; |
| 1758 | free_list(*(yyvsp[(2) - (3)]), NULL); |
| 1759 | *(yyvsp[(2) - (3)]) = decl_spec; |
| 1760 | add_symbol(current_name, |
| 1761 | is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern); |
| 1762 | current_name = NULL; |
| 1763 | (yyval) = (yyvsp[(3) - (3)]); |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1764 | } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1765 | break; |
| 1766 | |
| 1767 | case 21: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1768 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1769 | { (yyval) = (yyvsp[(4) - (4)]) ? (yyvsp[(4) - (4)]) : (yyvsp[(3) - (4)]) ? (yyvsp[(3) - (4)]) : (yyvsp[(2) - (4)]) ? (yyvsp[(2) - (4)]) : (yyvsp[(1) - (4)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1770 | break; |
| 1771 | |
| 1772 | case 22: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1773 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1774 | { decl_spec = NULL; } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1775 | break; |
| 1776 | |
| 1777 | case 24: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1778 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1779 | { decl_spec = *(yyvsp[(1) - (1)]); } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1780 | break; |
| 1781 | |
| 1782 | case 25: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1783 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1784 | { decl_spec = *(yyvsp[(2) - (2)]); } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1785 | break; |
| 1786 | |
| 1787 | case 26: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1788 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1789 | { /* Version 2 checksumming ignores storage class, as that |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1790 | is really irrelevant to the linkage. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1791 | remove_node((yyvsp[(1) - (1)])); |
| 1792 | (yyval) = (yyvsp[(1) - (1)]); |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1793 | } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1794 | break; |
| 1795 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1796 | case 31: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1797 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1798 | { is_extern = 1; (yyval) = (yyvsp[(1) - (1)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1799 | break; |
| 1800 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1801 | case 32: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1802 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1803 | { is_extern = 0; (yyval) = (yyvsp[(1) - (1)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1804 | break; |
| 1805 | |
| 1806 | case 37: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1807 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1808 | { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_STRUCT; (yyval) = (yyvsp[(2) - (2)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1809 | break; |
| 1810 | |
| 1811 | case 38: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1812 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1813 | { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_UNION; (yyval) = (yyvsp[(2) - (2)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1814 | break; |
| 1815 | |
| 1816 | case 39: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1817 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1818 | { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_ENUM; (yyval) = (yyvsp[(2) - (2)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1819 | break; |
| 1820 | |
| 1821 | case 40: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1822 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1823 | { record_compound((yyvsp[(1) - (3)]), (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)]), SYM_STRUCT); (yyval) = (yyvsp[(3) - (3)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1824 | break; |
| 1825 | |
| 1826 | case 41: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1827 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1828 | { record_compound((yyvsp[(1) - (3)]), (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)]), SYM_UNION); (yyval) = (yyvsp[(3) - (3)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1829 | break; |
| 1830 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1831 | case 42: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1832 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1833 | { record_compound((yyvsp[(1) - (3)]), (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)]), SYM_ENUM); (yyval) = (yyvsp[(3) - (3)]); } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1834 | break; |
| 1835 | |
| 1836 | case 43: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1837 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1838 | { add_symbol(NULL, SYM_ENUM, NULL, 0); (yyval) = (yyvsp[(2) - (2)]); } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1839 | break; |
| 1840 | |
| 1841 | case 44: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1842 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1843 | { (yyval) = (yyvsp[(2) - (2)]); } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1844 | break; |
| 1845 | |
| 1846 | case 45: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1847 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1848 | { (yyval) = (yyvsp[(2) - (2)]); } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1849 | break; |
| 1850 | |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 1851 | case 57: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1852 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1853 | { (*(yyvsp[(1) - (1)]))->tag = SYM_TYPEDEF; (yyval) = (yyvsp[(1) - (1)]); } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1854 | break; |
| 1855 | |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 1856 | case 58: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1857 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1858 | { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1859 | break; |
| 1860 | |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 1861 | case 59: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1862 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1863 | { (yyval) = NULL; } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1864 | break; |
| 1865 | |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 1866 | case 62: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1867 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1868 | { (yyval) = (yyvsp[(2) - (2)]); } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1869 | break; |
| 1870 | |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 1871 | case 66: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1872 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1873 | { /* restrict has no effect in prototypes so ignore it */ |
| 1874 | remove_node((yyvsp[(1) - (1)])); |
| 1875 | (yyval) = (yyvsp[(1) - (1)]); |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1876 | } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1877 | break; |
| 1878 | |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 1879 | case 67: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1880 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1881 | { (yyval) = (yyvsp[(2) - (2)]); } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1882 | break; |
| 1883 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1884 | case 69: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1885 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 1886 | { if (current_name != NULL) { |
| 1887 | error_with_pos("unexpected second declaration name"); |
| 1888 | YYERROR; |
| 1889 | } else { |
| 1890 | current_name = (*(yyvsp[(1) - (1)]))->string; |
| 1891 | (yyval) = (yyvsp[(1) - (1)]); |
| 1892 | } |
| 1893 | } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1894 | break; |
| 1895 | |
| 1896 | case 70: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1897 | |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 1898 | { if (current_name != NULL) { |
| 1899 | error_with_pos("unexpected second declaration name"); |
| 1900 | YYERROR; |
| 1901 | } else { |
| 1902 | current_name = (*(yyvsp[(1) - (1)]))->string; |
| 1903 | (yyval) = (yyvsp[(1) - (1)]); |
| 1904 | } |
| 1905 | } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1906 | break; |
| 1907 | |
| 1908 | case 71: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1909 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 1910 | { (yyval) = (yyvsp[(4) - (4)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1911 | break; |
| 1912 | |
| 1913 | case 72: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1914 | |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 1915 | { (yyval) = (yyvsp[(4) - (4)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1916 | break; |
| 1917 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1918 | case 73: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1919 | |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 1920 | { (yyval) = (yyvsp[(2) - (2)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1921 | break; |
| 1922 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1923 | case 74: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1924 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 1925 | { (yyval) = (yyvsp[(3) - (3)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1926 | break; |
| 1927 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 1928 | case 75: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1929 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 1930 | { (yyval) = (yyvsp[(2) - (2)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1931 | break; |
| 1932 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 1933 | case 79: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1934 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 1935 | { (yyval) = (yyvsp[(4) - (4)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1936 | break; |
| 1937 | |
| 1938 | case 80: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1939 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 1940 | { (yyval) = (yyvsp[(4) - (4)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1941 | break; |
| 1942 | |
| 1943 | case 81: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1944 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 1945 | { (yyval) = (yyvsp[(2) - (2)]); } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1946 | break; |
| 1947 | |
| 1948 | case 82: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1949 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 1950 | { (yyval) = (yyvsp[(3) - (3)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1951 | break; |
| 1952 | |
| 1953 | case 83: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1954 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 1955 | { (yyval) = (yyvsp[(3) - (3)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1956 | break; |
| 1957 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 1958 | case 84: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1959 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 1960 | { (yyval) = (yyvsp[(2) - (2)]); } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1961 | break; |
| 1962 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 1963 | case 86: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1964 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 1965 | { (yyval) = (yyvsp[(3) - (3)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1966 | break; |
| 1967 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 1968 | case 87: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1969 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 1970 | { (yyval) = NULL; } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1971 | break; |
| 1972 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 1973 | case 90: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1974 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 1975 | { (yyval) = (yyvsp[(3) - (3)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1976 | break; |
| 1977 | |
| 1978 | case 91: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1979 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 1980 | { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1981 | break; |
| 1982 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 1983 | case 92: |
| 1984 | |
| 1985 | { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); } |
| 1986 | break; |
| 1987 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 1988 | case 94: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1989 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1990 | { (yyval) = NULL; } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 1991 | break; |
| 1992 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 1993 | case 95: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1994 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1995 | { /* For version 2 checksums, we don't want to remember |
| 1996 | private parameter names. */ |
| 1997 | remove_node((yyvsp[(1) - (1)])); |
| 1998 | (yyval) = (yyvsp[(1) - (1)]); |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 1999 | } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2000 | break; |
| 2001 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 2002 | case 96: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2003 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2004 | { remove_node((yyvsp[(1) - (1)])); |
| 2005 | (yyval) = (yyvsp[(1) - (1)]); |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 2006 | } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2007 | break; |
| 2008 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 2009 | case 97: |
| 2010 | |
| 2011 | { (yyval) = (yyvsp[(4) - (4)]); } |
| 2012 | break; |
| 2013 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2014 | case 98: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2015 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 2016 | { (yyval) = (yyvsp[(4) - (4)]); } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2017 | break; |
| 2018 | |
| 2019 | case 99: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2020 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 2021 | { (yyval) = (yyvsp[(2) - (2)]); } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2022 | break; |
| 2023 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2024 | case 100: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2025 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 2026 | { (yyval) = (yyvsp[(3) - (3)]); } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2027 | break; |
| 2028 | |
| 2029 | case 101: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2030 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 2031 | { (yyval) = (yyvsp[(3) - (3)]); } |
| 2032 | break; |
| 2033 | |
| 2034 | case 102: |
| 2035 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2036 | { struct string_list *decl = *(yyvsp[(2) - (3)]); |
| 2037 | *(yyvsp[(2) - (3)]) = NULL; |
| 2038 | add_symbol(current_name, SYM_NORMAL, decl, is_extern); |
| 2039 | (yyval) = (yyvsp[(3) - (3)]); |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 2040 | } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2041 | break; |
| 2042 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 2043 | case 103: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2044 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 2045 | { (yyval) = NULL; } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2046 | break; |
| 2047 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 2048 | case 105: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2049 | |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 2050 | { remove_list((yyvsp[(2) - (2)]), &(*(yyvsp[(1) - (2)]))->next); (yyval) = (yyvsp[(2) - (2)]); } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2051 | break; |
| 2052 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 2053 | case 106: |
| 2054 | |
| 2055 | { (yyval) = (yyvsp[(3) - (3)]); } |
| 2056 | break; |
| 2057 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2058 | case 107: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2059 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 2060 | { (yyval) = (yyvsp[(3) - (3)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2061 | break; |
| 2062 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 2063 | case 108: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2064 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 2065 | { (yyval) = NULL; } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2066 | break; |
| 2067 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 2068 | case 111: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2069 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 2070 | { (yyval) = (yyvsp[(2) - (2)]); } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2071 | break; |
| 2072 | |
| 2073 | case 112: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2074 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 2075 | { (yyval) = (yyvsp[(3) - (3)]); } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2076 | break; |
| 2077 | |
| 2078 | case 113: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2079 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 2080 | { (yyval) = (yyvsp[(2) - (2)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2081 | break; |
| 2082 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 2083 | case 114: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2084 | |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 2085 | { (yyval) = NULL; } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2086 | break; |
| 2087 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 2088 | case 117: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2089 | |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 2090 | { (yyval) = (yyvsp[(3) - (3)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2091 | break; |
| 2092 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 2093 | case 118: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2094 | |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 2095 | { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2096 | break; |
| 2097 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 2098 | case 119: |
| 2099 | |
| 2100 | { (yyval) = (yyvsp[(2) - (2)]); } |
| 2101 | break; |
| 2102 | |
| 2103 | case 121: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2104 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 2105 | { (yyval) = (yyvsp[(2) - (2)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2106 | break; |
| 2107 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 2108 | case 122: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2109 | |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 2110 | { (yyval) = NULL; } |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 2111 | break; |
| 2112 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 2113 | case 124: |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 2114 | |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 2115 | { (yyval) = (yyvsp[(3) - (3)]); } |
| 2116 | break; |
| 2117 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 2118 | case 125: |
Michal Marek | 7e441fe | 2016-11-29 15:57:40 +0100 | [diff] [blame] | 2119 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 2120 | { (yyval) = (yyvsp[(4) - (4)]); } |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2121 | break; |
| 2122 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 2123 | case 128: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2124 | |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2125 | { |
| 2126 | const char *name = strdup((*(yyvsp[(1) - (1)]))->string); |
| 2127 | add_symbol(name, SYM_ENUM_CONST, NULL, 0); |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 2128 | } |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2129 | break; |
| 2130 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 2131 | case 129: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2132 | |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2133 | { |
| 2134 | const char *name = strdup((*(yyvsp[(1) - (3)]))->string); |
| 2135 | struct string_list *expr = copy_list_range(*(yyvsp[(3) - (3)]), *(yyvsp[(2) - (3)])); |
| 2136 | add_symbol(name, SYM_ENUM_CONST, expr, 0); |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 2137 | } |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2138 | break; |
| 2139 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 2140 | case 130: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2141 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 2142 | { (yyval) = (yyvsp[(2) - (2)]); } |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2143 | break; |
| 2144 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 2145 | case 131: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2146 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 2147 | { (yyval) = NULL; } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2148 | break; |
| 2149 | |
Michal Marek | fde42bf | 2017-01-03 14:55:24 +0100 | [diff] [blame] | 2150 | case 133: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2151 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 2152 | { export_symbol((*(yyvsp[(3) - (5)]))->string); (yyval) = (yyvsp[(5) - (5)]); } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2153 | break; |
| 2154 | |
| 2155 | |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2156 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2157 | default: break; |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2158 | } |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 2159 | /* User semantic actions sometimes alter yychar, and that requires |
| 2160 | that yytoken be updated with the new translation. We take the |
| 2161 | approach of translating immediately before every use of yytoken. |
| 2162 | One alternative is translating here after every semantic action, |
| 2163 | but that translation would be missed if the semantic action invokes |
| 2164 | YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or |
| 2165 | if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an |
| 2166 | incorrect destructor might then be invoked immediately. In the |
| 2167 | case of YYERROR or YYBACKUP, subsequent parser actions might lead |
| 2168 | to an incorrect destructor call or verbose syntax error message |
| 2169 | before the lookahead is translated. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2170 | YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2171 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2172 | YYPOPSTACK (yylen); |
| 2173 | yylen = 0; |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2174 | YY_STACK_PRINT (yyss, yyssp); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2175 | |
| 2176 | *++yyvsp = yyval; |
| 2177 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2178 | /* Now `shift' the result of the reduction. Determine what state |
| 2179 | that goes to, based on the state we popped back to and the rule |
| 2180 | number reduced by. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2181 | |
| 2182 | yyn = yyr1[yyn]; |
| 2183 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2184 | yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; |
| 2185 | if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2186 | yystate = yytable[yystate]; |
| 2187 | else |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2188 | yystate = yydefgoto[yyn - YYNTOKENS]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2189 | |
| 2190 | goto yynewstate; |
| 2191 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2192 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2193 | /*------------------------------------. |
| 2194 | | yyerrlab -- here on detecting error | |
| 2195 | `------------------------------------*/ |
| 2196 | yyerrlab: |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 2197 | /* Make sure we have latest lookahead translation. See comments at |
| 2198 | user semantic actions for why this is necessary. */ |
| 2199 | yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); |
| 2200 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2201 | /* If not already recovering from an error, report this error. */ |
| 2202 | if (!yyerrstatus) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2203 | { |
| 2204 | ++yynerrs; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2205 | #if ! YYERROR_VERBOSE |
| 2206 | yyerror (YY_("syntax error")); |
| 2207 | #else |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 2208 | # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ |
| 2209 | yyssp, yytoken) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2210 | { |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 2211 | char const *yymsgp = YY_("syntax error"); |
| 2212 | int yysyntax_error_status; |
| 2213 | yysyntax_error_status = YYSYNTAX_ERROR; |
| 2214 | if (yysyntax_error_status == 0) |
| 2215 | yymsgp = yymsg; |
| 2216 | else if (yysyntax_error_status == 1) |
| 2217 | { |
| 2218 | if (yymsg != yymsgbuf) |
| 2219 | YYSTACK_FREE (yymsg); |
| 2220 | yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); |
| 2221 | if (!yymsg) |
| 2222 | { |
| 2223 | yymsg = yymsgbuf; |
| 2224 | yymsg_alloc = sizeof yymsgbuf; |
| 2225 | yysyntax_error_status = 2; |
| 2226 | } |
| 2227 | else |
| 2228 | { |
| 2229 | yysyntax_error_status = YYSYNTAX_ERROR; |
| 2230 | yymsgp = yymsg; |
| 2231 | } |
| 2232 | } |
| 2233 | yyerror (yymsgp); |
| 2234 | if (yysyntax_error_status == 2) |
| 2235 | goto yyexhaustedlab; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2236 | } |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 2237 | # undef YYSYNTAX_ERROR |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2238 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2239 | } |
| 2240 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2241 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2242 | |
| 2243 | if (yyerrstatus == 3) |
| 2244 | { |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2245 | /* If just tried and failed to reuse lookahead token after an |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2246 | error, discard it. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2247 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2248 | if (yychar <= YYEOF) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2249 | { |
| 2250 | /* Return failure if at end of input. */ |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2251 | if (yychar == YYEOF) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2252 | YYABORT; |
| 2253 | } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2254 | else |
| 2255 | { |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2256 | yydestruct ("Error: discarding", |
| 2257 | yytoken, &yylval); |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2258 | yychar = YYEMPTY; |
| 2259 | } |
| 2260 | } |
| 2261 | |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2262 | /* Else will try to reuse lookahead token after shifting the error |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2263 | token. */ |
| 2264 | goto yyerrlab1; |
| 2265 | |
| 2266 | |
| 2267 | /*---------------------------------------------------. |
| 2268 | | yyerrorlab -- error raised explicitly by YYERROR. | |
| 2269 | `---------------------------------------------------*/ |
| 2270 | yyerrorlab: |
| 2271 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2272 | /* Pacify compilers like GCC when the user code never invokes |
| 2273 | YYERROR and the label yyerrorlab therefore never appears in user |
| 2274 | code. */ |
| 2275 | if (/*CONSTCOND*/ 0) |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2276 | goto yyerrorlab; |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2277 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2278 | /* Do not reclaim the symbols of the rule which action triggered |
| 2279 | this YYERROR. */ |
| 2280 | YYPOPSTACK (yylen); |
| 2281 | yylen = 0; |
| 2282 | YY_STACK_PRINT (yyss, yyssp); |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2283 | yystate = *yyssp; |
| 2284 | goto yyerrlab1; |
| 2285 | |
| 2286 | |
| 2287 | /*-------------------------------------------------------------. |
| 2288 | | yyerrlab1 -- common code for both syntax error and YYERROR. | |
| 2289 | `-------------------------------------------------------------*/ |
| 2290 | yyerrlab1: |
| 2291 | yyerrstatus = 3; /* Each real token shifted decrements this. */ |
| 2292 | |
| 2293 | for (;;) |
| 2294 | { |
| 2295 | yyn = yypact[yystate]; |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 2296 | if (!yypact_value_is_default (yyn)) |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2297 | { |
| 2298 | yyn += YYTERROR; |
| 2299 | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) |
| 2300 | { |
| 2301 | yyn = yytable[yyn]; |
| 2302 | if (0 < yyn) |
| 2303 | break; |
| 2304 | } |
| 2305 | } |
| 2306 | |
| 2307 | /* Pop the current state because it cannot handle the error token. */ |
| 2308 | if (yyssp == yyss) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2309 | YYABORT; |
| 2310 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2311 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2312 | yydestruct ("Error: popping", |
| 2313 | yystos[yystate], yyvsp); |
| 2314 | YYPOPSTACK (1); |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2315 | yystate = *yyssp; |
| 2316 | YY_STACK_PRINT (yyss, yyssp); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2317 | } |
| 2318 | |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 2319 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2320 | *++yyvsp = yylval; |
Michal Marek | 5b733fa | 2015-08-20 14:13:35 +0200 | [diff] [blame] | 2321 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2322 | |
| 2323 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2324 | /* Shift the error token. */ |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2325 | YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2326 | |
| 2327 | yystate = yyn; |
| 2328 | goto yynewstate; |
| 2329 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2330 | |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2331 | /*-------------------------------------. |
| 2332 | | yyacceptlab -- YYACCEPT comes here. | |
| 2333 | `-------------------------------------*/ |
| 2334 | yyacceptlab: |
| 2335 | yyresult = 0; |
| 2336 | goto yyreturn; |
| 2337 | |
| 2338 | /*-----------------------------------. |
| 2339 | | yyabortlab -- YYABORT comes here. | |
| 2340 | `-----------------------------------*/ |
| 2341 | yyabortlab: |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2342 | yyresult = 1; |
| 2343 | goto yyreturn; |
| 2344 | |
Jan Beulich | dc53324 | 2014-04-03 14:46:37 -0700 | [diff] [blame] | 2345 | #if !defined yyoverflow || YYERROR_VERBOSE |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2346 | /*-------------------------------------------------. |
| 2347 | | yyexhaustedlab -- memory exhaustion comes here. | |
| 2348 | `-------------------------------------------------*/ |
| 2349 | yyexhaustedlab: |
| 2350 | yyerror (YY_("memory exhausted")); |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2351 | yyresult = 2; |
| 2352 | /* Fall through. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2353 | #endif |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2354 | |
| 2355 | yyreturn: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2356 | if (yychar != YYEMPTY) |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame] | 2357 | { |
| 2358 | /* Make sure we have latest lookahead translation. See comments at |
| 2359 | user semantic actions for why this is necessary. */ |
| 2360 | yytoken = YYTRANSLATE (yychar); |
| 2361 | yydestruct ("Cleanup: discarding lookahead", |
| 2362 | yytoken, &yylval); |
| 2363 | } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2364 | /* Do not reclaim the symbols of the rule which action triggered |
| 2365 | this YYABORT or YYACCEPT. */ |
| 2366 | YYPOPSTACK (yylen); |
| 2367 | YY_STACK_PRINT (yyss, yyssp); |
| 2368 | while (yyssp != yyss) |
| 2369 | { |
| 2370 | yydestruct ("Cleanup: popping", |
| 2371 | yystos[*yyssp], yyvsp); |
| 2372 | YYPOPSTACK (1); |
| 2373 | } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2374 | #ifndef yyoverflow |
| 2375 | if (yyss != yyssa) |
| 2376 | YYSTACK_FREE (yyss); |
| 2377 | #endif |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 2378 | #if YYERROR_VERBOSE |
| 2379 | if (yymsg != yymsgbuf) |
| 2380 | YYSTACK_FREE (yymsg); |
| 2381 | #endif |
| 2382 | /* Make sure YYID is used. */ |
| 2383 | return YYID (yyresult); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2384 | } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2385 | |
| 2386 | |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2387 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2388 | |
| 2389 | |
| 2390 | static void |
| 2391 | yyerror(const char *e) |
| 2392 | { |
| 2393 | error_with_pos("%s", e); |
| 2394 | } |