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