dtc-parser.tab.c_shipped 71 KB

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