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