parse.tab.c_shipped 74 KB

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