dtc-parser.tab.c_shipped 69 KB

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