dtc-parser.tab.c_shipped 52 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029
  1. /* A Bison parser, made by GNU Bison 2.4.1. */
  2. /* Skeleton implementation for Bison's Yacc-like parsers in C
  3. Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
  4. Free Software Foundation, Inc.
  5. This program is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  15. /* As a special exception, you may create a larger work that contains
  16. part or all of the Bison parser skeleton and distribute that work
  17. under terms of your choice, so long as that work isn't itself a
  18. parser generator using the skeleton or a modified version thereof
  19. as a parser skeleton. Alternatively, if you modify or redistribute
  20. the parser skeleton itself, you may (at your option) remove this
  21. special exception, which will cause the skeleton and the resulting
  22. Bison output files to be licensed under the GNU General Public
  23. License without this special exception.
  24. This special exception was added by the Free Software Foundation in
  25. version 2.2 of Bison. */
  26. /* C LALR(1) parser skeleton written by Richard Stallman, by
  27. simplifying the original so-called "semantic" parser. */
  28. /* All symbols defined below should begin with yy or YY, to avoid
  29. infringing on user name space. This should be done even for local
  30. variables, as they might otherwise be expanded by user macros.
  31. There are some unavoidable exceptions within include files to
  32. define necessary library symbols; they are noted "INFRINGES ON
  33. USER NAME SPACE" below. */
  34. /* Identify Bison output. */
  35. #define YYBISON 1
  36. /* Bison version. */
  37. #define YYBISON_VERSION "2.4.1"
  38. /* Skeleton name. */
  39. #define YYSKELETON_NAME "yacc.c"
  40. /* Pure parsers. */
  41. #define YYPURE 0
  42. /* Push parsers. */
  43. #define YYPUSH 0
  44. /* Pull parsers. */
  45. #define YYPULL 1
  46. /* Using locations. */
  47. #define YYLSP_NEEDED 0
  48. /* Copy the first part of user declarations. */
  49. /* Line 189 of yacc.c */
  50. #line 21 "dtc-parser.y"
  51. #include <stdio.h>
  52. #include "dtc.h"
  53. #include "srcpos.h"
  54. YYLTYPE yylloc;
  55. extern int yylex(void);
  56. extern void print_error(char const *fmt, ...);
  57. extern void yyerror(char const *s);
  58. extern struct boot_info *the_boot_info;
  59. extern int treesource_error;
  60. static unsigned long long eval_literal(const char *s, int base, int bits);
  61. /* Line 189 of yacc.c */
  62. #line 92 "dtc-parser.tab.c"
  63. /* Enabling traces. */
  64. #ifndef YYDEBUG
  65. # define YYDEBUG 0
  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. /* Enabling the token table. */
  75. #ifndef YYTOKEN_TABLE
  76. # define YYTOKEN_TABLE 0
  77. #endif
  78. /* Tokens. */
  79. #ifndef YYTOKENTYPE
  80. # define YYTOKENTYPE
  81. /* Put the tokens into the symbol table, so that GDB and other debuggers
  82. know about them. */
  83. enum yytokentype {
  84. DT_V1 = 258,
  85. DT_MEMRESERVE = 259,
  86. DT_PROPNODENAME = 260,
  87. DT_LITERAL = 261,
  88. DT_BASE = 262,
  89. DT_BYTE = 263,
  90. DT_STRING = 264,
  91. DT_LABEL = 265,
  92. DT_REF = 266,
  93. DT_INCBIN = 267
  94. };
  95. #endif
  96. #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
  97. typedef union YYSTYPE
  98. {
  99. /* Line 214 of yacc.c */
  100. #line 39 "dtc-parser.y"
  101. char *propnodename;
  102. char *literal;
  103. char *labelref;
  104. unsigned int cbase;
  105. uint8_t byte;
  106. struct data data;
  107. uint64_t addr;
  108. cell_t cell;
  109. struct property *prop;
  110. struct property *proplist;
  111. struct node *node;
  112. struct node *nodelist;
  113. struct reserve_info *re;
  114. /* Line 214 of yacc.c */
  115. #line 159 "dtc-parser.tab.c"
  116. } YYSTYPE;
  117. # define YYSTYPE_IS_TRIVIAL 1
  118. # define yystype YYSTYPE /* obsolescent; will be withdrawn */
  119. # define YYSTYPE_IS_DECLARED 1
  120. #endif
  121. /* Copy the second part of user declarations. */
  122. /* Line 264 of yacc.c */
  123. #line 171 "dtc-parser.tab.c"
  124. #ifdef short
  125. # undef short
  126. #endif
  127. #ifdef YYTYPE_UINT8
  128. typedef YYTYPE_UINT8 yytype_uint8;
  129. #else
  130. typedef unsigned char yytype_uint8;
  131. #endif
  132. #ifdef YYTYPE_INT8
  133. typedef YYTYPE_INT8 yytype_int8;
  134. #elif (defined __STDC__ || defined __C99__FUNC__ \
  135. || defined __cplusplus || defined _MSC_VER)
  136. typedef signed char yytype_int8;
  137. #else
  138. typedef short int yytype_int8;
  139. #endif
  140. #ifdef YYTYPE_UINT16
  141. typedef YYTYPE_UINT16 yytype_uint16;
  142. #else
  143. typedef unsigned short int yytype_uint16;
  144. #endif
  145. #ifdef YYTYPE_INT16
  146. typedef YYTYPE_INT16 yytype_int16;
  147. #else
  148. typedef short int yytype_int16;
  149. #endif
  150. #ifndef YYSIZE_T
  151. # ifdef __SIZE_TYPE__
  152. # define YYSIZE_T __SIZE_TYPE__
  153. # elif defined size_t
  154. # define YYSIZE_T size_t
  155. # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
  156. || defined __cplusplus || defined _MSC_VER)
  157. # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
  158. # define YYSIZE_T size_t
  159. # else
  160. # define YYSIZE_T unsigned int
  161. # endif
  162. #endif
  163. #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
  164. #ifndef YY_
  165. # if YYENABLE_NLS
  166. # if ENABLE_NLS
  167. # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
  168. # define YY_(msgid) dgettext ("bison-runtime", msgid)
  169. # endif
  170. # endif
  171. # ifndef YY_
  172. # define YY_(msgid) msgid
  173. # endif
  174. #endif
  175. /* Suppress unused-variable warnings by "using" E. */
  176. #if ! defined lint || defined __GNUC__
  177. # define YYUSE(e) ((void) (e))
  178. #else
  179. # define YYUSE(e) /* empty */
  180. #endif
  181. /* Identity function, used to suppress warnings about constant conditions. */
  182. #ifndef lint
  183. # define YYID(n) (n)
  184. #else
  185. #if (defined __STDC__ || defined __C99__FUNC__ \
  186. || defined __cplusplus || defined _MSC_VER)
  187. static int
  188. YYID (int yyi)
  189. #else
  190. static int
  191. YYID (yyi)
  192. int yyi;
  193. #endif
  194. {
  195. return yyi;
  196. }
  197. #endif
  198. #if ! defined yyoverflow || YYERROR_VERBOSE
  199. /* The parser invokes alloca or malloc; define the necessary symbols. */
  200. # ifdef YYSTACK_USE_ALLOCA
  201. # if YYSTACK_USE_ALLOCA
  202. # ifdef __GNUC__
  203. # define YYSTACK_ALLOC __builtin_alloca
  204. # elif defined __BUILTIN_VA_ARG_INCR
  205. # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
  206. # elif defined _AIX
  207. # define YYSTACK_ALLOC __alloca
  208. # elif defined _MSC_VER
  209. # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
  210. # define alloca _alloca
  211. # else
  212. # define YYSTACK_ALLOC alloca
  213. # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
  214. || defined __cplusplus || defined _MSC_VER)
  215. # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  216. # ifndef _STDLIB_H
  217. # define _STDLIB_H 1
  218. # endif
  219. # endif
  220. # endif
  221. # endif
  222. # endif
  223. # ifdef YYSTACK_ALLOC
  224. /* Pacify GCC's `empty if-body' warning. */
  225. # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
  226. # ifndef YYSTACK_ALLOC_MAXIMUM
  227. /* The OS might guarantee only one guard page at the bottom of the stack,
  228. and a page size can be as small as 4096 bytes. So we cannot safely
  229. invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
  230. to allow for a few compiler-allocated temporary stack slots. */
  231. # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
  232. # endif
  233. # else
  234. # define YYSTACK_ALLOC YYMALLOC
  235. # define YYSTACK_FREE YYFREE
  236. # ifndef YYSTACK_ALLOC_MAXIMUM
  237. # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
  238. # endif
  239. # if (defined __cplusplus && ! defined _STDLIB_H \
  240. && ! ((defined YYMALLOC || defined malloc) \
  241. && (defined YYFREE || defined free)))
  242. # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  243. # ifndef _STDLIB_H
  244. # define _STDLIB_H 1
  245. # endif
  246. # endif
  247. # ifndef YYMALLOC
  248. # define YYMALLOC malloc
  249. # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
  250. || defined __cplusplus || defined _MSC_VER)
  251. void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
  252. # endif
  253. # endif
  254. # ifndef YYFREE
  255. # define YYFREE free
  256. # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
  257. || defined __cplusplus || defined _MSC_VER)
  258. void free (void *); /* INFRINGES ON USER NAME SPACE */
  259. # endif
  260. # endif
  261. # endif
  262. #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
  263. #if (! defined yyoverflow \
  264. && (! defined __cplusplus \
  265. || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
  266. /* A type that is properly aligned for any stack member. */
  267. union yyalloc
  268. {
  269. yytype_int16 yyss_alloc;
  270. YYSTYPE yyvs_alloc;
  271. };
  272. /* The size of the maximum gap between one aligned stack and the next. */
  273. # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
  274. /* The size of an array large to enough to hold all stacks, each with
  275. N elements. */
  276. # define YYSTACK_BYTES(N) \
  277. ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
  278. + YYSTACK_GAP_MAXIMUM)
  279. /* Copy COUNT objects from FROM to TO. The source and destination do
  280. not overlap. */
  281. # ifndef YYCOPY
  282. # if defined __GNUC__ && 1 < __GNUC__
  283. # define YYCOPY(To, From, Count) \
  284. __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
  285. # else
  286. # define YYCOPY(To, From, Count) \
  287. do \
  288. { \
  289. YYSIZE_T yyi; \
  290. for (yyi = 0; yyi < (Count); yyi++) \
  291. (To)[yyi] = (From)[yyi]; \
  292. } \
  293. while (YYID (0))
  294. # endif
  295. # endif
  296. /* Relocate STACK from its old location to the new one. The
  297. local variables YYSIZE and YYSTACKSIZE give the old and new number of
  298. elements in the stack, and YYPTR gives the new location of the
  299. stack. Advance YYPTR to a properly aligned location for the next
  300. stack. */
  301. # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
  302. do \
  303. { \
  304. YYSIZE_T yynewbytes; \
  305. YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
  306. Stack = &yyptr->Stack_alloc; \
  307. yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
  308. yyptr += yynewbytes / sizeof (*yyptr); \
  309. } \
  310. while (YYID (0))
  311. #endif
  312. /* YYFINAL -- State number of the termination state. */
  313. #define YYFINAL 4
  314. /* YYLAST -- Last index in YYTABLE. */
  315. #define YYLAST 56
  316. /* YYNTOKENS -- Number of terminals. */
  317. #define YYNTOKENS 25
  318. /* YYNNTS -- Number of nonterminals. */
  319. #define YYNNTS 16
  320. /* YYNRULES -- Number of rules. */
  321. #define YYNRULES 39
  322. /* YYNRULES -- Number of states. */
  323. #define YYNSTATES 67
  324. /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
  325. #define YYUNDEFTOK 2
  326. #define YYMAXUTOK 267
  327. #define YYTRANSLATE(YYX) \
  328. ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
  329. /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
  330. static const yytype_uint8 yytranslate[] =
  331. {
  332. 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  333. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  334. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  335. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  336. 22, 24, 2, 2, 23, 2, 2, 14, 2, 2,
  337. 2, 2, 2, 2, 2, 2, 2, 2, 2, 13,
  338. 18, 17, 19, 2, 2, 2, 2, 2, 2, 2,
  339. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  340. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  341. 2, 20, 2, 21, 2, 2, 2, 2, 2, 2,
  342. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  343. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  344. 2, 2, 2, 15, 2, 16, 2, 2, 2, 2,
  345. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  346. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  347. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  348. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  349. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  350. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  351. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  352. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  353. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  354. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  355. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  356. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  357. 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
  358. 5, 6, 7, 8, 9, 10, 11, 12
  359. };
  360. #if YYDEBUG
  361. /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
  362. YYRHS. */
  363. static const yytype_uint8 yyprhs[] =
  364. {
  365. 0, 0, 3, 8, 9, 12, 17, 20, 22, 25,
  366. 29, 33, 39, 40, 43, 48, 51, 54, 57, 62,
  367. 67, 70, 80, 86, 89, 90, 93, 96, 97, 100,
  368. 103, 106, 108, 109, 112, 115, 116, 119, 122, 125
  369. };
  370. /* YYRHS -- A `-1'-separated list of the rules' RHS. */
  371. static const yytype_int8 yyrhs[] =
  372. {
  373. 26, 0, -1, 3, 13, 27, 30, -1, -1, 28,
  374. 27, -1, 4, 29, 29, 13, -1, 10, 28, -1,
  375. 6, -1, 14, 31, -1, 30, 14, 31, -1, 30,
  376. 11, 31, -1, 15, 32, 39, 16, 13, -1, -1,
  377. 32, 33, -1, 5, 17, 34, 13, -1, 5, 13,
  378. -1, 10, 33, -1, 35, 9, -1, 35, 18, 36,
  379. 19, -1, 35, 20, 38, 21, -1, 35, 11, -1,
  380. 35, 12, 22, 9, 23, 29, 23, 29, 24, -1,
  381. 35, 12, 22, 9, 24, -1, 34, 10, -1, -1,
  382. 34, 23, -1, 35, 10, -1, -1, 36, 37, -1,
  383. 36, 11, -1, 36, 10, -1, 6, -1, -1, 38,
  384. 8, -1, 38, 10, -1, -1, 40, 39, -1, 40,
  385. 33, -1, 5, 31, -1, 10, 40, -1
  386. };
  387. /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
  388. static const yytype_uint16 yyrline[] =
  389. {
  390. 0, 86, 86, 95, 98, 105, 109, 117, 124, 128,
  391. 132, 145, 153, 156, 163, 167, 171, 179, 183, 187,
  392. 191, 195, 212, 222, 230, 233, 237, 245, 248, 252,
  393. 257, 264, 272, 275, 279, 287, 290, 294, 302, 306
  394. };
  395. #endif
  396. #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
  397. /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
  398. First, the terminals, then, starting at YYNTOKENS, nonterminals. */
  399. static const char *const yytname[] =
  400. {
  401. "$end", "error", "$undefined", "DT_V1", "DT_MEMRESERVE",
  402. "DT_PROPNODENAME", "DT_LITERAL", "DT_BASE", "DT_BYTE", "DT_STRING",
  403. "DT_LABEL", "DT_REF", "DT_INCBIN", "';'", "'/'", "'{'", "'}'", "'='",
  404. "'<'", "'>'", "'['", "']'", "'('", "','", "')'", "$accept", "sourcefile",
  405. "memreserves", "memreserve", "addr", "devicetree", "nodedef", "proplist",
  406. "propdef", "propdata", "propdataprefix", "celllist", "cellval",
  407. "bytestring", "subnodes", "subnode", 0
  408. };
  409. #endif
  410. # ifdef YYPRINT
  411. /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
  412. token YYLEX-NUM. */
  413. static const yytype_uint16 yytoknum[] =
  414. {
  415. 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
  416. 265, 266, 267, 59, 47, 123, 125, 61, 60, 62,
  417. 91, 93, 40, 44, 41
  418. };
  419. # endif
  420. /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
  421. static const yytype_uint8 yyr1[] =
  422. {
  423. 0, 25, 26, 27, 27, 28, 28, 29, 30, 30,
  424. 30, 31, 32, 32, 33, 33, 33, 34, 34, 34,
  425. 34, 34, 34, 34, 35, 35, 35, 36, 36, 36,
  426. 36, 37, 38, 38, 38, 39, 39, 39, 40, 40
  427. };
  428. /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
  429. static const yytype_uint8 yyr2[] =
  430. {
  431. 0, 2, 4, 0, 2, 4, 2, 1, 2, 3,
  432. 3, 5, 0, 2, 4, 2, 2, 2, 4, 4,
  433. 2, 9, 5, 2, 0, 2, 2, 0, 2, 2,
  434. 2, 1, 0, 2, 2, 0, 2, 2, 2, 2
  435. };
  436. /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
  437. STATE-NUM when YYTABLE doesn't specify something else to do. Zero
  438. means the default is an error. */
  439. static const yytype_uint8 yydefact[] =
  440. {
  441. 0, 0, 0, 3, 1, 0, 0, 0, 3, 7,
  442. 0, 6, 0, 2, 4, 0, 12, 8, 0, 0,
  443. 5, 35, 10, 9, 0, 0, 13, 0, 35, 15,
  444. 24, 38, 16, 39, 0, 37, 36, 0, 0, 11,
  445. 23, 14, 25, 17, 26, 20, 0, 27, 32, 0,
  446. 0, 0, 0, 31, 30, 29, 18, 28, 33, 34,
  447. 19, 0, 22, 0, 0, 0, 21
  448. };
  449. /* YYDEFGOTO[NTERM-NUM]. */
  450. static const yytype_int8 yydefgoto[] =
  451. {
  452. -1, 2, 7, 8, 10, 13, 17, 21, 26, 37,
  453. 38, 50, 57, 51, 27, 28
  454. };
  455. /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
  456. STATE-NUM. */
  457. #define YYPACT_NINF -12
  458. static const yytype_int8 yypact[] =
  459. {
  460. 10, -11, 18, -1, -12, 22, -1, 15, -1, -12,
  461. 22, -12, 20, 1, -12, 17, -12, -12, 20, 20,
  462. -12, 6, -12, -12, 21, 6, -12, 23, 6, -12,
  463. -12, -12, -12, -12, 28, -12, -12, -6, 13, -12,
  464. -12, -12, -12, -12, -12, -12, 24, -12, -12, 33,
  465. -5, 0, -4, -12, -12, -12, -12, -12, -12, -12,
  466. -12, 22, -12, 25, 22, 19, -12
  467. };
  468. /* YYPGOTO[NTERM-NUM]. */
  469. static const yytype_int8 yypgoto[] =
  470. {
  471. -12, -12, 36, 39, -10, -12, 8, -12, 12, -12,
  472. -12, -12, -12, -12, 27, 31
  473. };
  474. /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
  475. positive, shift that token. If negative, reduce the rule which
  476. number is the opposite. If zero, do what YYDEFACT says.
  477. If YYTABLE_NINF, syntax error. */
  478. #define YYTABLE_NINF -1
  479. static const yytype_uint8 yytable[] =
  480. {
  481. 15, 53, 3, 5, 40, 54, 55, 41, 58, 6,
  482. 59, 24, 18, 1, 56, 19, 25, 42, 4, 61,
  483. 62, 60, 43, 44, 45, 46, 22, 23, 9, 12,
  484. 20, 47, 31, 48, 29, 16, 16, 32, 30, 34,
  485. 35, 39, 52, 66, 14, 11, 49, 0, 64, 0,
  486. 0, 63, 0, 0, 65, 36, 33
  487. };
  488. static const yytype_int8 yycheck[] =
  489. {
  490. 10, 6, 13, 4, 10, 10, 11, 13, 8, 10,
  491. 10, 5, 11, 3, 19, 14, 10, 23, 0, 23,
  492. 24, 21, 9, 10, 11, 12, 18, 19, 6, 14,
  493. 13, 18, 24, 20, 13, 15, 15, 25, 17, 16,
  494. 28, 13, 9, 24, 8, 6, 22, -1, 23, -1,
  495. -1, 61, -1, -1, 64, 28, 25
  496. };
  497. /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
  498. symbol of state STATE-NUM. */
  499. static const yytype_uint8 yystos[] =
  500. {
  501. 0, 3, 26, 13, 0, 4, 10, 27, 28, 6,
  502. 29, 28, 14, 30, 27, 29, 15, 31, 11, 14,
  503. 13, 32, 31, 31, 5, 10, 33, 39, 40, 13,
  504. 17, 31, 33, 40, 16, 33, 39, 34, 35, 13,
  505. 10, 13, 23, 9, 10, 11, 12, 18, 20, 22,
  506. 36, 38, 9, 6, 10, 11, 19, 37, 8, 10,
  507. 21, 23, 24, 29, 23, 29, 24
  508. };
  509. #define yyerrok (yyerrstatus = 0)
  510. #define yyclearin (yychar = YYEMPTY)
  511. #define YYEMPTY (-2)
  512. #define YYEOF 0
  513. #define YYACCEPT goto yyacceptlab
  514. #define YYABORT goto yyabortlab
  515. #define YYERROR goto yyerrorlab
  516. /* Like YYERROR except do call yyerror. This remains here temporarily
  517. to ease the transition to the new meaning of YYERROR, for GCC.
  518. Once GCC version 2 has supplanted version 1, this can go. */
  519. #define YYFAIL goto yyerrlab
  520. #define YYRECOVERING() (!!yyerrstatus)
  521. #define YYBACKUP(Token, Value) \
  522. do \
  523. if (yychar == YYEMPTY && yylen == 1) \
  524. { \
  525. yychar = (Token); \
  526. yylval = (Value); \
  527. yytoken = YYTRANSLATE (yychar); \
  528. YYPOPSTACK (1); \
  529. goto yybackup; \
  530. } \
  531. else \
  532. { \
  533. yyerror (YY_("syntax error: cannot back up")); \
  534. YYERROR; \
  535. } \
  536. while (YYID (0))
  537. #define YYTERROR 1
  538. #define YYERRCODE 256
  539. /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
  540. If N is 0, then set CURRENT to the empty location which ends
  541. the previous symbol: RHS[0] (always defined). */
  542. #define YYRHSLOC(Rhs, K) ((Rhs)[K])
  543. #ifndef YYLLOC_DEFAULT
  544. # define YYLLOC_DEFAULT(Current, Rhs, N) \
  545. do \
  546. if (YYID (N)) \
  547. { \
  548. (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
  549. (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
  550. (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
  551. (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
  552. } \
  553. else \
  554. { \
  555. (Current).first_line = (Current).last_line = \
  556. YYRHSLOC (Rhs, 0).last_line; \
  557. (Current).first_column = (Current).last_column = \
  558. YYRHSLOC (Rhs, 0).last_column; \
  559. } \
  560. while (YYID (0))
  561. #endif
  562. /* YY_LOCATION_PRINT -- Print the location on the stream.
  563. This macro was not mandated originally: define only if we know
  564. we won't break user code: when these are the locations we know. */
  565. #ifndef YY_LOCATION_PRINT
  566. # if YYLTYPE_IS_TRIVIAL
  567. # define YY_LOCATION_PRINT(File, Loc) \
  568. fprintf (File, "%d.%d-%d.%d", \
  569. (Loc).first_line, (Loc).first_column, \
  570. (Loc).last_line, (Loc).last_column)
  571. # else
  572. # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
  573. # endif
  574. #endif
  575. /* YYLEX -- calling `yylex' with the right arguments. */
  576. #ifdef YYLEX_PARAM
  577. # define YYLEX yylex (YYLEX_PARAM)
  578. #else
  579. # define YYLEX yylex ()
  580. #endif
  581. /* Enable debugging if requested. */
  582. #if YYDEBUG
  583. # ifndef YYFPRINTF
  584. # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
  585. # define YYFPRINTF fprintf
  586. # endif
  587. # define YYDPRINTF(Args) \
  588. do { \
  589. if (yydebug) \
  590. YYFPRINTF Args; \
  591. } while (YYID (0))
  592. # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
  593. do { \
  594. if (yydebug) \
  595. { \
  596. YYFPRINTF (stderr, "%s ", Title); \
  597. yy_symbol_print (stderr, \
  598. Type, Value); \
  599. YYFPRINTF (stderr, "\n"); \
  600. } \
  601. } while (YYID (0))
  602. /*--------------------------------.
  603. | Print this symbol on YYOUTPUT. |
  604. `--------------------------------*/
  605. /*ARGSUSED*/
  606. #if (defined __STDC__ || defined __C99__FUNC__ \
  607. || defined __cplusplus || defined _MSC_VER)
  608. static void
  609. yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
  610. #else
  611. static void
  612. yy_symbol_value_print (yyoutput, yytype, yyvaluep)
  613. FILE *yyoutput;
  614. int yytype;
  615. YYSTYPE const * const yyvaluep;
  616. #endif
  617. {
  618. if (!yyvaluep)
  619. return;
  620. # ifdef YYPRINT
  621. if (yytype < YYNTOKENS)
  622. YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
  623. # else
  624. YYUSE (yyoutput);
  625. # endif
  626. switch (yytype)
  627. {
  628. default:
  629. break;
  630. }
  631. }
  632. /*--------------------------------.
  633. | Print this symbol on YYOUTPUT. |
  634. `--------------------------------*/
  635. #if (defined __STDC__ || defined __C99__FUNC__ \
  636. || defined __cplusplus || defined _MSC_VER)
  637. static void
  638. yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
  639. #else
  640. static void
  641. yy_symbol_print (yyoutput, yytype, yyvaluep)
  642. FILE *yyoutput;
  643. int yytype;
  644. YYSTYPE const * const yyvaluep;
  645. #endif
  646. {
  647. if (yytype < YYNTOKENS)
  648. YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
  649. else
  650. YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
  651. yy_symbol_value_print (yyoutput, yytype, yyvaluep);
  652. YYFPRINTF (yyoutput, ")");
  653. }
  654. /*------------------------------------------------------------------.
  655. | yy_stack_print -- Print the state stack from its BOTTOM up to its |
  656. | TOP (included). |
  657. `------------------------------------------------------------------*/
  658. #if (defined __STDC__ || defined __C99__FUNC__ \
  659. || defined __cplusplus || defined _MSC_VER)
  660. static void
  661. yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
  662. #else
  663. static void
  664. yy_stack_print (yybottom, yytop)
  665. yytype_int16 *yybottom;
  666. yytype_int16 *yytop;
  667. #endif
  668. {
  669. YYFPRINTF (stderr, "Stack now");
  670. for (; yybottom <= yytop; yybottom++)
  671. {
  672. int yybot = *yybottom;
  673. YYFPRINTF (stderr, " %d", yybot);
  674. }
  675. YYFPRINTF (stderr, "\n");
  676. }
  677. # define YY_STACK_PRINT(Bottom, Top) \
  678. do { \
  679. if (yydebug) \
  680. yy_stack_print ((Bottom), (Top)); \
  681. } while (YYID (0))
  682. /*------------------------------------------------.
  683. | Report that the YYRULE is going to be reduced. |
  684. `------------------------------------------------*/
  685. #if (defined __STDC__ || defined __C99__FUNC__ \
  686. || defined __cplusplus || defined _MSC_VER)
  687. static void
  688. yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
  689. #else
  690. static void
  691. yy_reduce_print (yyvsp, yyrule)
  692. YYSTYPE *yyvsp;
  693. int yyrule;
  694. #endif
  695. {
  696. int yynrhs = yyr2[yyrule];
  697. int yyi;
  698. unsigned long int yylno = yyrline[yyrule];
  699. YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
  700. yyrule - 1, yylno);
  701. /* The symbols being reduced. */
  702. for (yyi = 0; yyi < yynrhs; yyi++)
  703. {
  704. YYFPRINTF (stderr, " $%d = ", yyi + 1);
  705. yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
  706. &(yyvsp[(yyi + 1) - (yynrhs)])
  707. );
  708. YYFPRINTF (stderr, "\n");
  709. }
  710. }
  711. # define YY_REDUCE_PRINT(Rule) \
  712. do { \
  713. if (yydebug) \
  714. yy_reduce_print (yyvsp, Rule); \
  715. } while (YYID (0))
  716. /* Nonzero means print parse trace. It is left uninitialized so that
  717. multiple parsers can coexist. */
  718. int yydebug;
  719. #else /* !YYDEBUG */
  720. # define YYDPRINTF(Args)
  721. # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
  722. # define YY_STACK_PRINT(Bottom, Top)
  723. # define YY_REDUCE_PRINT(Rule)
  724. #endif /* !YYDEBUG */
  725. /* YYINITDEPTH -- initial size of the parser's stacks. */
  726. #ifndef YYINITDEPTH
  727. # define YYINITDEPTH 200
  728. #endif
  729. /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
  730. if the built-in stack extension method is used).
  731. Do not make this value too large; the results are undefined if
  732. YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
  733. evaluated with infinite-precision integer arithmetic. */
  734. #ifndef YYMAXDEPTH
  735. # define YYMAXDEPTH 10000
  736. #endif
  737. #if YYERROR_VERBOSE
  738. # ifndef yystrlen
  739. # if defined __GLIBC__ && defined _STRING_H
  740. # define yystrlen strlen
  741. # else
  742. /* Return the length of YYSTR. */
  743. #if (defined __STDC__ || defined __C99__FUNC__ \
  744. || defined __cplusplus || defined _MSC_VER)
  745. static YYSIZE_T
  746. yystrlen (const char *yystr)
  747. #else
  748. static YYSIZE_T
  749. yystrlen (yystr)
  750. const char *yystr;
  751. #endif
  752. {
  753. YYSIZE_T yylen;
  754. for (yylen = 0; yystr[yylen]; yylen++)
  755. continue;
  756. return yylen;
  757. }
  758. # endif
  759. # endif
  760. # ifndef yystpcpy
  761. # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
  762. # define yystpcpy stpcpy
  763. # else
  764. /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
  765. YYDEST. */
  766. #if (defined __STDC__ || defined __C99__FUNC__ \
  767. || defined __cplusplus || defined _MSC_VER)
  768. static char *
  769. yystpcpy (char *yydest, const char *yysrc)
  770. #else
  771. static char *
  772. yystpcpy (yydest, yysrc)
  773. char *yydest;
  774. const char *yysrc;
  775. #endif
  776. {
  777. char *yyd = yydest;
  778. const char *yys = yysrc;
  779. while ((*yyd++ = *yys++) != '\0')
  780. continue;
  781. return yyd - 1;
  782. }
  783. # endif
  784. # endif
  785. # ifndef yytnamerr
  786. /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
  787. quotes and backslashes, so that it's suitable for yyerror. The
  788. heuristic is that double-quoting is unnecessary unless the string
  789. contains an apostrophe, a comma, or backslash (other than
  790. backslash-backslash). YYSTR is taken from yytname. If YYRES is
  791. null, do not copy; instead, return the length of what the result
  792. would have been. */
  793. static YYSIZE_T
  794. yytnamerr (char *yyres, const char *yystr)
  795. {
  796. if (*yystr == '"')
  797. {
  798. YYSIZE_T yyn = 0;
  799. char const *yyp = yystr;
  800. for (;;)
  801. switch (*++yyp)
  802. {
  803. case '\'':
  804. case ',':
  805. goto do_not_strip_quotes;
  806. case '\\':
  807. if (*++yyp != '\\')
  808. goto do_not_strip_quotes;
  809. /* Fall through. */
  810. default:
  811. if (yyres)
  812. yyres[yyn] = *yyp;
  813. yyn++;
  814. break;
  815. case '"':
  816. if (yyres)
  817. yyres[yyn] = '\0';
  818. return yyn;
  819. }
  820. do_not_strip_quotes: ;
  821. }
  822. if (! yyres)
  823. return yystrlen (yystr);
  824. return yystpcpy (yyres, yystr) - yyres;
  825. }
  826. # endif
  827. /* Copy into YYRESULT an error message about the unexpected token
  828. YYCHAR while in state YYSTATE. Return the number of bytes copied,
  829. including the terminating null byte. If YYRESULT is null, do not
  830. copy anything; just return the number of bytes that would be
  831. copied. As a special case, return 0 if an ordinary "syntax error"
  832. message will do. Return YYSIZE_MAXIMUM if overflow occurs during
  833. size calculation. */
  834. static YYSIZE_T
  835. yysyntax_error (char *yyresult, int yystate, int yychar)
  836. {
  837. int yyn = yypact[yystate];
  838. if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
  839. return 0;
  840. else
  841. {
  842. int yytype = YYTRANSLATE (yychar);
  843. YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
  844. YYSIZE_T yysize = yysize0;
  845. YYSIZE_T yysize1;
  846. int yysize_overflow = 0;
  847. enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
  848. char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
  849. int yyx;
  850. # if 0
  851. /* This is so xgettext sees the translatable formats that are
  852. constructed on the fly. */
  853. YY_("syntax error, unexpected %s");
  854. YY_("syntax error, unexpected %s, expecting %s");
  855. YY_("syntax error, unexpected %s, expecting %s or %s");
  856. YY_("syntax error, unexpected %s, expecting %s or %s or %s");
  857. YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
  858. # endif
  859. char *yyfmt;
  860. char const *yyf;
  861. static char const yyunexpected[] = "syntax error, unexpected %s";
  862. static char const yyexpecting[] = ", expecting %s";
  863. static char const yyor[] = " or %s";
  864. char yyformat[sizeof yyunexpected
  865. + sizeof yyexpecting - 1
  866. + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
  867. * (sizeof yyor - 1))];
  868. char const *yyprefix = yyexpecting;
  869. /* Start YYX at -YYN if negative to avoid negative indexes in
  870. YYCHECK. */
  871. int yyxbegin = yyn < 0 ? -yyn : 0;
  872. /* Stay within bounds of both yycheck and yytname. */
  873. int yychecklim = YYLAST - yyn + 1;
  874. int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
  875. int yycount = 1;
  876. yyarg[0] = yytname[yytype];
  877. yyfmt = yystpcpy (yyformat, yyunexpected);
  878. for (yyx = yyxbegin; yyx < yyxend; ++yyx)
  879. if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
  880. {
  881. if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
  882. {
  883. yycount = 1;
  884. yysize = yysize0;
  885. yyformat[sizeof yyunexpected - 1] = '\0';
  886. break;
  887. }
  888. yyarg[yycount++] = yytname[yyx];
  889. yysize1 = yysize + yytnamerr (0, yytname[yyx]);
  890. yysize_overflow |= (yysize1 < yysize);
  891. yysize = yysize1;
  892. yyfmt = yystpcpy (yyfmt, yyprefix);
  893. yyprefix = yyor;
  894. }
  895. yyf = YY_(yyformat);
  896. yysize1 = yysize + yystrlen (yyf);
  897. yysize_overflow |= (yysize1 < yysize);
  898. yysize = yysize1;
  899. if (yysize_overflow)
  900. return YYSIZE_MAXIMUM;
  901. if (yyresult)
  902. {
  903. /* Avoid sprintf, as that infringes on the user's name space.
  904. Don't have undefined behavior even if the translation
  905. produced a string with the wrong number of "%s"s. */
  906. char *yyp = yyresult;
  907. int yyi = 0;
  908. while ((*yyp = *yyf) != '\0')
  909. {
  910. if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
  911. {
  912. yyp += yytnamerr (yyp, yyarg[yyi++]);
  913. yyf += 2;
  914. }
  915. else
  916. {
  917. yyp++;
  918. yyf++;
  919. }
  920. }
  921. }
  922. return yysize;
  923. }
  924. }
  925. #endif /* YYERROR_VERBOSE */
  926. /*-----------------------------------------------.
  927. | Release the memory associated to this symbol. |
  928. `-----------------------------------------------*/
  929. /*ARGSUSED*/
  930. #if (defined __STDC__ || defined __C99__FUNC__ \
  931. || defined __cplusplus || defined _MSC_VER)
  932. static void
  933. yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
  934. #else
  935. static void
  936. yydestruct (yymsg, yytype, yyvaluep)
  937. const char *yymsg;
  938. int yytype;
  939. YYSTYPE *yyvaluep;
  940. #endif
  941. {
  942. YYUSE (yyvaluep);
  943. if (!yymsg)
  944. yymsg = "Deleting";
  945. YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
  946. switch (yytype)
  947. {
  948. default:
  949. break;
  950. }
  951. }
  952. /* Prevent warnings from -Wmissing-prototypes. */
  953. #ifdef YYPARSE_PARAM
  954. #if defined __STDC__ || defined __cplusplus
  955. int yyparse (void *YYPARSE_PARAM);
  956. #else
  957. int yyparse ();
  958. #endif
  959. #else /* ! YYPARSE_PARAM */
  960. #if defined __STDC__ || defined __cplusplus
  961. int yyparse (void);
  962. #else
  963. int yyparse ();
  964. #endif
  965. #endif /* ! YYPARSE_PARAM */
  966. /* The lookahead symbol. */
  967. int yychar;
  968. /* The semantic value of the lookahead symbol. */
  969. YYSTYPE yylval;
  970. /* Number of syntax errors so far. */
  971. int yynerrs;
  972. /*-------------------------.
  973. | yyparse or yypush_parse. |
  974. `-------------------------*/
  975. #ifdef YYPARSE_PARAM
  976. #if (defined __STDC__ || defined __C99__FUNC__ \
  977. || defined __cplusplus || defined _MSC_VER)
  978. int
  979. yyparse (void *YYPARSE_PARAM)
  980. #else
  981. int
  982. yyparse (YYPARSE_PARAM)
  983. void *YYPARSE_PARAM;
  984. #endif
  985. #else /* ! YYPARSE_PARAM */
  986. #if (defined __STDC__ || defined __C99__FUNC__ \
  987. || defined __cplusplus || defined _MSC_VER)
  988. int
  989. yyparse (void)
  990. #else
  991. int
  992. yyparse ()
  993. #endif
  994. #endif
  995. {
  996. int yystate;
  997. /* Number of tokens to shift before error messages enabled. */
  998. int yyerrstatus;
  999. /* The stacks and their tools:
  1000. `yyss': related to states.
  1001. `yyvs': related to semantic values.
  1002. Refer to the stacks thru separate pointers, to allow yyoverflow
  1003. to reallocate them elsewhere. */
  1004. /* The state stack. */
  1005. yytype_int16 yyssa[YYINITDEPTH];
  1006. yytype_int16 *yyss;
  1007. yytype_int16 *yyssp;
  1008. /* The semantic value stack. */
  1009. YYSTYPE yyvsa[YYINITDEPTH];
  1010. YYSTYPE *yyvs;
  1011. YYSTYPE *yyvsp;
  1012. YYSIZE_T yystacksize;
  1013. int yyn;
  1014. int yyresult;
  1015. /* Lookahead token as an internal (translated) token number. */
  1016. int yytoken;
  1017. /* The variables used to return semantic value and location from the
  1018. action routines. */
  1019. YYSTYPE yyval;
  1020. #if YYERROR_VERBOSE
  1021. /* Buffer for error messages, and its allocated size. */
  1022. char yymsgbuf[128];
  1023. char *yymsg = yymsgbuf;
  1024. YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
  1025. #endif
  1026. #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
  1027. /* The number of symbols on the RHS of the reduced rule.
  1028. Keep to zero when no symbol should be popped. */
  1029. int yylen = 0;
  1030. yytoken = 0;
  1031. yyss = yyssa;
  1032. yyvs = yyvsa;
  1033. yystacksize = YYINITDEPTH;
  1034. YYDPRINTF ((stderr, "Starting parse\n"));
  1035. yystate = 0;
  1036. yyerrstatus = 0;
  1037. yynerrs = 0;
  1038. yychar = YYEMPTY; /* Cause a token to be read. */
  1039. /* Initialize stack pointers.
  1040. Waste one element of value and location stack
  1041. so that they stay on the same level as the state stack.
  1042. The wasted elements are never initialized. */
  1043. yyssp = yyss;
  1044. yyvsp = yyvs;
  1045. goto yysetstate;
  1046. /*------------------------------------------------------------.
  1047. | yynewstate -- Push a new state, which is found in yystate. |
  1048. `------------------------------------------------------------*/
  1049. yynewstate:
  1050. /* In all cases, when you get here, the value and location stacks
  1051. have just been pushed. So pushing a state here evens the stacks. */
  1052. yyssp++;
  1053. yysetstate:
  1054. *yyssp = yystate;
  1055. if (yyss + yystacksize - 1 <= yyssp)
  1056. {
  1057. /* Get the current used size of the three stacks, in elements. */
  1058. YYSIZE_T yysize = yyssp - yyss + 1;
  1059. #ifdef yyoverflow
  1060. {
  1061. /* Give user a chance to reallocate the stack. Use copies of
  1062. these so that the &'s don't force the real ones into
  1063. memory. */
  1064. YYSTYPE *yyvs1 = yyvs;
  1065. yytype_int16 *yyss1 = yyss;
  1066. /* Each stack pointer address is followed by the size of the
  1067. data in use in that stack, in bytes. This used to be a
  1068. conditional around just the two extra args, but that might
  1069. be undefined if yyoverflow is a macro. */
  1070. yyoverflow (YY_("memory exhausted"),
  1071. &yyss1, yysize * sizeof (*yyssp),
  1072. &yyvs1, yysize * sizeof (*yyvsp),
  1073. &yystacksize);
  1074. yyss = yyss1;
  1075. yyvs = yyvs1;
  1076. }
  1077. #else /* no yyoverflow */
  1078. # ifndef YYSTACK_RELOCATE
  1079. goto yyexhaustedlab;
  1080. # else
  1081. /* Extend the stack our own way. */
  1082. if (YYMAXDEPTH <= yystacksize)
  1083. goto yyexhaustedlab;
  1084. yystacksize *= 2;
  1085. if (YYMAXDEPTH < yystacksize)
  1086. yystacksize = YYMAXDEPTH;
  1087. {
  1088. yytype_int16 *yyss1 = yyss;
  1089. union yyalloc *yyptr =
  1090. (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
  1091. if (! yyptr)
  1092. goto yyexhaustedlab;
  1093. YYSTACK_RELOCATE (yyss_alloc, yyss);
  1094. YYSTACK_RELOCATE (yyvs_alloc, yyvs);
  1095. # undef YYSTACK_RELOCATE
  1096. if (yyss1 != yyssa)
  1097. YYSTACK_FREE (yyss1);
  1098. }
  1099. # endif
  1100. #endif /* no yyoverflow */
  1101. yyssp = yyss + yysize - 1;
  1102. yyvsp = yyvs + yysize - 1;
  1103. YYDPRINTF ((stderr, "Stack size increased to %lu\n",
  1104. (unsigned long int) yystacksize));
  1105. if (yyss + yystacksize - 1 <= yyssp)
  1106. YYABORT;
  1107. }
  1108. YYDPRINTF ((stderr, "Entering state %d\n", yystate));
  1109. if (yystate == YYFINAL)
  1110. YYACCEPT;
  1111. goto yybackup;
  1112. /*-----------.
  1113. | yybackup. |
  1114. `-----------*/
  1115. yybackup:
  1116. /* Do appropriate processing given the current state. Read a
  1117. lookahead token if we need one and don't already have one. */
  1118. /* First try to decide what to do without reference to lookahead token. */
  1119. yyn = yypact[yystate];
  1120. if (yyn == YYPACT_NINF)
  1121. goto yydefault;
  1122. /* Not known => get a lookahead token if don't already have one. */
  1123. /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
  1124. if (yychar == YYEMPTY)
  1125. {
  1126. YYDPRINTF ((stderr, "Reading a token: "));
  1127. yychar = YYLEX;
  1128. }
  1129. if (yychar <= YYEOF)
  1130. {
  1131. yychar = yytoken = YYEOF;
  1132. YYDPRINTF ((stderr, "Now at end of input.\n"));
  1133. }
  1134. else
  1135. {
  1136. yytoken = YYTRANSLATE (yychar);
  1137. YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
  1138. }
  1139. /* If the proper action on seeing token YYTOKEN is to reduce or to
  1140. detect an error, take that action. */
  1141. yyn += yytoken;
  1142. if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
  1143. goto yydefault;
  1144. yyn = yytable[yyn];
  1145. if (yyn <= 0)
  1146. {
  1147. if (yyn == 0 || yyn == YYTABLE_NINF)
  1148. goto yyerrlab;
  1149. yyn = -yyn;
  1150. goto yyreduce;
  1151. }
  1152. /* Count tokens shifted since error; after three, turn off error
  1153. status. */
  1154. if (yyerrstatus)
  1155. yyerrstatus--;
  1156. /* Shift the lookahead token. */
  1157. YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
  1158. /* Discard the shifted token. */
  1159. yychar = YYEMPTY;
  1160. yystate = yyn;
  1161. *++yyvsp = yylval;
  1162. goto yynewstate;
  1163. /*-----------------------------------------------------------.
  1164. | yydefault -- do the default action for the current state. |
  1165. `-----------------------------------------------------------*/
  1166. yydefault:
  1167. yyn = yydefact[yystate];
  1168. if (yyn == 0)
  1169. goto yyerrlab;
  1170. goto yyreduce;
  1171. /*-----------------------------.
  1172. | yyreduce -- Do a reduction. |
  1173. `-----------------------------*/
  1174. yyreduce:
  1175. /* yyn is the number of a rule to reduce with. */
  1176. yylen = yyr2[yyn];
  1177. /* If YYLEN is nonzero, implement the default value of the action:
  1178. `$$ = $1'.
  1179. Otherwise, the following line sets YYVAL to garbage.
  1180. This behavior is undocumented and Bison
  1181. users should not rely upon it. Assigning to YYVAL
  1182. unconditionally makes the parser a bit smaller, and it avoids a
  1183. GCC warning that YYVAL may be used uninitialized. */
  1184. yyval = yyvsp[1-yylen];
  1185. YY_REDUCE_PRINT (yyn);
  1186. switch (yyn)
  1187. {
  1188. case 2:
  1189. /* Line 1455 of yacc.c */
  1190. #line 87 "dtc-parser.y"
  1191. {
  1192. the_boot_info = build_boot_info((yyvsp[(3) - (4)].re), (yyvsp[(4) - (4)].node),
  1193. guess_boot_cpuid((yyvsp[(4) - (4)].node)));
  1194. ;}
  1195. break;
  1196. case 3:
  1197. /* Line 1455 of yacc.c */
  1198. #line 95 "dtc-parser.y"
  1199. {
  1200. (yyval.re) = NULL;
  1201. ;}
  1202. break;
  1203. case 4:
  1204. /* Line 1455 of yacc.c */
  1205. #line 99 "dtc-parser.y"
  1206. {
  1207. (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re));
  1208. ;}
  1209. break;
  1210. case 5:
  1211. /* Line 1455 of yacc.c */
  1212. #line 106 "dtc-parser.y"
  1213. {
  1214. (yyval.re) = build_reserve_entry((yyvsp[(2) - (4)].addr), (yyvsp[(3) - (4)].addr));
  1215. ;}
  1216. break;
  1217. case 6:
  1218. /* Line 1455 of yacc.c */
  1219. #line 110 "dtc-parser.y"
  1220. {
  1221. add_label(&(yyvsp[(2) - (2)].re)->labels, (yyvsp[(1) - (2)].labelref));
  1222. (yyval.re) = (yyvsp[(2) - (2)].re);
  1223. ;}
  1224. break;
  1225. case 7:
  1226. /* Line 1455 of yacc.c */
  1227. #line 118 "dtc-parser.y"
  1228. {
  1229. (yyval.addr) = eval_literal((yyvsp[(1) - (1)].literal), 0, 64);
  1230. ;}
  1231. break;
  1232. case 8:
  1233. /* Line 1455 of yacc.c */
  1234. #line 125 "dtc-parser.y"
  1235. {
  1236. (yyval.node) = name_node((yyvsp[(2) - (2)].node), "");
  1237. ;}
  1238. break;
  1239. case 9:
  1240. /* Line 1455 of yacc.c */
  1241. #line 129 "dtc-parser.y"
  1242. {
  1243. (yyval.node) = merge_nodes((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
  1244. ;}
  1245. break;
  1246. case 10:
  1247. /* Line 1455 of yacc.c */
  1248. #line 133 "dtc-parser.y"
  1249. {
  1250. struct node *target = get_node_by_ref((yyvsp[(1) - (3)].node), (yyvsp[(2) - (3)].labelref));
  1251. if (target)
  1252. merge_nodes(target, (yyvsp[(3) - (3)].node));
  1253. else
  1254. print_error("label or path, '%s', not found", (yyvsp[(2) - (3)].labelref));
  1255. (yyval.node) = (yyvsp[(1) - (3)].node);
  1256. ;}
  1257. break;
  1258. case 11:
  1259. /* Line 1455 of yacc.c */
  1260. #line 146 "dtc-parser.y"
  1261. {
  1262. (yyval.node) = build_node((yyvsp[(2) - (5)].proplist), (yyvsp[(3) - (5)].nodelist));
  1263. ;}
  1264. break;
  1265. case 12:
  1266. /* Line 1455 of yacc.c */
  1267. #line 153 "dtc-parser.y"
  1268. {
  1269. (yyval.proplist) = NULL;
  1270. ;}
  1271. break;
  1272. case 13:
  1273. /* Line 1455 of yacc.c */
  1274. #line 157 "dtc-parser.y"
  1275. {
  1276. (yyval.proplist) = chain_property((yyvsp[(2) - (2)].prop), (yyvsp[(1) - (2)].proplist));
  1277. ;}
  1278. break;
  1279. case 14:
  1280. /* Line 1455 of yacc.c */
  1281. #line 164 "dtc-parser.y"
  1282. {
  1283. (yyval.prop) = build_property((yyvsp[(1) - (4)].propnodename), (yyvsp[(3) - (4)].data));
  1284. ;}
  1285. break;
  1286. case 15:
  1287. /* Line 1455 of yacc.c */
  1288. #line 168 "dtc-parser.y"
  1289. {
  1290. (yyval.prop) = build_property((yyvsp[(1) - (2)].propnodename), empty_data);
  1291. ;}
  1292. break;
  1293. case 16:
  1294. /* Line 1455 of yacc.c */
  1295. #line 172 "dtc-parser.y"
  1296. {
  1297. add_label(&(yyvsp[(2) - (2)].prop)->labels, (yyvsp[(1) - (2)].labelref));
  1298. (yyval.prop) = (yyvsp[(2) - (2)].prop);
  1299. ;}
  1300. break;
  1301. case 17:
  1302. /* Line 1455 of yacc.c */
  1303. #line 180 "dtc-parser.y"
  1304. {
  1305. (yyval.data) = data_merge((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].data));
  1306. ;}
  1307. break;
  1308. case 18:
  1309. /* Line 1455 of yacc.c */
  1310. #line 184 "dtc-parser.y"
  1311. {
  1312. (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
  1313. ;}
  1314. break;
  1315. case 19:
  1316. /* Line 1455 of yacc.c */
  1317. #line 188 "dtc-parser.y"
  1318. {
  1319. (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
  1320. ;}
  1321. break;
  1322. case 20:
  1323. /* Line 1455 of yacc.c */
  1324. #line 192 "dtc-parser.y"
  1325. {
  1326. (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), REF_PATH, (yyvsp[(2) - (2)].labelref));
  1327. ;}
  1328. break;
  1329. case 21:
  1330. /* Line 1455 of yacc.c */
  1331. #line 196 "dtc-parser.y"
  1332. {
  1333. FILE *f = srcfile_relative_open((yyvsp[(4) - (9)].data).val, NULL);
  1334. struct data d;
  1335. if ((yyvsp[(6) - (9)].addr) != 0)
  1336. if (fseek(f, (yyvsp[(6) - (9)].addr), SEEK_SET) != 0)
  1337. print_error("Couldn't seek to offset %llu in \"%s\": %s",
  1338. (unsigned long long)(yyvsp[(6) - (9)].addr),
  1339. (yyvsp[(4) - (9)].data).val,
  1340. strerror(errno));
  1341. d = data_copy_file(f, (yyvsp[(8) - (9)].addr));
  1342. (yyval.data) = data_merge((yyvsp[(1) - (9)].data), d);
  1343. fclose(f);
  1344. ;}
  1345. break;
  1346. case 22:
  1347. /* Line 1455 of yacc.c */
  1348. #line 213 "dtc-parser.y"
  1349. {
  1350. FILE *f = srcfile_relative_open((yyvsp[(4) - (5)].data).val, NULL);
  1351. struct data d = empty_data;
  1352. d = data_copy_file(f, -1);
  1353. (yyval.data) = data_merge((yyvsp[(1) - (5)].data), d);
  1354. fclose(f);
  1355. ;}
  1356. break;
  1357. case 23:
  1358. /* Line 1455 of yacc.c */
  1359. #line 223 "dtc-parser.y"
  1360. {
  1361. (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
  1362. ;}
  1363. break;
  1364. case 24:
  1365. /* Line 1455 of yacc.c */
  1366. #line 230 "dtc-parser.y"
  1367. {
  1368. (yyval.data) = empty_data;
  1369. ;}
  1370. break;
  1371. case 25:
  1372. /* Line 1455 of yacc.c */
  1373. #line 234 "dtc-parser.y"
  1374. {
  1375. (yyval.data) = (yyvsp[(1) - (2)].data);
  1376. ;}
  1377. break;
  1378. case 26:
  1379. /* Line 1455 of yacc.c */
  1380. #line 238 "dtc-parser.y"
  1381. {
  1382. (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
  1383. ;}
  1384. break;
  1385. case 27:
  1386. /* Line 1455 of yacc.c */
  1387. #line 245 "dtc-parser.y"
  1388. {
  1389. (yyval.data) = empty_data;
  1390. ;}
  1391. break;
  1392. case 28:
  1393. /* Line 1455 of yacc.c */
  1394. #line 249 "dtc-parser.y"
  1395. {
  1396. (yyval.data) = data_append_cell((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].cell));
  1397. ;}
  1398. break;
  1399. case 29:
  1400. /* Line 1455 of yacc.c */
  1401. #line 253 "dtc-parser.y"
  1402. {
  1403. (yyval.data) = data_append_cell(data_add_marker((yyvsp[(1) - (2)].data), REF_PHANDLE,
  1404. (yyvsp[(2) - (2)].labelref)), -1);
  1405. ;}
  1406. break;
  1407. case 30:
  1408. /* Line 1455 of yacc.c */
  1409. #line 258 "dtc-parser.y"
  1410. {
  1411. (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
  1412. ;}
  1413. break;
  1414. case 31:
  1415. /* Line 1455 of yacc.c */
  1416. #line 265 "dtc-parser.y"
  1417. {
  1418. (yyval.cell) = eval_literal((yyvsp[(1) - (1)].literal), 0, 32);
  1419. ;}
  1420. break;
  1421. case 32:
  1422. /* Line 1455 of yacc.c */
  1423. #line 272 "dtc-parser.y"
  1424. {
  1425. (yyval.data) = empty_data;
  1426. ;}
  1427. break;
  1428. case 33:
  1429. /* Line 1455 of yacc.c */
  1430. #line 276 "dtc-parser.y"
  1431. {
  1432. (yyval.data) = data_append_byte((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].byte));
  1433. ;}
  1434. break;
  1435. case 34:
  1436. /* Line 1455 of yacc.c */
  1437. #line 280 "dtc-parser.y"
  1438. {
  1439. (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
  1440. ;}
  1441. break;
  1442. case 35:
  1443. /* Line 1455 of yacc.c */
  1444. #line 287 "dtc-parser.y"
  1445. {
  1446. (yyval.nodelist) = NULL;
  1447. ;}
  1448. break;
  1449. case 36:
  1450. /* Line 1455 of yacc.c */
  1451. #line 291 "dtc-parser.y"
  1452. {
  1453. (yyval.nodelist) = chain_node((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].nodelist));
  1454. ;}
  1455. break;
  1456. case 37:
  1457. /* Line 1455 of yacc.c */
  1458. #line 295 "dtc-parser.y"
  1459. {
  1460. print_error("syntax error: properties must precede subnodes");
  1461. YYERROR;
  1462. ;}
  1463. break;
  1464. case 38:
  1465. /* Line 1455 of yacc.c */
  1466. #line 303 "dtc-parser.y"
  1467. {
  1468. (yyval.node) = name_node((yyvsp[(2) - (2)].node), (yyvsp[(1) - (2)].propnodename));
  1469. ;}
  1470. break;
  1471. case 39:
  1472. /* Line 1455 of yacc.c */
  1473. #line 307 "dtc-parser.y"
  1474. {
  1475. add_label(&(yyvsp[(2) - (2)].node)->labels, (yyvsp[(1) - (2)].labelref));
  1476. (yyval.node) = (yyvsp[(2) - (2)].node);
  1477. ;}
  1478. break;
  1479. /* Line 1455 of yacc.c */
  1480. #line 1783 "dtc-parser.tab.c"
  1481. default: break;
  1482. }
  1483. YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
  1484. YYPOPSTACK (yylen);
  1485. yylen = 0;
  1486. YY_STACK_PRINT (yyss, yyssp);
  1487. *++yyvsp = yyval;
  1488. /* Now `shift' the result of the reduction. Determine what state
  1489. that goes to, based on the state we popped back to and the rule
  1490. number reduced by. */
  1491. yyn = yyr1[yyn];
  1492. yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  1493. if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1494. yystate = yytable[yystate];
  1495. else
  1496. yystate = yydefgoto[yyn - YYNTOKENS];
  1497. goto yynewstate;
  1498. /*------------------------------------.
  1499. | yyerrlab -- here on detecting error |
  1500. `------------------------------------*/
  1501. yyerrlab:
  1502. /* If not already recovering from an error, report this error. */
  1503. if (!yyerrstatus)
  1504. {
  1505. ++yynerrs;
  1506. #if ! YYERROR_VERBOSE
  1507. yyerror (YY_("syntax error"));
  1508. #else
  1509. {
  1510. YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
  1511. if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
  1512. {
  1513. YYSIZE_T yyalloc = 2 * yysize;
  1514. if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
  1515. yyalloc = YYSTACK_ALLOC_MAXIMUM;
  1516. if (yymsg != yymsgbuf)
  1517. YYSTACK_FREE (yymsg);
  1518. yymsg = (char *) YYSTACK_ALLOC (yyalloc);
  1519. if (yymsg)
  1520. yymsg_alloc = yyalloc;
  1521. else
  1522. {
  1523. yymsg = yymsgbuf;
  1524. yymsg_alloc = sizeof yymsgbuf;
  1525. }
  1526. }
  1527. if (0 < yysize && yysize <= yymsg_alloc)
  1528. {
  1529. (void) yysyntax_error (yymsg, yystate, yychar);
  1530. yyerror (yymsg);
  1531. }
  1532. else
  1533. {
  1534. yyerror (YY_("syntax error"));
  1535. if (yysize != 0)
  1536. goto yyexhaustedlab;
  1537. }
  1538. }
  1539. #endif
  1540. }
  1541. if (yyerrstatus == 3)
  1542. {
  1543. /* If just tried and failed to reuse lookahead token after an
  1544. error, discard it. */
  1545. if (yychar <= YYEOF)
  1546. {
  1547. /* Return failure if at end of input. */
  1548. if (yychar == YYEOF)
  1549. YYABORT;
  1550. }
  1551. else
  1552. {
  1553. yydestruct ("Error: discarding",
  1554. yytoken, &yylval);
  1555. yychar = YYEMPTY;
  1556. }
  1557. }
  1558. /* Else will try to reuse lookahead token after shifting the error
  1559. token. */
  1560. goto yyerrlab1;
  1561. /*---------------------------------------------------.
  1562. | yyerrorlab -- error raised explicitly by YYERROR. |
  1563. `---------------------------------------------------*/
  1564. yyerrorlab:
  1565. /* Pacify compilers like GCC when the user code never invokes
  1566. YYERROR and the label yyerrorlab therefore never appears in user
  1567. code. */
  1568. if (/*CONSTCOND*/ 0)
  1569. goto yyerrorlab;
  1570. /* Do not reclaim the symbols of the rule which action triggered
  1571. this YYERROR. */
  1572. YYPOPSTACK (yylen);
  1573. yylen = 0;
  1574. YY_STACK_PRINT (yyss, yyssp);
  1575. yystate = *yyssp;
  1576. goto yyerrlab1;
  1577. /*-------------------------------------------------------------.
  1578. | yyerrlab1 -- common code for both syntax error and YYERROR. |
  1579. `-------------------------------------------------------------*/
  1580. yyerrlab1:
  1581. yyerrstatus = 3; /* Each real token shifted decrements this. */
  1582. for (;;)
  1583. {
  1584. yyn = yypact[yystate];
  1585. if (yyn != YYPACT_NINF)
  1586. {
  1587. yyn += YYTERROR;
  1588. if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
  1589. {
  1590. yyn = yytable[yyn];
  1591. if (0 < yyn)
  1592. break;
  1593. }
  1594. }
  1595. /* Pop the current state because it cannot handle the error token. */
  1596. if (yyssp == yyss)
  1597. YYABORT;
  1598. yydestruct ("Error: popping",
  1599. yystos[yystate], yyvsp);
  1600. YYPOPSTACK (1);
  1601. yystate = *yyssp;
  1602. YY_STACK_PRINT (yyss, yyssp);
  1603. }
  1604. *++yyvsp = yylval;
  1605. /* Shift the error token. */
  1606. YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
  1607. yystate = yyn;
  1608. goto yynewstate;
  1609. /*-------------------------------------.
  1610. | yyacceptlab -- YYACCEPT comes here. |
  1611. `-------------------------------------*/
  1612. yyacceptlab:
  1613. yyresult = 0;
  1614. goto yyreturn;
  1615. /*-----------------------------------.
  1616. | yyabortlab -- YYABORT comes here. |
  1617. `-----------------------------------*/
  1618. yyabortlab:
  1619. yyresult = 1;
  1620. goto yyreturn;
  1621. #if !defined(yyoverflow) || YYERROR_VERBOSE
  1622. /*-------------------------------------------------.
  1623. | yyexhaustedlab -- memory exhaustion comes here. |
  1624. `-------------------------------------------------*/
  1625. yyexhaustedlab:
  1626. yyerror (YY_("memory exhausted"));
  1627. yyresult = 2;
  1628. /* Fall through. */
  1629. #endif
  1630. yyreturn:
  1631. if (yychar != YYEMPTY)
  1632. yydestruct ("Cleanup: discarding lookahead",
  1633. yytoken, &yylval);
  1634. /* Do not reclaim the symbols of the rule which action triggered
  1635. this YYABORT or YYACCEPT. */
  1636. YYPOPSTACK (yylen);
  1637. YY_STACK_PRINT (yyss, yyssp);
  1638. while (yyssp != yyss)
  1639. {
  1640. yydestruct ("Cleanup: popping",
  1641. yystos[*yyssp], yyvsp);
  1642. YYPOPSTACK (1);
  1643. }
  1644. #ifndef yyoverflow
  1645. if (yyss != yyssa)
  1646. YYSTACK_FREE (yyss);
  1647. #endif
  1648. #if YYERROR_VERBOSE
  1649. if (yymsg != yymsgbuf)
  1650. YYSTACK_FREE (yymsg);
  1651. #endif
  1652. /* Make sure YYID is used. */
  1653. return YYID (yyresult);
  1654. }
  1655. /* Line 1675 of yacc.c */
  1656. #line 313 "dtc-parser.y"
  1657. void print_error(char const *fmt, ...)
  1658. {
  1659. va_list va;
  1660. va_start(va, fmt);
  1661. srcpos_verror(&yylloc, fmt, va);
  1662. va_end(va);
  1663. treesource_error = 1;
  1664. }
  1665. void yyerror(char const *s) {
  1666. print_error("%s", s);
  1667. }
  1668. static unsigned long long eval_literal(const char *s, int base, int bits)
  1669. {
  1670. unsigned long long val;
  1671. char *e;
  1672. errno = 0;
  1673. val = strtoull(s, &e, base);
  1674. if (*e)
  1675. print_error("bad characters in literal");
  1676. else if ((errno == ERANGE)
  1677. || ((bits < 64) && (val >= (1ULL << bits))))
  1678. print_error("literal out of range");
  1679. else if (errno != 0)
  1680. print_error("bad literal");
  1681. return val;
  1682. }