parse.c_shipped 62 KB

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