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