dtc-parser.tab.c_shipped 54 KB

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