parse.tab.c_shipped 73 KB

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