dtc-parser.tab.c_shipped 50 KB

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