Year 2 compilers coureswork

C.tab.c 71KB

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