Year 2 compilers coureswork

C.tab.c 55KB

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