The Sol Programming Language!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

parser.tab.c 101KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855
  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 2
  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 "parser.y" /* yacc.c:339 */
  47. #include "sol.h"
  48. #include "ast.h"
  49. #include <string.h>
  50. #define YYSTYPE void *
  51. #line 76 "parser.tab.c" /* yacc.c:339 */
  52. # ifndef YY_NULLPTR
  53. # if defined __cplusplus && 201103L <= __cplusplus
  54. # define YY_NULLPTR nullptr
  55. # else
  56. # define YY_NULLPTR 0
  57. # endif
  58. # endif
  59. /* Enabling verbose error messages. */
  60. #ifdef YYERROR_VERBOSE
  61. # undef YYERROR_VERBOSE
  62. # define YYERROR_VERBOSE 1
  63. #else
  64. # define YYERROR_VERBOSE 0
  65. #endif
  66. /* In a future release of Bison, this section will be replaced
  67. by #include "parser.tab.h". */
  68. #ifndef YY_YY_PARSER_TAB_H_INCLUDED
  69. # define YY_YY_PARSER_TAB_H_INCLUDED
  70. /* Debug traces. */
  71. #ifndef YYDEBUG
  72. # define YYDEBUG 1
  73. #endif
  74. #if YYDEBUG
  75. extern int yydebug;
  76. #endif
  77. /* Token type. */
  78. #ifndef YYTOKENTYPE
  79. # define YYTOKENTYPE
  80. enum yytokentype
  81. {
  82. IF = 258,
  83. THEN = 259,
  84. ELSE = 260,
  85. WHILE = 261,
  86. FOR = 262,
  87. IN = 263,
  88. DO = 264,
  89. FUNC = 265,
  90. LAMBDA = 266,
  91. RETURN = 267,
  92. BREAK = 268,
  93. CONTINUE = 269,
  94. END = 270,
  95. NONE = 271,
  96. IDENT = 272,
  97. INT = 273,
  98. FLOAT = 274,
  99. STRING = 275,
  100. PLUS = 276,
  101. MINUS = 277,
  102. STAR = 278,
  103. SLASH = 279,
  104. PERCENT = 280,
  105. DSTAR = 281,
  106. BAND = 282,
  107. BOR = 283,
  108. BXOR = 284,
  109. BNOT = 285,
  110. LAND = 286,
  111. LOR = 287,
  112. LNOT = 288,
  113. ASSIGN = 289,
  114. ASSIGNPLUS = 290,
  115. ASSIGNMINUS = 291,
  116. ASSIGNSTAR = 292,
  117. ASSIGNSLASH = 293,
  118. ASSIGNDSTAR = 294,
  119. ASSIGNBAND = 295,
  120. ASSIGNBOR = 296,
  121. ASSIGNBXOR = 297,
  122. EQUAL = 298,
  123. NEQUAL = 299,
  124. LESS = 300,
  125. GREATER = 301,
  126. LESSEQ = 302,
  127. GREATEREQ = 303,
  128. RSHIFT = 304,
  129. LSHIFT = 305,
  130. LBRACE = 306,
  131. RBRACE = 307,
  132. LPAREN = 308,
  133. RPAREN = 309,
  134. LBRACKET = 310,
  135. RBRACKET = 311,
  136. DOT = 312,
  137. COLON = 313,
  138. SEMICOLON = 314,
  139. COMMA = 315,
  140. POUND = 316,
  141. TBANG = 317
  142. };
  143. #endif
  144. /* Value type. */
  145. #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
  146. typedef int YYSTYPE;
  147. # define YYSTYPE_IS_TRIVIAL 1
  148. # define YYSTYPE_IS_DECLARED 1
  149. #endif
  150. /* Location type. */
  151. #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
  152. typedef struct YYLTYPE YYLTYPE;
  153. struct YYLTYPE
  154. {
  155. int first_line;
  156. int first_column;
  157. int last_line;
  158. int last_column;
  159. };
  160. # define YYLTYPE_IS_DECLARED 1
  161. # define YYLTYPE_IS_TRIVIAL 1
  162. #endif
  163. int yyparse (stmt_node **program);
  164. #endif /* !YY_YY_PARSER_TAB_H_INCLUDED */
  165. /* Copy the second part of user declarations. */
  166. #line 203 "parser.tab.c" /* yacc.c:358 */
  167. #ifdef short
  168. # undef short
  169. #endif
  170. #ifdef YYTYPE_UINT8
  171. typedef YYTYPE_UINT8 yytype_uint8;
  172. #else
  173. typedef unsigned char yytype_uint8;
  174. #endif
  175. #ifdef YYTYPE_INT8
  176. typedef YYTYPE_INT8 yytype_int8;
  177. #else
  178. typedef signed char yytype_int8;
  179. #endif
  180. #ifdef YYTYPE_UINT16
  181. typedef YYTYPE_UINT16 yytype_uint16;
  182. #else
  183. typedef unsigned short int yytype_uint16;
  184. #endif
  185. #ifdef YYTYPE_INT16
  186. typedef YYTYPE_INT16 yytype_int16;
  187. #else
  188. typedef short int yytype_int16;
  189. #endif
  190. #ifndef YYSIZE_T
  191. # ifdef __SIZE_TYPE__
  192. # define YYSIZE_T __SIZE_TYPE__
  193. # elif defined size_t
  194. # define YYSIZE_T size_t
  195. # elif ! defined YYSIZE_T
  196. # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
  197. # define YYSIZE_T size_t
  198. # else
  199. # define YYSIZE_T unsigned int
  200. # endif
  201. #endif
  202. #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
  203. #ifndef YY_
  204. # if defined YYENABLE_NLS && YYENABLE_NLS
  205. # if ENABLE_NLS
  206. # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
  207. # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
  208. # endif
  209. # endif
  210. # ifndef YY_
  211. # define YY_(Msgid) Msgid
  212. # endif
  213. #endif
  214. #ifndef YY_ATTRIBUTE
  215. # if (defined __GNUC__ \
  216. && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
  217. || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
  218. # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
  219. # else
  220. # define YY_ATTRIBUTE(Spec) /* empty */
  221. # endif
  222. #endif
  223. #ifndef YY_ATTRIBUTE_PURE
  224. # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
  225. #endif
  226. #ifndef YY_ATTRIBUTE_UNUSED
  227. # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
  228. #endif
  229. #if !defined _Noreturn \
  230. && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
  231. # if defined _MSC_VER && 1200 <= _MSC_VER
  232. # define _Noreturn __declspec (noreturn)
  233. # else
  234. # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
  235. # endif
  236. #endif
  237. /* Suppress unused-variable warnings by "using" E. */
  238. #if ! defined lint || defined __GNUC__
  239. # define YYUSE(E) ((void) (E))
  240. #else
  241. # define YYUSE(E) /* empty */
  242. #endif
  243. #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
  244. /* Suppress an incorrect diagnostic about yylval being uninitialized. */
  245. # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
  246. _Pragma ("GCC diagnostic push") \
  247. _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
  248. _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
  249. # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
  250. _Pragma ("GCC diagnostic pop")
  251. #else
  252. # define YY_INITIAL_VALUE(Value) Value
  253. #endif
  254. #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  255. # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  256. # define YY_IGNORE_MAYBE_UNINITIALIZED_END
  257. #endif
  258. #ifndef YY_INITIAL_VALUE
  259. # define YY_INITIAL_VALUE(Value) /* Nothing. */
  260. #endif
  261. #if ! defined yyoverflow || YYERROR_VERBOSE
  262. /* The parser invokes alloca or malloc; define the necessary symbols. */
  263. # ifdef YYSTACK_USE_ALLOCA
  264. # if YYSTACK_USE_ALLOCA
  265. # ifdef __GNUC__
  266. # define YYSTACK_ALLOC __builtin_alloca
  267. # elif defined __BUILTIN_VA_ARG_INCR
  268. # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
  269. # elif defined _AIX
  270. # define YYSTACK_ALLOC __alloca
  271. # elif defined _MSC_VER
  272. # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
  273. # define alloca _alloca
  274. # else
  275. # define YYSTACK_ALLOC alloca
  276. # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
  277. # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  278. /* Use EXIT_SUCCESS as a witness for stdlib.h. */
  279. # ifndef EXIT_SUCCESS
  280. # define EXIT_SUCCESS 0
  281. # endif
  282. # endif
  283. # endif
  284. # endif
  285. # endif
  286. # ifdef YYSTACK_ALLOC
  287. /* Pacify GCC's 'empty if-body' warning. */
  288. # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
  289. # ifndef YYSTACK_ALLOC_MAXIMUM
  290. /* The OS might guarantee only one guard page at the bottom of the stack,
  291. and a page size can be as small as 4096 bytes. So we cannot safely
  292. invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
  293. to allow for a few compiler-allocated temporary stack slots. */
  294. # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
  295. # endif
  296. # else
  297. # define YYSTACK_ALLOC YYMALLOC
  298. # define YYSTACK_FREE YYFREE
  299. # ifndef YYSTACK_ALLOC_MAXIMUM
  300. # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
  301. # endif
  302. # if (defined __cplusplus && ! defined EXIT_SUCCESS \
  303. && ! ((defined YYMALLOC || defined malloc) \
  304. && (defined YYFREE || defined free)))
  305. # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  306. # ifndef EXIT_SUCCESS
  307. # define EXIT_SUCCESS 0
  308. # endif
  309. # endif
  310. # ifndef YYMALLOC
  311. # define YYMALLOC malloc
  312. # if ! defined malloc && ! defined EXIT_SUCCESS
  313. void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
  314. # endif
  315. # endif
  316. # ifndef YYFREE
  317. # define YYFREE free
  318. # if ! defined free && ! defined EXIT_SUCCESS
  319. void free (void *); /* INFRINGES ON USER NAME SPACE */
  320. # endif
  321. # endif
  322. # endif
  323. #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
  324. #if (! defined yyoverflow \
  325. && (! defined __cplusplus \
  326. || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
  327. && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
  328. /* A type that is properly aligned for any stack member. */
  329. union yyalloc
  330. {
  331. yytype_int16 yyss_alloc;
  332. YYSTYPE yyvs_alloc;
  333. YYLTYPE yyls_alloc;
  334. };
  335. /* The size of the maximum gap between one aligned stack and the next. */
  336. # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
  337. /* The size of an array large to enough to hold all stacks, each with
  338. N elements. */
  339. # define YYSTACK_BYTES(N) \
  340. ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
  341. + 2 * YYSTACK_GAP_MAXIMUM)
  342. # define YYCOPY_NEEDED 1
  343. /* Relocate STACK from its old location to the new one. The
  344. local variables YYSIZE and YYSTACKSIZE give the old and new number of
  345. elements in the stack, and YYPTR gives the new location of the
  346. stack. Advance YYPTR to a properly aligned location for the next
  347. stack. */
  348. # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
  349. do \
  350. { \
  351. YYSIZE_T yynewbytes; \
  352. YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
  353. Stack = &yyptr->Stack_alloc; \
  354. yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
  355. yyptr += yynewbytes / sizeof (*yyptr); \
  356. } \
  357. while (0)
  358. #endif
  359. #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
  360. /* Copy COUNT objects from SRC to DST. The source and destination do
  361. not overlap. */
  362. # ifndef YYCOPY
  363. # if defined __GNUC__ && 1 < __GNUC__
  364. # define YYCOPY(Dst, Src, Count) \
  365. __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
  366. # else
  367. # define YYCOPY(Dst, Src, Count) \
  368. do \
  369. { \
  370. YYSIZE_T yyi; \
  371. for (yyi = 0; yyi < (Count); yyi++) \
  372. (Dst)[yyi] = (Src)[yyi]; \
  373. } \
  374. while (0)
  375. # endif
  376. # endif
  377. #endif /* !YYCOPY_NEEDED */
  378. /* YYFINAL -- State number of the termination state. */
  379. #define YYFINAL 3
  380. /* YYLAST -- Last index in YYTABLE. */
  381. #define YYLAST 926
  382. /* YYNTOKENS -- Number of terminals. */
  383. #define YYNTOKENS 63
  384. /* YYNNTS -- Number of nonterminals. */
  385. #define YYNNTS 29
  386. /* YYNRULES -- Number of rules. */
  387. #define YYNRULES 108
  388. /* YYNSTATES -- Number of states. */
  389. #define YYNSTATES 200
  390. /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
  391. by yylex, with out-of-bounds checking. */
  392. #define YYUNDEFTOK 2
  393. #define YYMAXUTOK 317
  394. #define YYTRANSLATE(YYX) \
  395. ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
  396. /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
  397. as returned by yylex, without out-of-bounds checking. */
  398. static const yytype_uint8 yytranslate[] =
  399. {
  400. 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  401. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  402. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  403. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  404. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  405. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  406. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  407. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  408. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  409. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  410. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  411. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  412. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  413. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  414. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  415. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  416. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  417. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  418. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  419. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  420. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  421. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  422. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  423. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  424. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  425. 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
  426. 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
  427. 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
  428. 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
  429. 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
  430. 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
  431. 55, 56, 57, 58, 59, 60, 61, 62
  432. };
  433. #if YYDEBUG
  434. /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
  435. static const yytype_uint16 yyrline[] =
  436. {
  437. 0, 34, 34, 38, 49, 59, 60, 61, 62, 63,
  438. 64, 65, 66, 70, 74, 82, 90, 97, 105, 109,
  439. 110, 117, 124, 131, 138, 145, 152, 159, 166, 179,
  440. 192, 205, 218, 231, 244, 257, 270, 283, 287, 288,
  441. 289, 293, 294, 298, 299, 300, 301, 302, 303, 304,
  442. 308, 309, 310, 314, 315, 316, 317, 321, 322, 326,
  443. 327, 332, 333, 334, 335, 336, 337, 341, 342, 346,
  444. 347, 351, 352, 369, 373, 381, 389, 400, 404, 405,
  445. 416, 420, 421, 435, 436, 440, 441, 442, 443, 444,
  446. 445, 449, 450, 451, 455, 459, 460, 465, 466, 478,
  447. 479, 484, 485, 497, 498, 503, 504, 516, 521
  448. };
  449. #endif
  450. #if YYDEBUG || YYERROR_VERBOSE || 0
  451. /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
  452. First, the terminals, then, starting at YYNTOKENS, nonterminals. */
  453. static const char *const yytname[] =
  454. {
  455. "$end", "error", "$undefined", "IF", "THEN", "ELSE", "WHILE", "FOR",
  456. "IN", "DO", "FUNC", "LAMBDA", "RETURN", "BREAK", "CONTINUE", "END",
  457. "NONE", "IDENT", "INT", "FLOAT", "STRING", "PLUS", "MINUS", "STAR",
  458. "SLASH", "PERCENT", "DSTAR", "BAND", "BOR", "BXOR", "BNOT", "LAND",
  459. "LOR", "LNOT", "ASSIGN", "ASSIGNPLUS", "ASSIGNMINUS", "ASSIGNSTAR",
  460. "ASSIGNSLASH", "ASSIGNDSTAR", "ASSIGNBAND", "ASSIGNBOR", "ASSIGNBXOR",
  461. "EQUAL", "NEQUAL", "LESS", "GREATER", "LESSEQ", "GREATEREQ", "RSHIFT",
  462. "LSHIFT", "LBRACE", "RBRACE", "LPAREN", "RPAREN", "LBRACKET", "RBRACKET",
  463. "DOT", "COLON", "SEMICOLON", "COMMA", "POUND", "TBANG", "$accept",
  464. "program", "stmt_list", "stmt", "expr", "control_expr", "assign_expr",
  465. "logic_expr", "ulogic_expr", "rel_expr", "term_expr", "factor_expr",
  466. "power_expr", "tbang_expr", "binary_expr", "ubinary_expr", "ulen_expr",
  467. "call_expr", "funcdecl_expr", "index_expr", "ex_index_expr", "ref_expr",
  468. "lit_expr", "gen_expr", "paren_expr", "expr_list", "ident_list",
  469. "assoc_list", "assoc_item", YY_NULLPTR
  470. };
  471. #endif
  472. # ifdef YYPRINT
  473. /* YYTOKNUM[NUM] -- (External) token number corresponding to the
  474. (internal) symbol number NUM (which must be that of a token). */
  475. static const yytype_uint16 yytoknum[] =
  476. {
  477. 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
  478. 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
  479. 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
  480. 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
  481. 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
  482. 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
  483. 315, 316, 317
  484. };
  485. # endif
  486. #define YYPACT_NINF -106
  487. #define yypact_value_is_default(Yystate) \
  488. (!!((Yystate) == (-106)))
  489. #define YYTABLE_NINF -83
  490. #define yytable_value_is_error(Yytable_value) \
  491. 0
  492. /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
  493. STATE-NUM. */
  494. static const yytype_int16 yypact[] =
  495. {
  496. -106, 16, 453, -106, 674, 674, 15, 20, -14, 674,
  497. 674, 674, -106, -11, -106, -106, -106, 28, 674, 674,
  498. -5, 674, 674, 674, 27, 41, -106, -106, 46, -106,
  499. -106, 190, 98, -106, 48, 120, -106, -106, -40, -106,
  500. -106, 78, -106, -106, -106, -106, 7, 8, 82, 40,
  501. 91, 91, 41, 41, 41, 674, 674, 674, 674, 674,
  502. 674, 674, 674, 674, -106, 41, 715, -17, 94, 674,
  503. 32, -106, -21, 41, 506, 757, -106, 674, 115, 674,
  504. 674, 674, 674, 674, 674, 674, 674, 674, 674, 674,
  505. 674, 674, 674, 674, 674, 674, 674, 674, 674, 674,
  506. 116, 674, 674, 674, 674, 674, 674, 674, 674, 674,
  507. -106, -106, 674, 91, -106, 31, 34, 41, 41, 41,
  508. 41, 41, 41, 41, 41, 41, 674, 95, -106, -106,
  509. -106, -106, -106, -106, 41, 158, 189, -106, -106, 98,
  510. 98, -10, -10, -10, -10, -10, -10, -106, -106, -106,
  511. 869, 799, 799, 799, 799, 799, 841, 562, 92, 41,
  512. 41, 41, 41, 41, 41, 41, 41, 41, 124, 188,
  513. 26, 35, -106, -106, -106, 674, 41, 119, 242, -106,
  514. 674, -106, -106, -106, -106, -106, 241, 54, 674, 618,
  515. 294, 347, 400, -106, -106, 41, -106, -106, -106, -106
  516. };
  517. /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
  518. Performed when YYTABLE does not specify something else to do. Zero
  519. means the default is an error. */
  520. static const yytype_uint8 yydefact[] =
  521. {
  522. 4, 0, 2, 1, 0, 0, 0, 0, 0, 7,
  523. 8, 10, 89, 83, 85, 87, 88, 0, 0, 0,
  524. 103, 0, 95, 0, 3, 5, 13, 18, 37, 40,
  525. 42, 49, 52, 56, 58, 60, 66, 68, 70, 73,
  526. 77, 0, 80, 84, 90, 93, 0, 0, 0, 0,
  527. 99, 99, 6, 9, 11, 0, 0, 0, 0, 0,
  528. 0, 0, 0, 0, 86, 0, 67, 41, 0, 0,
  529. 0, 104, 0, 96, 0, 69, 12, 0, 0, 0,
  530. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  531. 0, 0, 0, 0, 0, 0, 0, 0, 0, 95,
  532. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  533. 4, 4, 0, 99, 100, 0, 0, 19, 20, 21,
  534. 22, 23, 24, 25, 26, 27, 0, 0, 92, 105,
  535. 106, 94, 91, 97, 98, 0, 79, 38, 39, 50,
  536. 51, 43, 44, 45, 46, 47, 48, 53, 54, 55,
  537. 57, 61, 62, 63, 65, 64, 59, 0, 0, 28,
  538. 29, 30, 31, 32, 33, 34, 35, 36, 0, 0,
  539. 0, 0, 102, 4, 101, 0, 108, 0, 78, 71,
  540. 95, 4, 14, 16, 4, 4, 0, 0, 0, 0,
  541. 0, 0, 0, 75, 76, 107, 72, 15, 17, 74
  542. };
  543. /* YYPGOTO[NTERM-NUM]. */
  544. static const yytype_int16 yypgoto[] =
  545. {
  546. -106, -106, -105, -106, -2, -106, -106, -106, -9, 75,
  547. -106, 44, -48, 58, 171, 146, 142, -106, -106, -106,
  548. -106, -106, -106, -106, -106, -98, -47, -106, 101
  549. };
  550. /* YYDEFGOTO[NTERM-NUM]. */
  551. static const yytype_int8 yydefgoto[] =
  552. {
  553. -1, 1, 2, 24, 65, 26, 27, 28, 29, 30,
  554. 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
  555. 41, 42, 43, 44, 45, 74, 115, 70, 71
  556. };
  557. /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
  558. positive, shift that token. If negative, reduce the rule whose
  559. number is the opposite. If YYTABLE_NINF, syntax error. */
  560. static const yytype_int16 yytable[] =
  561. {
  562. 25, 157, 46, 47, 116, 168, 169, 52, 53, 54,
  563. 67, 110, 68, 99, -40, -40, 3, 111, 100, 72,
  564. 73, -42, -42, 55, 56, 57, 58, 59, 60, 61,
  565. 62, 63, 48, 131, 77, 184, 78, 49, -40, 51,
  566. -40, 147, 148, 149, 150, -42, 64, -42, 172, 68,
  567. 69, 172, 172, 117, 118, 119, 120, 121, 122, 123,
  568. 124, 125, 77, 77, 78, 78, 171, 127, 186, 194,
  569. 137, 138, 134, 50, 92, 135, 190, 79, 80, 191,
  570. 192, 77, 189, 78, 128, 173, 76, 69, 175, 185,
  571. 112, 174, 129, 113, 174, 174, 77, 73, 78, 159,
  572. 160, 161, 162, 163, 164, 165, 166, 167, 114, 77,
  573. 170, 78, 101, 102, 103, 104, 105, 106, 107, 108,
  574. 109, 89, 90, 91, 176, 139, 140, 4, 126, 181,
  575. 5, 6, 136, 158, 7, 8, 9, 10, 11, 182,
  576. 12, 13, 14, 15, 16, 180, 17, 93, 94, 95,
  577. 77, 177, 78, 188, 18, 134, 156, 19, 141, 142,
  578. 143, 144, 145, 146, 66, 75, 25, 25, 0, 96,
  579. 97, 130, 0, 187, 0, 20, 0, 21, 73, 22,
  580. 0, 0, 98, 0, 25, 23, 195, 134, 25, 25,
  581. 25, 4, 0, 0, 5, 6, 0, 0, 7, 8,
  582. 9, 10, 11, 183, 12, 13, 14, 15, 16, 0,
  583. 17, 81, 82, 77, 178, 78, 0, 0, 18, 0,
  584. 0, 19, 0, -82, -82, -82, -82, -82, -82, -82,
  585. -82, -82, 0, 83, 84, 85, 86, 87, 88, 20,
  586. 0, 21, 0, 22, 4, 0, 0, 5, 6, 23,
  587. 0, 7, 8, 9, 10, 11, 193, 12, 13, 14,
  588. 15, 16, 0, 17, 151, 152, 153, 154, 155, 0,
  589. 0, 18, 0, 0, 19, 0, -81, -81, -81, -81,
  590. -81, -81, -81, -81, -81, 0, 0, 0, 0, 0,
  591. 0, 0, 20, 0, 21, 0, 22, 4, 0, 0,
  592. 5, 6, 23, 0, 7, 8, 9, 10, 11, 197,
  593. 12, 13, 14, 15, 16, 0, 17, 0, 0, 0,
  594. 0, 0, 0, 0, 18, 0, 0, 19, 0, 0,
  595. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  596. 0, 0, 0, 0, 0, 20, 0, 21, 0, 22,
  597. 4, 0, 0, 5, 6, 23, 0, 7, 8, 9,
  598. 10, 11, 198, 12, 13, 14, 15, 16, 0, 17,
  599. 0, 0, 0, 0, 0, 0, 0, 18, 0, 0,
  600. 19, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  601. 0, 0, 0, 0, 0, 0, 0, 0, 20, 0,
  602. 21, 0, 22, 4, 0, 0, 5, 6, 23, 0,
  603. 7, 8, 9, 10, 11, 199, 12, 13, 14, 15,
  604. 16, 0, 17, 0, 0, 0, 0, 0, 0, 0,
  605. 18, 0, 0, 19, 0, 0, 0, 0, 0, 0,
  606. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  607. 0, 20, 0, 21, 0, 22, 4, 0, 0, 5,
  608. 6, 23, 0, 7, 8, 9, 10, 11, 0, 12,
  609. 13, 14, 15, 16, 0, 17, 0, 0, 0, 0,
  610. 0, 0, 0, 18, 0, 0, 19, 0, 0, 0,
  611. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  612. 0, 0, 0, 0, 20, 0, 21, 0, 22, 4,
  613. 0, 0, 5, 6, 23, 0, 7, 8, 0, 0,
  614. 0, 0, 12, 13, 14, 15, 16, 0, 17, 0,
  615. 0, 0, 0, 0, 0, 0, 18, 0, 0, 19,
  616. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  617. 0, 0, 0, 0, 0, 0, 0, 20, 0, 21,
  618. 0, 22, 132, 0, 0, 4, 133, 23, 5, 6,
  619. 0, 0, 7, 8, 0, 0, 0, 0, 12, 13,
  620. 14, 15, 16, 0, 17, 0, 0, 0, 0, 0,
  621. 0, 0, 18, 0, 0, 19, 0, 0, 0, 0,
  622. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  623. 0, 0, 0, 20, 0, 21, 179, 22, 0, 0,
  624. 0, 4, 133, 23, 5, 6, 0, 0, 7, 8,
  625. 0, 0, 0, 0, 12, 13, 14, 15, 16, 0,
  626. 17, 0, 0, 0, 0, 0, 0, 0, 18, 0,
  627. 0, 19, 0, 0, 0, 0, 0, 0, 0, 0,
  628. 0, 0, 0, 0, 0, 0, 0, 0, 0, 20,
  629. 0, 21, 196, 22, 0, 0, 0, 4, 133, 23,
  630. 5, 6, 0, 0, 7, 8, 0, 0, 0, 0,
  631. 12, 13, 14, 15, 16, 0, 17, 0, 0, 0,
  632. 0, 0, 0, 0, 18, 0, 0, 19, 0, 0,
  633. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  634. 0, 0, 0, 0, 0, 20, 0, 21, 0, 22,
  635. 0, 0, 0, 0, 0, 23, -66, -66, -66, -66,
  636. -66, -66, -66, -66, -66, 0, -66, -66, 0, 0,
  637. 0, 0, 0, 0, 0, 0, 0, 0, -66, -66,
  638. -66, -66, -66, -66, -66, -66, 0, 0, 0, 0,
  639. -66, 0, -66, 0, 0, 0, 0, -66, -68, -68,
  640. -68, -68, -68, -68, -68, -68, -68, 0, -68, -68,
  641. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  642. -68, -68, -68, -68, -68, -68, -68, -68, 0, 0,
  643. 0, 0, -68, 0, -68, 0, 0, 0, 0, -68,
  644. -60, -60, -60, -60, -60, -60, 93, 94, 95, 0,
  645. -60, -60, 0, 0, 0, 0, 0, 0, 0, 0,
  646. 0, 0, -60, -60, -60, -60, -60, -60, 96, 97,
  647. 0, 0, 0, 0, -60, 0, -60, 0, 0, 0,
  648. 0, 98, -58, -58, -58, -58, -58, 92, 0, 0,
  649. 0, 0, -58, -58, 0, 0, 0, 0, 0, 0,
  650. 0, 0, 0, 0, -58, -58, -58, -58, -58, -58,
  651. -56, -56, -56, -56, -56, 0, -58, 0, -58, 0,
  652. -56, -56, 0, 0, 0, 0, 0, 0, 0, 0,
  653. 0, 0, -56, -56, -56, -56, -56, -56, 0, 0,
  654. 0, 0, 0, 0, -56, 0, -56
  655. };
  656. static const yytype_int16 yycheck[] =
  657. {
  658. 2, 99, 4, 5, 51, 110, 111, 9, 10, 11,
  659. 19, 4, 17, 53, 31, 32, 0, 9, 58, 21,
  660. 22, 31, 32, 34, 35, 36, 37, 38, 39, 40,
  661. 41, 42, 17, 54, 55, 9, 57, 17, 55, 53,
  662. 57, 89, 90, 91, 92, 55, 18, 57, 17, 17,
  663. 55, 17, 17, 55, 56, 57, 58, 59, 60, 61,
  664. 62, 63, 55, 55, 57, 57, 113, 69, 173, 15,
  665. 79, 80, 74, 53, 26, 77, 181, 31, 32, 184,
  666. 185, 55, 180, 57, 52, 54, 59, 55, 54, 54,
  667. 8, 60, 60, 53, 60, 60, 55, 99, 57, 101,
  668. 102, 103, 104, 105, 106, 107, 108, 109, 17, 55,
  669. 112, 57, 34, 35, 36, 37, 38, 39, 40, 41,
  670. 42, 23, 24, 25, 126, 81, 82, 3, 34, 5,
  671. 6, 7, 17, 17, 10, 11, 12, 13, 14, 15,
  672. 16, 17, 18, 19, 20, 53, 22, 27, 28, 29,
  673. 55, 56, 57, 34, 30, 157, 98, 33, 83, 84,
  674. 85, 86, 87, 88, 18, 23, 168, 169, -1, 49,
  675. 50, 70, -1, 175, -1, 51, -1, 53, 180, 55,
  676. -1, -1, 62, -1, 186, 61, 188, 189, 190, 191,
  677. 192, 3, -1, -1, 6, 7, -1, -1, 10, 11,
  678. 12, 13, 14, 15, 16, 17, 18, 19, 20, -1,
  679. 22, 21, 22, 55, 56, 57, -1, -1, 30, -1,
  680. -1, 33, -1, 34, 35, 36, 37, 38, 39, 40,
  681. 41, 42, -1, 43, 44, 45, 46, 47, 48, 51,
  682. -1, 53, -1, 55, 3, -1, -1, 6, 7, 61,
  683. -1, 10, 11, 12, 13, 14, 15, 16, 17, 18,
  684. 19, 20, -1, 22, 93, 94, 95, 96, 97, -1,
  685. -1, 30, -1, -1, 33, -1, 34, 35, 36, 37,
  686. 38, 39, 40, 41, 42, -1, -1, -1, -1, -1,
  687. -1, -1, 51, -1, 53, -1, 55, 3, -1, -1,
  688. 6, 7, 61, -1, 10, 11, 12, 13, 14, 15,
  689. 16, 17, 18, 19, 20, -1, 22, -1, -1, -1,
  690. -1, -1, -1, -1, 30, -1, -1, 33, -1, -1,
  691. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  692. -1, -1, -1, -1, -1, 51, -1, 53, -1, 55,
  693. 3, -1, -1, 6, 7, 61, -1, 10, 11, 12,
  694. 13, 14, 15, 16, 17, 18, 19, 20, -1, 22,
  695. -1, -1, -1, -1, -1, -1, -1, 30, -1, -1,
  696. 33, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  697. -1, -1, -1, -1, -1, -1, -1, -1, 51, -1,
  698. 53, -1, 55, 3, -1, -1, 6, 7, 61, -1,
  699. 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
  700. 20, -1, 22, -1, -1, -1, -1, -1, -1, -1,
  701. 30, -1, -1, 33, -1, -1, -1, -1, -1, -1,
  702. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  703. -1, 51, -1, 53, -1, 55, 3, -1, -1, 6,
  704. 7, 61, -1, 10, 11, 12, 13, 14, -1, 16,
  705. 17, 18, 19, 20, -1, 22, -1, -1, -1, -1,
  706. -1, -1, -1, 30, -1, -1, 33, -1, -1, -1,
  707. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  708. -1, -1, -1, -1, 51, -1, 53, -1, 55, 3,
  709. -1, -1, 6, 7, 61, -1, 10, 11, -1, -1,
  710. -1, -1, 16, 17, 18, 19, 20, -1, 22, -1,
  711. -1, -1, -1, -1, -1, -1, 30, -1, -1, 33,
  712. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  713. -1, -1, -1, -1, -1, -1, -1, 51, -1, 53,
  714. -1, 55, 56, -1, -1, 3, 60, 61, 6, 7,
  715. -1, -1, 10, 11, -1, -1, -1, -1, 16, 17,
  716. 18, 19, 20, -1, 22, -1, -1, -1, -1, -1,
  717. -1, -1, 30, -1, -1, 33, -1, -1, -1, -1,
  718. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  719. -1, -1, -1, 51, -1, 53, 54, 55, -1, -1,
  720. -1, 3, 60, 61, 6, 7, -1, -1, 10, 11,
  721. -1, -1, -1, -1, 16, 17, 18, 19, 20, -1,
  722. 22, -1, -1, -1, -1, -1, -1, -1, 30, -1,
  723. -1, 33, -1, -1, -1, -1, -1, -1, -1, -1,
  724. -1, -1, -1, -1, -1, -1, -1, -1, -1, 51,
  725. -1, 53, 54, 55, -1, -1, -1, 3, 60, 61,
  726. 6, 7, -1, -1, 10, 11, -1, -1, -1, -1,
  727. 16, 17, 18, 19, 20, -1, 22, -1, -1, -1,
  728. -1, -1, -1, -1, 30, -1, -1, 33, -1, -1,
  729. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  730. -1, -1, -1, -1, -1, 51, -1, 53, -1, 55,
  731. -1, -1, -1, -1, -1, 61, 21, 22, 23, 24,
  732. 25, 26, 27, 28, 29, -1, 31, 32, -1, -1,
  733. -1, -1, -1, -1, -1, -1, -1, -1, 43, 44,
  734. 45, 46, 47, 48, 49, 50, -1, -1, -1, -1,
  735. 55, -1, 57, -1, -1, -1, -1, 62, 21, 22,
  736. 23, 24, 25, 26, 27, 28, 29, -1, 31, 32,
  737. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  738. 43, 44, 45, 46, 47, 48, 49, 50, -1, -1,
  739. -1, -1, 55, -1, 57, -1, -1, -1, -1, 62,
  740. 21, 22, 23, 24, 25, 26, 27, 28, 29, -1,
  741. 31, 32, -1, -1, -1, -1, -1, -1, -1, -1,
  742. -1, -1, 43, 44, 45, 46, 47, 48, 49, 50,
  743. -1, -1, -1, -1, 55, -1, 57, -1, -1, -1,
  744. -1, 62, 21, 22, 23, 24, 25, 26, -1, -1,
  745. -1, -1, 31, 32, -1, -1, -1, -1, -1, -1,
  746. -1, -1, -1, -1, 43, 44, 45, 46, 47, 48,
  747. 21, 22, 23, 24, 25, -1, 55, -1, 57, -1,
  748. 31, 32, -1, -1, -1, -1, -1, -1, -1, -1,
  749. -1, -1, 43, 44, 45, 46, 47, 48, -1, -1,
  750. -1, -1, -1, -1, 55, -1, 57
  751. };
  752. /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
  753. symbol of state STATE-NUM. */
  754. static const yytype_uint8 yystos[] =
  755. {
  756. 0, 64, 65, 0, 3, 6, 7, 10, 11, 12,
  757. 13, 14, 16, 17, 18, 19, 20, 22, 30, 33,
  758. 51, 53, 55, 61, 66, 67, 68, 69, 70, 71,
  759. 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
  760. 82, 83, 84, 85, 86, 87, 67, 67, 17, 17,
  761. 53, 53, 67, 67, 67, 34, 35, 36, 37, 38,
  762. 39, 40, 41, 42, 18, 67, 78, 71, 17, 55,
  763. 90, 91, 67, 67, 88, 79, 59, 55, 57, 31,
  764. 32, 21, 22, 43, 44, 45, 46, 47, 48, 23,
  765. 24, 25, 26, 27, 28, 29, 49, 50, 62, 53,
  766. 58, 34, 35, 36, 37, 38, 39, 40, 41, 42,
  767. 4, 9, 8, 53, 17, 89, 89, 67, 67, 67,
  768. 67, 67, 67, 67, 67, 67, 34, 67, 52, 60,
  769. 91, 54, 56, 60, 67, 67, 17, 71, 71, 74,
  770. 74, 72, 72, 72, 72, 72, 72, 75, 75, 75,
  771. 75, 77, 77, 77, 77, 77, 76, 88, 17, 67,
  772. 67, 67, 67, 67, 67, 67, 67, 67, 65, 65,
  773. 67, 89, 17, 54, 60, 54, 67, 56, 56, 54,
  774. 53, 5, 15, 15, 9, 54, 65, 67, 34, 88,
  775. 65, 65, 65, 15, 15, 67, 54, 15, 15, 15
  776. };
  777. /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
  778. static const yytype_uint8 yyr1[] =
  779. {
  780. 0, 63, 64, 65, 65, 66, 66, 66, 66, 66,
  781. 66, 66, 66, 67, 68, 68, 68, 68, 68, 69,
  782. 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
  783. 69, 69, 69, 69, 69, 69, 69, 69, 70, 70,
  784. 70, 71, 71, 72, 72, 72, 72, 72, 72, 72,
  785. 73, 73, 73, 74, 74, 74, 74, 75, 75, 76,
  786. 76, 77, 77, 77, 77, 77, 77, 78, 78, 79,
  787. 79, 80, 80, 80, 81, 81, 81, 81, 82, 82,
  788. 82, 83, 83, 84, 84, 85, 85, 85, 85, 85,
  789. 85, 86, 86, 86, 87, 88, 88, 88, 88, 89,
  790. 89, 89, 89, 90, 90, 90, 90, 91, 91
  791. };
  792. /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
  793. static const yytype_uint8 yyr2[] =
  794. {
  795. 0, 2, 1, 2, 0, 1, 2, 1, 1, 2,
  796. 1, 2, 2, 1, 5, 7, 5, 7, 1, 3,
  797. 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  798. 3, 3, 3, 3, 3, 3, 3, 1, 3, 3,
  799. 1, 2, 1, 3, 3, 3, 3, 3, 3, 1,
  800. 3, 3, 1, 3, 3, 3, 1, 3, 1, 3,
  801. 1, 3, 3, 3, 3, 3, 1, 2, 1, 2,
  802. 1, 4, 6, 1, 7, 6, 6, 1, 4, 3,
  803. 1, 4, 3, 1, 1, 1, 2, 1, 1, 1,
  804. 1, 3, 3, 1, 3, 0, 1, 2, 2, 0,
  805. 1, 2, 2, 0, 1, 2, 2, 5, 3
  806. };
  807. #define yyerrok (yyerrstatus = 0)
  808. #define yyclearin (yychar = YYEMPTY)
  809. #define YYEMPTY (-2)
  810. #define YYEOF 0
  811. #define YYACCEPT goto yyacceptlab
  812. #define YYABORT goto yyabortlab
  813. #define YYERROR goto yyerrorlab
  814. #define YYRECOVERING() (!!yyerrstatus)
  815. #define YYBACKUP(Token, Value) \
  816. do \
  817. if (yychar == YYEMPTY) \
  818. { \
  819. yychar = (Token); \
  820. yylval = (Value); \
  821. YYPOPSTACK (yylen); \
  822. yystate = *yyssp; \
  823. goto yybackup; \
  824. } \
  825. else \
  826. { \
  827. yyerror (&yylloc, program, YY_("syntax error: cannot back up")); \
  828. YYERROR; \
  829. } \
  830. while (0)
  831. /* Error token number */
  832. #define YYTERROR 1
  833. #define YYERRCODE 256
  834. /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
  835. If N is 0, then set CURRENT to the empty location which ends
  836. the previous symbol: RHS[0] (always defined). */
  837. #ifndef YYLLOC_DEFAULT
  838. # define YYLLOC_DEFAULT(Current, Rhs, N) \
  839. do \
  840. if (N) \
  841. { \
  842. (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
  843. (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
  844. (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
  845. (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
  846. } \
  847. else \
  848. { \
  849. (Current).first_line = (Current).last_line = \
  850. YYRHSLOC (Rhs, 0).last_line; \
  851. (Current).first_column = (Current).last_column = \
  852. YYRHSLOC (Rhs, 0).last_column; \
  853. } \
  854. while (0)
  855. #endif
  856. #define YYRHSLOC(Rhs, K) ((Rhs)[K])
  857. /* Enable debugging if requested. */
  858. #if YYDEBUG
  859. # ifndef YYFPRINTF
  860. # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
  861. # define YYFPRINTF fprintf
  862. # endif
  863. # define YYDPRINTF(Args) \
  864. do { \
  865. if (yydebug) \
  866. YYFPRINTF Args; \
  867. } while (0)
  868. /* YY_LOCATION_PRINT -- Print the location on the stream.
  869. This macro was not mandated originally: define only if we know
  870. we won't break user code: when these are the locations we know. */
  871. #ifndef YY_LOCATION_PRINT
  872. # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
  873. /* Print *YYLOCP on YYO. Private, do not rely on its existence. */
  874. YY_ATTRIBUTE_UNUSED
  875. static unsigned
  876. yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
  877. {
  878. unsigned res = 0;
  879. int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
  880. if (0 <= yylocp->first_line)
  881. {
  882. res += YYFPRINTF (yyo, "%d", yylocp->first_line);
  883. if (0 <= yylocp->first_column)
  884. res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
  885. }
  886. if (0 <= yylocp->last_line)
  887. {
  888. if (yylocp->first_line < yylocp->last_line)
  889. {
  890. res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
  891. if (0 <= end_col)
  892. res += YYFPRINTF (yyo, ".%d", end_col);
  893. }
  894. else if (0 <= end_col && yylocp->first_column < end_col)
  895. res += YYFPRINTF (yyo, "-%d", end_col);
  896. }
  897. return res;
  898. }
  899. # define YY_LOCATION_PRINT(File, Loc) \
  900. yy_location_print_ (File, &(Loc))
  901. # else
  902. # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
  903. # endif
  904. #endif
  905. # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
  906. do { \
  907. if (yydebug) \
  908. { \
  909. YYFPRINTF (stderr, "%s ", Title); \
  910. yy_symbol_print (stderr, \
  911. Type, Value, Location, program); \
  912. YYFPRINTF (stderr, "\n"); \
  913. } \
  914. } while (0)
  915. /*----------------------------------------.
  916. | Print this symbol's value on YYOUTPUT. |
  917. `----------------------------------------*/
  918. static void
  919. yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, stmt_node **program)
  920. {
  921. FILE *yyo = yyoutput;
  922. YYUSE (yyo);
  923. YYUSE (yylocationp);
  924. YYUSE (program);
  925. if (!yyvaluep)
  926. return;
  927. # ifdef YYPRINT
  928. if (yytype < YYNTOKENS)
  929. YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
  930. # endif
  931. YYUSE (yytype);
  932. }
  933. /*--------------------------------.
  934. | Print this symbol on YYOUTPUT. |
  935. `--------------------------------*/
  936. static void
  937. yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, stmt_node **program)
  938. {
  939. YYFPRINTF (yyoutput, "%s %s (",
  940. yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
  941. YY_LOCATION_PRINT (yyoutput, *yylocationp);
  942. YYFPRINTF (yyoutput, ": ");
  943. yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, program);
  944. YYFPRINTF (yyoutput, ")");
  945. }
  946. /*------------------------------------------------------------------.
  947. | yy_stack_print -- Print the state stack from its BOTTOM up to its |
  948. | TOP (included). |
  949. `------------------------------------------------------------------*/
  950. static void
  951. yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
  952. {
  953. YYFPRINTF (stderr, "Stack now");
  954. for (; yybottom <= yytop; yybottom++)
  955. {
  956. int yybot = *yybottom;
  957. YYFPRINTF (stderr, " %d", yybot);
  958. }
  959. YYFPRINTF (stderr, "\n");
  960. }
  961. # define YY_STACK_PRINT(Bottom, Top) \
  962. do { \
  963. if (yydebug) \
  964. yy_stack_print ((Bottom), (Top)); \
  965. } while (0)
  966. /*------------------------------------------------.
  967. | Report that the YYRULE is going to be reduced. |
  968. `------------------------------------------------*/
  969. static void
  970. yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, stmt_node **program)
  971. {
  972. unsigned long int yylno = yyrline[yyrule];
  973. int yynrhs = yyr2[yyrule];
  974. int yyi;
  975. YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
  976. yyrule - 1, yylno);
  977. /* The symbols being reduced. */
  978. for (yyi = 0; yyi < yynrhs; yyi++)
  979. {
  980. YYFPRINTF (stderr, " $%d = ", yyi + 1);
  981. yy_symbol_print (stderr,
  982. yystos[yyssp[yyi + 1 - yynrhs]],
  983. &(yyvsp[(yyi + 1) - (yynrhs)])
  984. , &(yylsp[(yyi + 1) - (yynrhs)]) , program);
  985. YYFPRINTF (stderr, "\n");
  986. }
  987. }
  988. # define YY_REDUCE_PRINT(Rule) \
  989. do { \
  990. if (yydebug) \
  991. yy_reduce_print (yyssp, yyvsp, yylsp, Rule, program); \
  992. } while (0)
  993. /* Nonzero means print parse trace. It is left uninitialized so that
  994. multiple parsers can coexist. */
  995. int yydebug;
  996. #else /* !YYDEBUG */
  997. # define YYDPRINTF(Args)
  998. # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
  999. # define YY_STACK_PRINT(Bottom, Top)
  1000. # define YY_REDUCE_PRINT(Rule)
  1001. #endif /* !YYDEBUG */
  1002. /* YYINITDEPTH -- initial size of the parser's stacks. */
  1003. #ifndef YYINITDEPTH
  1004. # define YYINITDEPTH 200
  1005. #endif
  1006. /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
  1007. if the built-in stack extension method is used).
  1008. Do not make this value too large; the results are undefined if
  1009. YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
  1010. evaluated with infinite-precision integer arithmetic. */
  1011. #ifndef YYMAXDEPTH
  1012. # define YYMAXDEPTH 10000
  1013. #endif
  1014. #if YYERROR_VERBOSE
  1015. # ifndef yystrlen
  1016. # if defined __GLIBC__ && defined _STRING_H
  1017. # define yystrlen strlen
  1018. # else
  1019. /* Return the length of YYSTR. */
  1020. static YYSIZE_T
  1021. yystrlen (const char *yystr)
  1022. {
  1023. YYSIZE_T yylen;
  1024. for (yylen = 0; yystr[yylen]; yylen++)
  1025. continue;
  1026. return yylen;
  1027. }
  1028. # endif
  1029. # endif
  1030. # ifndef yystpcpy
  1031. # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
  1032. # define yystpcpy stpcpy
  1033. # else
  1034. /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
  1035. YYDEST. */
  1036. static char *
  1037. yystpcpy (char *yydest, const char *yysrc)
  1038. {
  1039. char *yyd = yydest;
  1040. const char *yys = yysrc;
  1041. while ((*yyd++ = *yys++) != '\0')
  1042. continue;
  1043. return yyd - 1;
  1044. }
  1045. # endif
  1046. # endif
  1047. # ifndef yytnamerr
  1048. /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
  1049. quotes and backslashes, so that it's suitable for yyerror. The
  1050. heuristic is that double-quoting is unnecessary unless the string
  1051. contains an apostrophe, a comma, or backslash (other than
  1052. backslash-backslash). YYSTR is taken from yytname. If YYRES is
  1053. null, do not copy; instead, return the length of what the result
  1054. would have been. */
  1055. static YYSIZE_T
  1056. yytnamerr (char *yyres, const char *yystr)
  1057. {
  1058. if (*yystr == '"')
  1059. {
  1060. YYSIZE_T yyn = 0;
  1061. char const *yyp = yystr;
  1062. for (;;)
  1063. switch (*++yyp)
  1064. {
  1065. case '\'':
  1066. case ',':
  1067. goto do_not_strip_quotes;
  1068. case '\\':
  1069. if (*++yyp != '\\')
  1070. goto do_not_strip_quotes;
  1071. /* Fall through. */
  1072. default:
  1073. if (yyres)
  1074. yyres[yyn] = *yyp;
  1075. yyn++;
  1076. break;
  1077. case '"':
  1078. if (yyres)
  1079. yyres[yyn] = '\0';
  1080. return yyn;
  1081. }
  1082. do_not_strip_quotes: ;
  1083. }
  1084. if (! yyres)
  1085. return yystrlen (yystr);
  1086. return yystpcpy (yyres, yystr) - yyres;
  1087. }
  1088. # endif
  1089. /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
  1090. about the unexpected token YYTOKEN for the state stack whose top is
  1091. YYSSP.
  1092. Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
  1093. not large enough to hold the message. In that case, also set
  1094. *YYMSG_ALLOC to the required number of bytes. Return 2 if the
  1095. required number of bytes is too large to store. */
  1096. static int
  1097. yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
  1098. yytype_int16 *yyssp, int yytoken)
  1099. {
  1100. YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
  1101. YYSIZE_T yysize = yysize0;
  1102. enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
  1103. /* Internationalized format string. */
  1104. const char *yyformat = YY_NULLPTR;
  1105. /* Arguments of yyformat. */
  1106. char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
  1107. /* Number of reported tokens (one for the "unexpected", one per
  1108. "expected"). */
  1109. int yycount = 0;
  1110. /* There are many possibilities here to consider:
  1111. - If this state is a consistent state with a default action, then
  1112. the only way this function was invoked is if the default action
  1113. is an error action. In that case, don't check for expected
  1114. tokens because there are none.
  1115. - The only way there can be no lookahead present (in yychar) is if
  1116. this state is a consistent state with a default action. Thus,
  1117. detecting the absence of a lookahead is sufficient to determine
  1118. that there is no unexpected or expected token to report. In that
  1119. case, just report a simple "syntax error".
  1120. - Don't assume there isn't a lookahead just because this state is a
  1121. consistent state with a default action. There might have been a
  1122. previous inconsistent state, consistent state with a non-default
  1123. action, or user semantic action that manipulated yychar.
  1124. - Of course, the expected token list depends on states to have
  1125. correct lookahead information, and it depends on the parser not
  1126. to perform extra reductions after fetching a lookahead from the
  1127. scanner and before detecting a syntax error. Thus, state merging
  1128. (from LALR or IELR) and default reductions corrupt the expected
  1129. token list. However, the list is correct for canonical LR with
  1130. one exception: it will still contain any token that will not be
  1131. accepted due to an error action in a later state.
  1132. */
  1133. if (yytoken != YYEMPTY)
  1134. {
  1135. int yyn = yypact[*yyssp];
  1136. yyarg[yycount++] = yytname[yytoken];
  1137. if (!yypact_value_is_default (yyn))
  1138. {
  1139. /* Start YYX at -YYN if negative to avoid negative indexes in
  1140. YYCHECK. In other words, skip the first -YYN actions for
  1141. this state because they are default actions. */
  1142. int yyxbegin = yyn < 0 ? -yyn : 0;
  1143. /* Stay within bounds of both yycheck and yytname. */
  1144. int yychecklim = YYLAST - yyn + 1;
  1145. int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
  1146. int yyx;
  1147. for (yyx = yyxbegin; yyx < yyxend; ++yyx)
  1148. if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
  1149. && !yytable_value_is_error (yytable[yyx + yyn]))
  1150. {
  1151. if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
  1152. {
  1153. yycount = 1;
  1154. yysize = yysize0;
  1155. break;
  1156. }
  1157. yyarg[yycount++] = yytname[yyx];
  1158. {
  1159. YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
  1160. if (! (yysize <= yysize1
  1161. && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
  1162. return 2;
  1163. yysize = yysize1;
  1164. }
  1165. }
  1166. }
  1167. }
  1168. switch (yycount)
  1169. {
  1170. # define YYCASE_(N, S) \
  1171. case N: \
  1172. yyformat = S; \
  1173. break
  1174. YYCASE_(0, YY_("syntax error"));
  1175. YYCASE_(1, YY_("syntax error, unexpected %s"));
  1176. YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
  1177. YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
  1178. YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
  1179. YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
  1180. # undef YYCASE_
  1181. }
  1182. {
  1183. YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
  1184. if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
  1185. return 2;
  1186. yysize = yysize1;
  1187. }
  1188. if (*yymsg_alloc < yysize)
  1189. {
  1190. *yymsg_alloc = 2 * yysize;
  1191. if (! (yysize <= *yymsg_alloc
  1192. && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
  1193. *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
  1194. return 1;
  1195. }
  1196. /* Avoid sprintf, as that infringes on the user's name space.
  1197. Don't have undefined behavior even if the translation
  1198. produced a string with the wrong number of "%s"s. */
  1199. {
  1200. char *yyp = *yymsg;
  1201. int yyi = 0;
  1202. while ((*yyp = *yyformat) != '\0')
  1203. if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
  1204. {
  1205. yyp += yytnamerr (yyp, yyarg[yyi++]);
  1206. yyformat += 2;
  1207. }
  1208. else
  1209. {
  1210. yyp++;
  1211. yyformat++;
  1212. }
  1213. }
  1214. return 0;
  1215. }
  1216. #endif /* YYERROR_VERBOSE */
  1217. /*-----------------------------------------------.
  1218. | Release the memory associated to this symbol. |
  1219. `-----------------------------------------------*/
  1220. static void
  1221. yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, stmt_node **program)
  1222. {
  1223. YYUSE (yyvaluep);
  1224. YYUSE (yylocationp);
  1225. YYUSE (program);
  1226. if (!yymsg)
  1227. yymsg = "Deleting";
  1228. YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
  1229. YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  1230. YYUSE (yytype);
  1231. YY_IGNORE_MAYBE_UNINITIALIZED_END
  1232. }
  1233. /*----------.
  1234. | yyparse. |
  1235. `----------*/
  1236. int
  1237. yyparse (stmt_node **program)
  1238. {
  1239. /* The lookahead symbol. */
  1240. int yychar;
  1241. /* The semantic value of the lookahead symbol. */
  1242. /* Default value used for initialization, for pacifying older GCCs
  1243. or non-GCC compilers. */
  1244. YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
  1245. YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
  1246. /* Location data for the lookahead symbol. */
  1247. static YYLTYPE yyloc_default
  1248. # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
  1249. = { 1, 1, 1, 1 }
  1250. # endif
  1251. ;
  1252. YYLTYPE yylloc = yyloc_default;
  1253. /* Number of syntax errors so far. */
  1254. int yynerrs;
  1255. int yystate;
  1256. /* Number of tokens to shift before error messages enabled. */
  1257. int yyerrstatus;
  1258. /* The stacks and their tools:
  1259. 'yyss': related to states.
  1260. 'yyvs': related to semantic values.
  1261. 'yyls': related to locations.
  1262. Refer to the stacks through separate pointers, to allow yyoverflow
  1263. to reallocate them elsewhere. */
  1264. /* The state stack. */
  1265. yytype_int16 yyssa[YYINITDEPTH];
  1266. yytype_int16 *yyss;
  1267. yytype_int16 *yyssp;
  1268. /* The semantic value stack. */
  1269. YYSTYPE yyvsa[YYINITDEPTH];
  1270. YYSTYPE *yyvs;
  1271. YYSTYPE *yyvsp;
  1272. /* The location stack. */
  1273. YYLTYPE yylsa[YYINITDEPTH];
  1274. YYLTYPE *yyls;
  1275. YYLTYPE *yylsp;
  1276. /* The locations where the error started and ended. */
  1277. YYLTYPE yyerror_range[3];
  1278. YYSIZE_T yystacksize;
  1279. int yyn;
  1280. int yyresult;
  1281. /* Lookahead token as an internal (translated) token number. */
  1282. int yytoken = 0;
  1283. /* The variables used to return semantic value and location from the
  1284. action routines. */
  1285. YYSTYPE yyval;
  1286. YYLTYPE yyloc;
  1287. #if YYERROR_VERBOSE
  1288. /* Buffer for error messages, and its allocated size. */
  1289. char yymsgbuf[128];
  1290. char *yymsg = yymsgbuf;
  1291. YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
  1292. #endif
  1293. #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
  1294. /* The number of symbols on the RHS of the reduced rule.
  1295. Keep to zero when no symbol should be popped. */
  1296. int yylen = 0;
  1297. yyssp = yyss = yyssa;
  1298. yyvsp = yyvs = yyvsa;
  1299. yylsp = yyls = yylsa;
  1300. yystacksize = YYINITDEPTH;
  1301. YYDPRINTF ((stderr, "Starting parse\n"));
  1302. yystate = 0;
  1303. yyerrstatus = 0;
  1304. yynerrs = 0;
  1305. yychar = YYEMPTY; /* Cause a token to be read. */
  1306. yylsp[0] = yylloc;
  1307. goto yysetstate;
  1308. /*------------------------------------------------------------.
  1309. | yynewstate -- Push a new state, which is found in yystate. |
  1310. `------------------------------------------------------------*/
  1311. yynewstate:
  1312. /* In all cases, when you get here, the value and location stacks
  1313. have just been pushed. So pushing a state here evens the stacks. */
  1314. yyssp++;
  1315. yysetstate:
  1316. *yyssp = yystate;
  1317. if (yyss + yystacksize - 1 <= yyssp)
  1318. {
  1319. /* Get the current used size of the three stacks, in elements. */
  1320. YYSIZE_T yysize = yyssp - yyss + 1;
  1321. #ifdef yyoverflow
  1322. {
  1323. /* Give user a chance to reallocate the stack. Use copies of
  1324. these so that the &'s don't force the real ones into
  1325. memory. */
  1326. YYSTYPE *yyvs1 = yyvs;
  1327. yytype_int16 *yyss1 = yyss;
  1328. YYLTYPE *yyls1 = yyls;
  1329. /* Each stack pointer address is followed by the size of the
  1330. data in use in that stack, in bytes. This used to be a
  1331. conditional around just the two extra args, but that might
  1332. be undefined if yyoverflow is a macro. */
  1333. yyoverflow (YY_("memory exhausted"),
  1334. &yyss1, yysize * sizeof (*yyssp),
  1335. &yyvs1, yysize * sizeof (*yyvsp),
  1336. &yyls1, yysize * sizeof (*yylsp),
  1337. &yystacksize);
  1338. yyls = yyls1;
  1339. yyss = yyss1;
  1340. yyvs = yyvs1;
  1341. }
  1342. #else /* no yyoverflow */
  1343. # ifndef YYSTACK_RELOCATE
  1344. goto yyexhaustedlab;
  1345. # else
  1346. /* Extend the stack our own way. */
  1347. if (YYMAXDEPTH <= yystacksize)
  1348. goto yyexhaustedlab;
  1349. yystacksize *= 2;
  1350. if (YYMAXDEPTH < yystacksize)
  1351. yystacksize = YYMAXDEPTH;
  1352. {
  1353. yytype_int16 *yyss1 = yyss;
  1354. union yyalloc *yyptr =
  1355. (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
  1356. if (! yyptr)
  1357. goto yyexhaustedlab;
  1358. YYSTACK_RELOCATE (yyss_alloc, yyss);
  1359. YYSTACK_RELOCATE (yyvs_alloc, yyvs);
  1360. YYSTACK_RELOCATE (yyls_alloc, yyls);
  1361. # undef YYSTACK_RELOCATE
  1362. if (yyss1 != yyssa)
  1363. YYSTACK_FREE (yyss1);
  1364. }
  1365. # endif
  1366. #endif /* no yyoverflow */
  1367. yyssp = yyss + yysize - 1;
  1368. yyvsp = yyvs + yysize - 1;
  1369. yylsp = yyls + yysize - 1;
  1370. YYDPRINTF ((stderr, "Stack size increased to %lu\n",
  1371. (unsigned long int) yystacksize));
  1372. if (yyss + yystacksize - 1 <= yyssp)
  1373. YYABORT;
  1374. }
  1375. YYDPRINTF ((stderr, "Entering state %d\n", yystate));
  1376. if (yystate == YYFINAL)
  1377. YYACCEPT;
  1378. goto yybackup;
  1379. /*-----------.
  1380. | yybackup. |
  1381. `-----------*/
  1382. yybackup:
  1383. /* Do appropriate processing given the current state. Read a
  1384. lookahead token if we need one and don't already have one. */
  1385. /* First try to decide what to do without reference to lookahead token. */
  1386. yyn = yypact[yystate];
  1387. if (yypact_value_is_default (yyn))
  1388. goto yydefault;
  1389. /* Not known => get a lookahead token if don't already have one. */
  1390. /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
  1391. if (yychar == YYEMPTY)
  1392. {
  1393. YYDPRINTF ((stderr, "Reading a token: "));
  1394. yychar = yylex (&yylval, &yylloc);
  1395. }
  1396. if (yychar <= YYEOF)
  1397. {
  1398. yychar = yytoken = YYEOF;
  1399. YYDPRINTF ((stderr, "Now at end of input.\n"));
  1400. }
  1401. else
  1402. {
  1403. yytoken = YYTRANSLATE (yychar);
  1404. YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
  1405. }
  1406. /* If the proper action on seeing token YYTOKEN is to reduce or to
  1407. detect an error, take that action. */
  1408. yyn += yytoken;
  1409. if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
  1410. goto yydefault;
  1411. yyn = yytable[yyn];
  1412. if (yyn <= 0)
  1413. {
  1414. if (yytable_value_is_error (yyn))
  1415. goto yyerrlab;
  1416. yyn = -yyn;
  1417. goto yyreduce;
  1418. }
  1419. /* Count tokens shifted since error; after three, turn off error
  1420. status. */
  1421. if (yyerrstatus)
  1422. yyerrstatus--;
  1423. /* Shift the lookahead token. */
  1424. YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
  1425. /* Discard the shifted token. */
  1426. yychar = YYEMPTY;
  1427. yystate = yyn;
  1428. YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  1429. *++yyvsp = yylval;
  1430. YY_IGNORE_MAYBE_UNINITIALIZED_END
  1431. *++yylsp = yylloc;
  1432. goto yynewstate;
  1433. /*-----------------------------------------------------------.
  1434. | yydefault -- do the default action for the current state. |
  1435. `-----------------------------------------------------------*/
  1436. yydefault:
  1437. yyn = yydefact[yystate];
  1438. if (yyn == 0)
  1439. goto yyerrlab;
  1440. goto yyreduce;
  1441. /*-----------------------------.
  1442. | yyreduce -- Do a reduction. |
  1443. `-----------------------------*/
  1444. yyreduce:
  1445. /* yyn is the number of a rule to reduce with. */
  1446. yylen = yyr2[yyn];
  1447. /* If YYLEN is nonzero, implement the default value of the action:
  1448. '$$ = $1'.
  1449. Otherwise, the following line sets YYVAL to garbage.
  1450. This behavior is undocumented and Bison
  1451. users should not rely upon it. Assigning to YYVAL
  1452. unconditionally makes the parser a bit smaller, and it avoids a
  1453. GCC warning that YYVAL may be used uninitialized. */
  1454. yyval = yyvsp[1-yylen];
  1455. /* Default location. */
  1456. YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
  1457. YY_REDUCE_PRINT (yyn);
  1458. switch (yyn)
  1459. {
  1460. case 2:
  1461. #line 34 "parser.y" /* yacc.c:1646 */
  1462. { *program = AS_ST((yyvsp[0])); }
  1463. #line 1671 "parser.tab.c" /* yacc.c:1646 */
  1464. break;
  1465. case 3:
  1466. #line 38 "parser.y" /* yacc.c:1646 */
  1467. {
  1468. stmtlist_node *cur = AS_ST((yyvsp[-1]))->stmtlist;
  1469. while(cur->next) cur = cur->next;
  1470. if(cur->stmt) {
  1471. cur->next = NEW(stmtlist_node);
  1472. cur = cur->next;
  1473. }
  1474. cur->stmt = (yyvsp[0]);
  1475. cur->next = NULL;
  1476. (yyval) = (yyvsp[-1]);
  1477. }
  1478. #line 1687 "parser.tab.c" /* yacc.c:1646 */
  1479. break;
  1480. case 4:
  1481. #line 49 "parser.y" /* yacc.c:1646 */
  1482. {
  1483. (yyval) = NEW_ST();
  1484. AS_ST((yyval))->type = ST_LIST;
  1485. AS_ST((yyval))->stmtlist = NEW(stmtlist_node);
  1486. AS_ST((yyval))->stmtlist->stmt = NULL;
  1487. AS_ST((yyval))->stmtlist->next = NULL;
  1488. }
  1489. #line 1699 "parser.tab.c" /* yacc.c:1646 */
  1490. break;
  1491. case 5:
  1492. #line 59 "parser.y" /* yacc.c:1646 */
  1493. { (yyval) = NEW_ST(); SET_LOC(AS_ST((yyval)), (yyloc)); AS_ST((yyval))->type = ST_EXPR; AS_ST((yyval))->expr = (yyvsp[0]); }
  1494. #line 1705 "parser.tab.c" /* yacc.c:1646 */
  1495. break;
  1496. case 6:
  1497. #line 60 "parser.y" /* yacc.c:1646 */
  1498. { (yyval) = NEW_ST(); SET_LOC(AS_ST((yyval)), (yyloc)); AS_ST((yyval))->type = ST_RET; AS_ST((yyval))->ret = NEW(ret_node); AS_ST((yyval))->ret->ret = (yyvsp[0]); }
  1499. #line 1711 "parser.tab.c" /* yacc.c:1646 */
  1500. break;
  1501. case 7:
  1502. #line 61 "parser.y" /* yacc.c:1646 */
  1503. { (yyval) = NEW_ST(); SET_LOC(AS_ST((yyval)), (yyloc)); AS_ST((yyval))->type = ST_RET; AS_ST((yyval))->ret = NEW(ret_node); AS_ST((yyval))->ret->ret = NULL; }
  1504. #line 1717 "parser.tab.c" /* yacc.c:1646 */
  1505. break;
  1506. case 8:
  1507. #line 62 "parser.y" /* yacc.c:1646 */
  1508. { (yyval) = NEW_ST(); SET_LOC(AS_ST((yyval)), (yyloc)); AS_ST((yyval))->type = ST_BREAK; AS_ST((yyval))->brk = NEW(break_node); }
  1509. #line 1723 "parser.tab.c" /* yacc.c:1646 */
  1510. break;
  1511. case 9:
  1512. #line 63 "parser.y" /* yacc.c:1646 */
  1513. { (yyval) = NEW_ST(); SET_LOC(AS_ST((yyval)), (yyloc)); AS_ST((yyval))->type = ST_BREAK; AS_ST((yyval))->brk = NEW(break_node); AS_ST((yyval))->brk->val = (yyvsp[0]); }
  1514. #line 1729 "parser.tab.c" /* yacc.c:1646 */
  1515. break;
  1516. case 10:
  1517. #line 64 "parser.y" /* yacc.c:1646 */
  1518. { (yyval) = NEW_ST(); SET_LOC(AS_ST((yyval)), (yyloc)); AS_ST((yyval))->type = ST_CONT; AS_ST((yyval))->cont = NEW(cont_node); }
  1519. #line 1735 "parser.tab.c" /* yacc.c:1646 */
  1520. break;
  1521. case 11:
  1522. #line 65 "parser.y" /* yacc.c:1646 */
  1523. { (yyval) = NEW_ST(); SET_LOC(AS_ST((yyval)), (yyloc)); AS_ST((yyval))->type = ST_CONT; AS_ST((yyval))->cont = NEW(cont_node); AS_ST((yyval))->cont->val = (yyvsp[0]); }
  1524. #line 1741 "parser.tab.c" /* yacc.c:1646 */
  1525. break;
  1526. case 12:
  1527. #line 66 "parser.y" /* yacc.c:1646 */
  1528. { (yyval) = (yyvsp[-1]); }
  1529. #line 1747 "parser.tab.c" /* yacc.c:1646 */
  1530. break;
  1531. case 13:
  1532. #line 70 "parser.y" /* yacc.c:1646 */
  1533. { (yyval) = (yyvsp[0]); }
  1534. #line 1753 "parser.tab.c" /* yacc.c:1646 */
  1535. break;
  1536. case 14:
  1537. #line 74 "parser.y" /* yacc.c:1646 */
  1538. {
  1539. (yyval) = NEW_EX();
  1540. AS_EX((yyval))->type = EX_IFELSE;
  1541. AS_EX((yyval))->ifelse = NEW(ifelse_node);
  1542. AS_EX((yyval))->ifelse->cond = (yyvsp[-3]);
  1543. AS_EX((yyval))->ifelse->iftrue = (yyvsp[-1]);
  1544. AS_EX((yyval))->ifelse->iffalse = NULL;
  1545. }
  1546. #line 1766 "parser.tab.c" /* yacc.c:1646 */
  1547. break;
  1548. case 15:
  1549. #line 82 "parser.y" /* yacc.c:1646 */
  1550. {
  1551. (yyval) = NEW_EX();
  1552. AS_EX((yyval))->type = EX_IFELSE;
  1553. AS_EX((yyval))->ifelse = NEW(ifelse_node);
  1554. AS_EX((yyval))->ifelse->cond = (yyvsp[-5]);
  1555. AS_EX((yyval))->ifelse->iftrue = (yyvsp[-3]);
  1556. AS_EX((yyval))->ifelse->iffalse = (yyvsp[-1]);
  1557. }
  1558. #line 1779 "parser.tab.c" /* yacc.c:1646 */
  1559. break;
  1560. case 16:
  1561. #line 90 "parser.y" /* yacc.c:1646 */
  1562. {
  1563. (yyval) = NEW_EX();
  1564. AS_EX((yyval))->type = EX_LOOP;
  1565. AS_EX((yyval))->loop = NEW(loop_node);
  1566. AS_EX((yyval))->loop->cond = (yyvsp[-3]);
  1567. AS_EX((yyval))->loop->loop = (yyvsp[-1]);
  1568. }
  1569. #line 1791 "parser.tab.c" /* yacc.c:1646 */
  1570. break;
  1571. case 17:
  1572. #line 97 "parser.y" /* yacc.c:1646 */
  1573. {
  1574. (yyval) = NEW_EX();
  1575. AS_EX((yyval))->type = EX_ITER;
  1576. AS_EX((yyval))->iter = NEW(iter_node);
  1577. AS_EX((yyval))->iter->var = (yyvsp[-5]);
  1578. AS_EX((yyval))->iter->iter = (yyvsp[-3]);
  1579. AS_EX((yyval))->iter->loop = (yyvsp[-1]);
  1580. }
  1581. #line 1804 "parser.tab.c" /* yacc.c:1646 */
  1582. break;
  1583. case 18:
  1584. #line 105 "parser.y" /* yacc.c:1646 */
  1585. { (yyval) = (yyvsp[0]); }
  1586. #line 1810 "parser.tab.c" /* yacc.c:1646 */
  1587. break;
  1588. case 19:
  1589. #line 109 "parser.y" /* yacc.c:1646 */
  1590. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_ASSIGN; AS_EX((yyval))->assign = NEW(assign_node); AS_EX((yyval))->assign->ident = (yyvsp[-2]); AS_EX((yyval))->assign->value = (yyvsp[0]); }
  1591. #line 1816 "parser.tab.c" /* yacc.c:1646 */
  1592. break;
  1593. case 20:
  1594. #line 110 "parser.y" /* yacc.c:1646 */
  1595. {
  1596. (yyval) = NEW_EX();
  1597. AS_EX((yyval))->type = EX_ASSIGN;
  1598. AS_EX((yyval))->assign = NEW(assign_node);
  1599. AS_EX((yyval))->assign->ident = (yyvsp[-2]);
  1600. MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_ADD, (yyvsp[-2]), (yyvsp[0]));
  1601. }
  1602. #line 1828 "parser.tab.c" /* yacc.c:1646 */
  1603. break;
  1604. case 21:
  1605. #line 117 "parser.y" /* yacc.c:1646 */
  1606. {
  1607. (yyval) = NEW_EX();
  1608. AS_EX((yyval))->type = EX_ASSIGN;
  1609. AS_EX((yyval))->assign = NEW(assign_node);
  1610. AS_EX((yyval))->assign->ident = (yyvsp[-2]);
  1611. MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_SUB, (yyvsp[-2]), (yyvsp[0]));
  1612. }
  1613. #line 1840 "parser.tab.c" /* yacc.c:1646 */
  1614. break;
  1615. case 22:
  1616. #line 124 "parser.y" /* yacc.c:1646 */
  1617. {
  1618. (yyval) = NEW_EX();
  1619. AS_EX((yyval))->type = EX_ASSIGN;
  1620. AS_EX((yyval))->assign = NEW(assign_node);
  1621. AS_EX((yyval))->assign->ident = (yyvsp[-2]);
  1622. MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_MUL, (yyvsp[-2]), (yyvsp[0]));
  1623. }
  1624. #line 1852 "parser.tab.c" /* yacc.c:1646 */
  1625. break;
  1626. case 23:
  1627. #line 131 "parser.y" /* yacc.c:1646 */
  1628. {
  1629. (yyval) = NEW_EX();
  1630. AS_EX((yyval))->type = EX_ASSIGN;
  1631. AS_EX((yyval))->assign = NEW(assign_node);
  1632. AS_EX((yyval))->assign->ident = (yyvsp[-2]);
  1633. MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_DIV, (yyvsp[-2]), (yyvsp[0]));
  1634. }
  1635. #line 1864 "parser.tab.c" /* yacc.c:1646 */
  1636. break;
  1637. case 24:
  1638. #line 138 "parser.y" /* yacc.c:1646 */
  1639. {
  1640. (yyval) = NEW_EX();
  1641. AS_EX((yyval))->type = EX_ASSIGN;
  1642. AS_EX((yyval))->assign = NEW(assign_node);
  1643. AS_EX((yyval))->assign->ident = (yyvsp[-2]);
  1644. MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_POW, (yyvsp[-2]), (yyvsp[0]));
  1645. }
  1646. #line 1876 "parser.tab.c" /* yacc.c:1646 */
  1647. break;
  1648. case 25:
  1649. #line 145 "parser.y" /* yacc.c:1646 */
  1650. {
  1651. (yyval) = NEW_EX();
  1652. AS_EX((yyval))->type = EX_ASSIGN;
  1653. AS_EX((yyval))->assign = NEW(assign_node);
  1654. AS_EX((yyval))->assign->ident = (yyvsp[-2]);
  1655. MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_BAND, (yyvsp[-2]), (yyvsp[0]));
  1656. }
  1657. #line 1888 "parser.tab.c" /* yacc.c:1646 */
  1658. break;
  1659. case 26:
  1660. #line 152 "parser.y" /* yacc.c:1646 */
  1661. {
  1662. (yyval) = NEW_EX();
  1663. AS_EX((yyval))->type = EX_ASSIGN;
  1664. AS_EX((yyval))->assign = NEW(assign_node);
  1665. AS_EX((yyval))->assign->ident = (yyvsp[-2]);
  1666. MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_BOR, (yyvsp[-2]), (yyvsp[0]));
  1667. }
  1668. #line 1900 "parser.tab.c" /* yacc.c:1646 */
  1669. break;
  1670. case 27:
  1671. #line 159 "parser.y" /* yacc.c:1646 */
  1672. {
  1673. (yyval) = NEW_EX();
  1674. AS_EX((yyval))->type = EX_ASSIGN;
  1675. AS_EX((yyval))->assign = NEW(assign_node);
  1676. AS_EX((yyval))->assign->ident = (yyvsp[-2]);
  1677. MAKE_REF_BINOP(AS_EX((yyval))->assign->value, OP_BXOR, (yyvsp[-2]), (yyvsp[0]));
  1678. }
  1679. #line 1912 "parser.tab.c" /* yacc.c:1646 */
  1680. break;
  1681. case 28:
  1682. #line 166 "parser.y" /* yacc.c:1646 */
  1683. {
  1684. if(AS_EX((yyvsp[-2]))->type != EX_INDEX) {
  1685. yyerror("Assigning to non-indexing expression");
  1686. YYABORT;
  1687. }
  1688. (yyval) = NEW_EX();
  1689. AS_EX((yyval))->type = EX_SETINDEX;
  1690. AS_EX((yyval))->setindex = NEW(setindex_node);
  1691. AS_EX((yyval))->setindex->expr = ex_copy(AS_EX((yyvsp[-2]))->index->expr);
  1692. AS_EX((yyval))->setindex->index = ex_copy(AS_EX((yyvsp[-2]))->index->index);
  1693. AS_EX((yyval))->setindex->value = (yyvsp[0]);
  1694. ex_free(AS_EX((yyvsp[-2])));
  1695. }
  1696. #line 1930 "parser.tab.c" /* yacc.c:1646 */
  1697. break;
  1698. case 29:
  1699. #line 179 "parser.y" /* yacc.c:1646 */
  1700. {
  1701. if(AS_EX((yyvsp[-2]))->type != EX_INDEX) {
  1702. yyerror("Assigning to non-indexing expression");
  1703. YYABORT;
  1704. }
  1705. (yyval) = NEW_EX();
  1706. AS_EX((yyval))->type = EX_SETINDEX;
  1707. AS_EX((yyval))->setindex = NEW(setindex_node);
  1708. AS_EX((yyval))->setindex->expr = ex_copy(AS_EX((yyvsp[-2]))->index->expr);
  1709. AS_EX((yyval))->setindex->index = ex_copy(AS_EX((yyvsp[-2]))->index->index);
  1710. MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_ADD, AS_EX((yyvsp[-2]))->index->expr, AS_EX((yyvsp[-2]))->index->index, (yyvsp[0]));
  1711. ex_free(AS_EX((yyvsp[-2])));
  1712. }
  1713. #line 1948 "parser.tab.c" /* yacc.c:1646 */
  1714. break;
  1715. case 30:
  1716. #line 192 "parser.y" /* yacc.c:1646 */
  1717. {
  1718. if(AS_EX((yyvsp[-2]))->type != EX_INDEX) {
  1719. yyerror("Assigning to non-indexing expression");
  1720. YYABORT;
  1721. }
  1722. (yyval) = NEW_EX();
  1723. AS_EX((yyval))->type = EX_SETINDEX;
  1724. AS_EX((yyval))->setindex = NEW(setindex_node);
  1725. AS_EX((yyval))->setindex->expr = ex_copy(AS_EX((yyvsp[-2]))->index->expr);
  1726. AS_EX((yyval))->setindex->index = ex_copy(AS_EX((yyvsp[-2]))->index->index);
  1727. MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_SUB, AS_EX((yyvsp[-2]))->index->expr, AS_EX((yyvsp[-2]))->index->index, (yyvsp[0]));
  1728. ex_free(AS_EX((yyvsp[-2])));
  1729. }
  1730. #line 1966 "parser.tab.c" /* yacc.c:1646 */
  1731. break;
  1732. case 31:
  1733. #line 205 "parser.y" /* yacc.c:1646 */
  1734. {
  1735. if(AS_EX((yyvsp[-2]))->type != EX_INDEX) {
  1736. yyerror("Assigning to non-indexing expression");
  1737. YYABORT;
  1738. }
  1739. (yyval) = NEW_EX();
  1740. AS_EX((yyval))->type = EX_SETINDEX;
  1741. AS_EX((yyval))->setindex = NEW(setindex_node);
  1742. AS_EX((yyval))->setindex->expr = ex_copy(AS_EX((yyvsp[-2]))->index->expr);
  1743. AS_EX((yyval))->setindex->index = ex_copy(AS_EX((yyvsp[-2]))->index->index);
  1744. MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_MUL, AS_EX((yyvsp[-2]))->index->expr, AS_EX((yyvsp[-2]))->index->index, (yyvsp[0]));
  1745. ex_free(AS_EX((yyvsp[-2])));
  1746. }
  1747. #line 1984 "parser.tab.c" /* yacc.c:1646 */
  1748. break;
  1749. case 32:
  1750. #line 218 "parser.y" /* yacc.c:1646 */
  1751. {
  1752. if(AS_EX((yyvsp[-2]))->type != EX_INDEX) {
  1753. yyerror("Assigning to non-indexing expression");
  1754. YYABORT;
  1755. }
  1756. (yyval) = NEW_EX();
  1757. AS_EX((yyval))->type = EX_SETINDEX;
  1758. AS_EX((yyval))->setindex = NEW(setindex_node);
  1759. AS_EX((yyval))->setindex->expr = ex_copy(AS_EX((yyvsp[-2]))->index->expr);
  1760. AS_EX((yyval))->setindex->index = ex_copy(AS_EX((yyvsp[-2]))->index->index);
  1761. MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_DIV, AS_EX((yyvsp[-2]))->index->expr, AS_EX((yyvsp[-2]))->index->index, (yyvsp[0]));
  1762. ex_free(AS_EX((yyvsp[-2])));
  1763. }
  1764. #line 2002 "parser.tab.c" /* yacc.c:1646 */
  1765. break;
  1766. case 33:
  1767. #line 231 "parser.y" /* yacc.c:1646 */
  1768. {
  1769. if(AS_EX((yyvsp[-2]))->type != EX_INDEX) {
  1770. yyerror("Assigning to non-indexing expression");
  1771. YYABORT;
  1772. }
  1773. (yyval) = NEW_EX();
  1774. AS_EX((yyval))->type = EX_SETINDEX;
  1775. AS_EX((yyval))->setindex = NEW(setindex_node);
  1776. AS_EX((yyval))->setindex->expr = ex_copy(AS_EX((yyvsp[-2]))->index->expr);
  1777. AS_EX((yyval))->setindex->index = ex_copy(AS_EX((yyvsp[-2]))->index->index);
  1778. MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_POW, AS_EX((yyvsp[-2]))->index->expr, AS_EX((yyvsp[-2]))->index->index, (yyvsp[0]));
  1779. ex_free(AS_EX((yyvsp[-2])));
  1780. }
  1781. #line 2020 "parser.tab.c" /* yacc.c:1646 */
  1782. break;
  1783. case 34:
  1784. #line 244 "parser.y" /* yacc.c:1646 */
  1785. {
  1786. if(AS_EX((yyvsp[-2]))->type != EX_INDEX) {
  1787. yyerror("Assigning to non-indexing expression");
  1788. YYABORT;
  1789. }
  1790. (yyval) = NEW_EX();
  1791. AS_EX((yyval))->type = EX_SETINDEX;
  1792. AS_EX((yyval))->setindex = NEW(setindex_node);
  1793. AS_EX((yyval))->setindex->expr = ex_copy(AS_EX((yyvsp[-2]))->index->expr);
  1794. AS_EX((yyval))->setindex->index = ex_copy(AS_EX((yyvsp[-2]))->index->index);
  1795. MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_BAND, AS_EX((yyvsp[-2]))->index->expr, AS_EX((yyvsp[-2]))->index->index, (yyvsp[0]));
  1796. ex_free(AS_EX((yyvsp[-2])));
  1797. }
  1798. #line 2038 "parser.tab.c" /* yacc.c:1646 */
  1799. break;
  1800. case 35:
  1801. #line 257 "parser.y" /* yacc.c:1646 */
  1802. {
  1803. if(AS_EX((yyvsp[-2]))->type != EX_INDEX) {
  1804. yyerror("Assigning to non-indexing expression");
  1805. YYABORT;
  1806. }
  1807. (yyval) = NEW_EX();
  1808. AS_EX((yyval))->type = EX_SETINDEX;
  1809. AS_EX((yyval))->setindex = NEW(setindex_node);
  1810. AS_EX((yyval))->setindex->expr = ex_copy(AS_EX((yyvsp[-2]))->index->expr);
  1811. AS_EX((yyval))->setindex->index = ex_copy(AS_EX((yyvsp[-2]))->index->index);
  1812. MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_BOR, AS_EX((yyvsp[-2]))->index->expr, AS_EX((yyvsp[-2]))->index->index, (yyvsp[0]));
  1813. ex_free(AS_EX((yyvsp[-2])));
  1814. }
  1815. #line 2056 "parser.tab.c" /* yacc.c:1646 */
  1816. break;
  1817. case 36:
  1818. #line 270 "parser.y" /* yacc.c:1646 */
  1819. {
  1820. if(AS_EX((yyvsp[-2]))->type != EX_INDEX) {
  1821. yyerror("Assigning to non-indexing expression");
  1822. YYABORT;
  1823. }
  1824. (yyval) = NEW_EX();
  1825. AS_EX((yyval))->type = EX_SETINDEX;
  1826. AS_EX((yyval))->setindex = NEW(setindex_node);
  1827. AS_EX((yyval))->setindex->expr = ex_copy(AS_EX((yyvsp[-2]))->index->expr);
  1828. AS_EX((yyval))->setindex->index = ex_copy(AS_EX((yyvsp[-2]))->index->index);
  1829. MAKE_IDX_BINOP(AS_EX((yyval))->setindex->value, OP_BXOR, AS_EX((yyvsp[-2]))->index->expr, AS_EX((yyvsp[-2]))->index->index, (yyvsp[0]));
  1830. ex_free(AS_EX((yyvsp[-2])));
  1831. }
  1832. #line 2074 "parser.tab.c" /* yacc.c:1646 */
  1833. break;
  1834. case 37:
  1835. #line 283 "parser.y" /* yacc.c:1646 */
  1836. { (yyval) = (yyvsp[0]); }
  1837. #line 2080 "parser.tab.c" /* yacc.c:1646 */
  1838. break;
  1839. case 38:
  1840. #line 287 "parser.y" /* yacc.c:1646 */
  1841. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_LAND; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); }
  1842. #line 2086 "parser.tab.c" /* yacc.c:1646 */
  1843. break;
  1844. case 39:
  1845. #line 288 "parser.y" /* yacc.c:1646 */
  1846. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_LOR; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); }
  1847. #line 2092 "parser.tab.c" /* yacc.c:1646 */
  1848. break;
  1849. case 40:
  1850. #line 289 "parser.y" /* yacc.c:1646 */
  1851. { (yyval) = (yyvsp[0]); }
  1852. #line 2098 "parser.tab.c" /* yacc.c:1646 */
  1853. break;
  1854. case 41:
  1855. #line 293 "parser.y" /* yacc.c:1646 */
  1856. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_UNOP; AS_EX((yyval))->unop = NEW(unop_node); AS_EX((yyval))->unop->type = OP_LNOT; AS_EX((yyval))->unop->expr = (yyvsp[0]); }
  1857. #line 2104 "parser.tab.c" /* yacc.c:1646 */
  1858. break;
  1859. case 42:
  1860. #line 294 "parser.y" /* yacc.c:1646 */
  1861. { (yyval) = (yyvsp[0]); }
  1862. #line 2110 "parser.tab.c" /* yacc.c:1646 */
  1863. break;
  1864. case 43:
  1865. #line 298 "parser.y" /* yacc.c:1646 */
  1866. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_EQUAL; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); }
  1867. #line 2116 "parser.tab.c" /* yacc.c:1646 */
  1868. break;
  1869. case 44:
  1870. #line 299 "parser.y" /* yacc.c:1646 */
  1871. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_NEQUAL; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); }
  1872. #line 2122 "parser.tab.c" /* yacc.c:1646 */
  1873. break;
  1874. case 45:
  1875. #line 300 "parser.y" /* yacc.c:1646 */
  1876. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_LESS; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); }
  1877. #line 2128 "parser.tab.c" /* yacc.c:1646 */
  1878. break;
  1879. case 46:
  1880. #line 301 "parser.y" /* yacc.c:1646 */
  1881. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_GREATER; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); }
  1882. #line 2134 "parser.tab.c" /* yacc.c:1646 */
  1883. break;
  1884. case 47:
  1885. #line 302 "parser.y" /* yacc.c:1646 */
  1886. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_LESSEQ; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); }
  1887. #line 2140 "parser.tab.c" /* yacc.c:1646 */
  1888. break;
  1889. case 48:
  1890. #line 303 "parser.y" /* yacc.c:1646 */
  1891. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_GREATEREQ; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); }
  1892. #line 2146 "parser.tab.c" /* yacc.c:1646 */
  1893. break;
  1894. case 49:
  1895. #line 304 "parser.y" /* yacc.c:1646 */
  1896. { (yyval) = (yyvsp[0]); }
  1897. #line 2152 "parser.tab.c" /* yacc.c:1646 */
  1898. break;
  1899. case 50:
  1900. #line 308 "parser.y" /* yacc.c:1646 */
  1901. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_ADD; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); }
  1902. #line 2158 "parser.tab.c" /* yacc.c:1646 */
  1903. break;
  1904. case 51:
  1905. #line 309 "parser.y" /* yacc.c:1646 */
  1906. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_SUB; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); }
  1907. #line 2164 "parser.tab.c" /* yacc.c:1646 */
  1908. break;
  1909. case 52:
  1910. #line 310 "parser.y" /* yacc.c:1646 */
  1911. { (yyval) = (yyvsp[0]); }
  1912. #line 2170 "parser.tab.c" /* yacc.c:1646 */
  1913. break;
  1914. case 53:
  1915. #line 314 "parser.y" /* yacc.c:1646 */
  1916. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_MUL; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); }
  1917. #line 2176 "parser.tab.c" /* yacc.c:1646 */
  1918. break;
  1919. case 54:
  1920. #line 315 "parser.y" /* yacc.c:1646 */
  1921. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_DIV; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); }
  1922. #line 2182 "parser.tab.c" /* yacc.c:1646 */
  1923. break;
  1924. case 55:
  1925. #line 316 "parser.y" /* yacc.c:1646 */
  1926. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_MOD; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); }
  1927. #line 2188 "parser.tab.c" /* yacc.c:1646 */
  1928. break;
  1929. case 56:
  1930. #line 317 "parser.y" /* yacc.c:1646 */
  1931. { (yyval) = (yyvsp[0]); }
  1932. #line 2194 "parser.tab.c" /* yacc.c:1646 */
  1933. break;
  1934. case 57:
  1935. #line 321 "parser.y" /* yacc.c:1646 */
  1936. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_POW; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); }
  1937. #line 2200 "parser.tab.c" /* yacc.c:1646 */
  1938. break;
  1939. case 58:
  1940. #line 322 "parser.y" /* yacc.c:1646 */
  1941. { (yyval) = (yyvsp[0]); }
  1942. #line 2206 "parser.tab.c" /* yacc.c:1646 */
  1943. break;
  1944. case 59:
  1945. #line 326 "parser.y" /* yacc.c:1646 */
  1946. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_TBANG; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); }
  1947. #line 2212 "parser.tab.c" /* yacc.c:1646 */
  1948. break;
  1949. case 60:
  1950. #line 327 "parser.y" /* yacc.c:1646 */
  1951. { (yyval) = (yyvsp[0]); }
  1952. #line 2218 "parser.tab.c" /* yacc.c:1646 */
  1953. break;
  1954. case 61:
  1955. #line 332 "parser.y" /* yacc.c:1646 */
  1956. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_BAND; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); }
  1957. #line 2224 "parser.tab.c" /* yacc.c:1646 */
  1958. break;
  1959. case 62:
  1960. #line 333 "parser.y" /* yacc.c:1646 */
  1961. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_BOR; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); }
  1962. #line 2230 "parser.tab.c" /* yacc.c:1646 */
  1963. break;
  1964. case 63:
  1965. #line 334 "parser.y" /* yacc.c:1646 */
  1966. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_BXOR; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); }
  1967. #line 2236 "parser.tab.c" /* yacc.c:1646 */
  1968. break;
  1969. case 64:
  1970. #line 335 "parser.y" /* yacc.c:1646 */
  1971. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_LSHIFT; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); }
  1972. #line 2242 "parser.tab.c" /* yacc.c:1646 */
  1973. break;
  1974. case 65:
  1975. #line 336 "parser.y" /* yacc.c:1646 */
  1976. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_BINOP; AS_EX((yyval))->binop = NEW(binop_node); AS_EX((yyval))->binop->type = OP_RSHIFT; AS_EX((yyval))->binop->left = (yyvsp[-2]); AS_EX((yyval))->binop->right = (yyvsp[0]); }
  1977. #line 2248 "parser.tab.c" /* yacc.c:1646 */
  1978. break;
  1979. case 66:
  1980. #line 337 "parser.y" /* yacc.c:1646 */
  1981. { (yyval) = (yyvsp[0]); }
  1982. #line 2254 "parser.tab.c" /* yacc.c:1646 */
  1983. break;
  1984. case 67:
  1985. #line 341 "parser.y" /* yacc.c:1646 */
  1986. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_UNOP; AS_EX((yyval))->unop = NEW(unop_node); AS_EX((yyval))->unop->type = OP_BNOT; AS_EX((yyval))->unop->expr = (yyvsp[0]); }
  1987. #line 2260 "parser.tab.c" /* yacc.c:1646 */
  1988. break;
  1989. case 68:
  1990. #line 342 "parser.y" /* yacc.c:1646 */
  1991. { (yyval) = (yyvsp[0]); }
  1992. #line 2266 "parser.tab.c" /* yacc.c:1646 */
  1993. break;
  1994. case 69:
  1995. #line 346 "parser.y" /* yacc.c:1646 */
  1996. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_UNOP; AS_EX((yyval))->unop = NEW(unop_node); AS_EX((yyval))->unop->type = OP_LEN; AS_EX((yyval))->unop->expr = (yyvsp[0]); }
  1997. #line 2272 "parser.tab.c" /* yacc.c:1646 */
  1998. break;
  1999. case 70:
  2000. #line 347 "parser.y" /* yacc.c:1646 */
  2001. { (yyval) = (yyvsp[0]); }
  2002. #line 2278 "parser.tab.c" /* yacc.c:1646 */
  2003. break;
  2004. case 71:
  2005. #line 351 "parser.y" /* yacc.c:1646 */
  2006. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_CALL; AS_EX((yyval))->call = NEW(call_node); AS_EX((yyval))->call->expr = (yyvsp[-3]); AS_EX((yyval))->call->args = (yyvsp[-1]); }
  2007. #line 2284 "parser.tab.c" /* yacc.c:1646 */
  2008. break;
  2009. case 72:
  2010. #line 352 "parser.y" /* yacc.c:1646 */
  2011. {
  2012. (yyval) = NEW_EX();
  2013. AS_EX((yyval))->type = EX_CALL;
  2014. AS_EX((yyval))->call = NEW(call_node);
  2015. AS_EX((yyval))->call->expr = NEW_EX();
  2016. AS_EX((yyval))->call->expr->type = EX_INDEX;
  2017. AS_EX((yyval))->call->expr->index = NEW(index_node);
  2018. AS_EX((yyval))->call->expr->index->expr = (yyvsp[-5]);
  2019. AS_EX((yyval))->call->expr->index->index = NEW_EX();
  2020. AS_EX((yyval))->call->expr->index->index->type = EX_LIT;
  2021. AS_EX((yyval))->call->expr->index->index->lit = NEW(lit_node);
  2022. AS_EX((yyval))->call->expr->index->index->lit->type = LIT_STRING;
  2023. AS_EX((yyval))->call->expr->index->index->lit->str = (yyvsp[-3]);
  2024. AS_EX((yyval))->call->args = NEW(exprlist_node);
  2025. AS_EX((yyval))->call->args->expr = ex_copy((yyvsp[-5]));
  2026. AS_EX((yyval))->call->args->next = (yyvsp[-1]);
  2027. }
  2028. #line 2306 "parser.tab.c" /* yacc.c:1646 */
  2029. break;
  2030. case 73:
  2031. #line 369 "parser.y" /* yacc.c:1646 */
  2032. { (yyval) = (yyvsp[0]); }
  2033. #line 2312 "parser.tab.c" /* yacc.c:1646 */
  2034. break;
  2035. case 74:
  2036. #line 373 "parser.y" /* yacc.c:1646 */
  2037. {
  2038. (yyval) = NEW_EX();
  2039. AS_EX((yyval))->type = EX_FUNCDECL;
  2040. AS_EX((yyval))->funcdecl = NEW(funcdecl_node);
  2041. AS_EX((yyval))->funcdecl->name = (yyvsp[-5]);
  2042. AS_EX((yyval))->funcdecl->args = (yyvsp[-3]);
  2043. AS_EX((yyval))->funcdecl->body = (yyvsp[-1]);
  2044. }
  2045. #line 2325 "parser.tab.c" /* yacc.c:1646 */
  2046. break;
  2047. case 75:
  2048. #line 381 "parser.y" /* yacc.c:1646 */
  2049. {
  2050. (yyval) = NEW_EX();
  2051. AS_EX((yyval))->type = EX_FUNCDECL;
  2052. AS_EX((yyval))->funcdecl = NEW(funcdecl_node);
  2053. AS_EX((yyval))->funcdecl->name = NULL;
  2054. AS_EX((yyval))->funcdecl->args = (yyvsp[-3]);
  2055. AS_EX((yyval))->funcdecl->body = (yyvsp[-1]);
  2056. }
  2057. #line 2338 "parser.tab.c" /* yacc.c:1646 */
  2058. break;
  2059. case 76:
  2060. #line 389 "parser.y" /* yacc.c:1646 */
  2061. {
  2062. (yyval) = NEW_EX();
  2063. AS_EX((yyval))->type = EX_FUNCDECL;
  2064. AS_EX((yyval))->funcdecl = NEW(funcdecl_node);
  2065. AS_EX((yyval))->funcdecl->name = NULL;
  2066. AS_EX((yyval))->funcdecl->args = (yyvsp[-3]);
  2067. AS_EX((yyval))->funcdecl->body = NEW_ST();
  2068. AS_EX((yyval))->funcdecl->body->type = ST_RET;
  2069. AS_EX((yyval))->funcdecl->body->ret = NEW(ret_node);
  2070. AS_EX((yyval))->funcdecl->body->ret->ret = (yyvsp[-1]);
  2071. }
  2072. #line 2354 "parser.tab.c" /* yacc.c:1646 */
  2073. break;
  2074. case 77:
  2075. #line 400 "parser.y" /* yacc.c:1646 */
  2076. { (yyval) = (yyvsp[0]); }
  2077. #line 2360 "parser.tab.c" /* yacc.c:1646 */
  2078. break;
  2079. case 78:
  2080. #line 404 "parser.y" /* yacc.c:1646 */
  2081. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_INDEX; AS_EX((yyval))->index = NEW(index_node); AS_EX((yyval))->index->expr = (yyvsp[-3]); AS_EX((yyval))->index->index = (yyvsp[-1]); }
  2082. #line 2366 "parser.tab.c" /* yacc.c:1646 */
  2083. break;
  2084. case 79:
  2085. #line 405 "parser.y" /* yacc.c:1646 */
  2086. {
  2087. (yyval) = NEW_EX();
  2088. AS_EX((yyval))->type = EX_INDEX;
  2089. AS_EX((yyval))->index = NEW(index_node);
  2090. AS_EX((yyval))->index->expr = (yyvsp[-2]);
  2091. AS_EX((yyval))->index->index = NEW_EX();
  2092. AS_EX((yyval))->index->index->type = EX_LIT;
  2093. AS_EX((yyval))->index->index->lit = NEW(lit_node);
  2094. AS_EX((yyval))->index->index->lit->type = LIT_STRING;
  2095. AS_EX((yyval))->index->index->lit->str = (yyvsp[0]);
  2096. }
  2097. #line 2382 "parser.tab.c" /* yacc.c:1646 */
  2098. break;
  2099. case 80:
  2100. #line 416 "parser.y" /* yacc.c:1646 */
  2101. { (yyval) = (yyvsp[0]); }
  2102. #line 2388 "parser.tab.c" /* yacc.c:1646 */
  2103. break;
  2104. case 81:
  2105. #line 420 "parser.y" /* yacc.c:1646 */
  2106. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_INDEX; AS_EX((yyval))->index = NEW(index_node); AS_EX((yyval))->index->expr = (yyvsp[-3]); AS_EX((yyval))->index->index = (yyvsp[-1]); }
  2107. #line 2394 "parser.tab.c" /* yacc.c:1646 */
  2108. break;
  2109. case 82:
  2110. #line 421 "parser.y" /* yacc.c:1646 */
  2111. {
  2112. (yyval) = NEW_EX();
  2113. AS_EX((yyval))->type = EX_INDEX;
  2114. AS_EX((yyval))->index = NEW(index_node);
  2115. AS_EX((yyval))->index->expr = (yyvsp[-2]);
  2116. AS_EX((yyval))->index->index = NEW_EX();
  2117. AS_EX((yyval))->index->index->type = EX_LIT;
  2118. AS_EX((yyval))->index->index->lit = NEW(lit_node);
  2119. AS_EX((yyval))->index->index->lit->type = LIT_STRING;
  2120. AS_EX((yyval))->index->index->lit->str = (yyvsp[0]);
  2121. }
  2122. #line 2410 "parser.tab.c" /* yacc.c:1646 */
  2123. break;
  2124. case 83:
  2125. #line 435 "parser.y" /* yacc.c:1646 */
  2126. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_REF; AS_EX((yyval))->ref = NEW(ref_node); AS_EX((yyval))->ref->ident = (yyvsp[0]); }
  2127. #line 2416 "parser.tab.c" /* yacc.c:1646 */
  2128. break;
  2129. case 84:
  2130. #line 436 "parser.y" /* yacc.c:1646 */
  2131. { (yyval) = (yyvsp[0]); }
  2132. #line 2422 "parser.tab.c" /* yacc.c:1646 */
  2133. break;
  2134. case 85:
  2135. #line 440 "parser.y" /* yacc.c:1646 */
  2136. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_LIT; AS_EX((yyval))->lit = NEW(lit_node); AS_EX((yyval))->lit->type = LIT_INT; AS_EX((yyval))->lit->ival = *AS((yyvsp[0]), long); free((yyvsp[0])); }
  2137. #line 2428 "parser.tab.c" /* yacc.c:1646 */
  2138. break;
  2139. case 86:
  2140. #line 441 "parser.y" /* yacc.c:1646 */
  2141. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_LIT; AS_EX((yyval))->lit = NEW(lit_node); AS_EX((yyval))->lit->type = LIT_INT; AS_EX((yyval))->lit->ival = -(*AS((yyvsp[0]), long)); free((yyvsp[0])); }
  2142. #line 2434 "parser.tab.c" /* yacc.c:1646 */
  2143. break;
  2144. case 87:
  2145. #line 442 "parser.y" /* yacc.c:1646 */
  2146. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_LIT; AS_EX((yyval))->lit = NEW(lit_node); AS_EX((yyval))->lit->type = LIT_FLOAT; AS_EX((yyval))->lit->fval = *AS((yyvsp[0]), double); free((yyvsp[0])); }
  2147. #line 2440 "parser.tab.c" /* yacc.c:1646 */
  2148. break;
  2149. case 88:
  2150. #line 443 "parser.y" /* yacc.c:1646 */
  2151. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_LIT; AS_EX((yyval))->lit = NEW(lit_node); AS_EX((yyval))->lit->type = LIT_STRING; AS_EX((yyval))->lit->str = (yyvsp[0]); }
  2152. #line 2446 "parser.tab.c" /* yacc.c:1646 */
  2153. break;
  2154. case 89:
  2155. #line 444 "parser.y" /* yacc.c:1646 */
  2156. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_LIT; AS_EX((yyval))->lit = NEW(lit_node); AS_EX((yyval))->lit->type = LIT_NONE; }
  2157. #line 2452 "parser.tab.c" /* yacc.c:1646 */
  2158. break;
  2159. case 90:
  2160. #line 445 "parser.y" /* yacc.c:1646 */
  2161. { (yyval) = (yyvsp[0]); }
  2162. #line 2458 "parser.tab.c" /* yacc.c:1646 */
  2163. break;
  2164. case 91:
  2165. #line 449 "parser.y" /* yacc.c:1646 */
  2166. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_LISTGEN; AS_EX((yyval))->listgen = NEW(listgen_node); AS_EX((yyval))->listgen->list = (yyvsp[-1]); }
  2167. #line 2464 "parser.tab.c" /* yacc.c:1646 */
  2168. break;
  2169. case 92:
  2170. #line 450 "parser.y" /* yacc.c:1646 */
  2171. { (yyval) = NEW_EX(); AS_EX((yyval))->type = EX_MAPGEN; AS_EX((yyval))->mapgen = NEW(mapgen_node); AS_EX((yyval))->mapgen->map = (yyvsp[-1]); }
  2172. #line 2470 "parser.tab.c" /* yacc.c:1646 */
  2173. break;
  2174. case 93:
  2175. #line 451 "parser.y" /* yacc.c:1646 */
  2176. { (yyval) = (yyvsp[0]); }
  2177. #line 2476 "parser.tab.c" /* yacc.c:1646 */
  2178. break;
  2179. case 94:
  2180. #line 455 "parser.y" /* yacc.c:1646 */
  2181. { (yyval) = (yyvsp[-1]); }
  2182. #line 2482 "parser.tab.c" /* yacc.c:1646 */
  2183. break;
  2184. case 95:
  2185. #line 459 "parser.y" /* yacc.c:1646 */
  2186. { (yyval) = NULL; }
  2187. #line 2488 "parser.tab.c" /* yacc.c:1646 */
  2188. break;
  2189. case 96:
  2190. #line 460 "parser.y" /* yacc.c:1646 */
  2191. {
  2192. (yyval) = NEW(exprlist_node);
  2193. AS((yyval), exprlist_node)->expr = (yyvsp[0]);
  2194. AS((yyval), exprlist_node)->next = NULL;
  2195. }
  2196. #line 2498 "parser.tab.c" /* yacc.c:1646 */
  2197. break;
  2198. case 97:
  2199. #line 465 "parser.y" /* yacc.c:1646 */
  2200. { (yyval) = (yyvsp[-1]); }
  2201. #line 2504 "parser.tab.c" /* yacc.c:1646 */
  2202. break;
  2203. case 98:
  2204. #line 466 "parser.y" /* yacc.c:1646 */
  2205. {
  2206. exprlist_node *cur = (yyvsp[-1]);
  2207. while(cur->next) cur = cur->next;
  2208. cur->next = NEW(exprlist_node);
  2209. cur = cur->next;
  2210. cur->expr = (yyvsp[0]);
  2211. cur->next = NULL;
  2212. (yyval) = (yyvsp[-1]);
  2213. }
  2214. #line 2518 "parser.tab.c" /* yacc.c:1646 */
  2215. break;
  2216. case 99:
  2217. #line 478 "parser.y" /* yacc.c:1646 */
  2218. { (yyval) = NULL; }
  2219. #line 2524 "parser.tab.c" /* yacc.c:1646 */
  2220. break;
  2221. case 100:
  2222. #line 479 "parser.y" /* yacc.c:1646 */
  2223. {
  2224. (yyval) = NEW(identlist_node);
  2225. AS((yyval), identlist_node)->ident = (yyvsp[0]);
  2226. AS((yyval), identlist_node)->next = NULL;
  2227. }
  2228. #line 2534 "parser.tab.c" /* yacc.c:1646 */
  2229. break;
  2230. case 101:
  2231. #line 484 "parser.y" /* yacc.c:1646 */
  2232. { (yyval) = (yyvsp[-1]); }
  2233. #line 2540 "parser.tab.c" /* yacc.c:1646 */
  2234. break;
  2235. case 102:
  2236. #line 485 "parser.y" /* yacc.c:1646 */
  2237. {
  2238. identlist_node *cur = (yyvsp[-1]);
  2239. while(cur->next) cur = cur->next;
  2240. cur->next = NEW(identlist_node);
  2241. cur = cur->next;
  2242. cur->ident = (yyvsp[0]);
  2243. cur->next = NULL;
  2244. (yyval) = (yyvsp[-1]);
  2245. }
  2246. #line 2554 "parser.tab.c" /* yacc.c:1646 */
  2247. break;
  2248. case 103:
  2249. #line 497 "parser.y" /* yacc.c:1646 */
  2250. { (yyval) = NULL; }
  2251. #line 2560 "parser.tab.c" /* yacc.c:1646 */
  2252. break;
  2253. case 104:
  2254. #line 498 "parser.y" /* yacc.c:1646 */
  2255. {
  2256. (yyval) = NEW(assoclist_node);
  2257. AS((yyval), assoclist_node)->item = (yyvsp[0]);
  2258. AS((yyval), assoclist_node)->next = NULL;
  2259. }
  2260. #line 2570 "parser.tab.c" /* yacc.c:1646 */
  2261. break;
  2262. case 105:
  2263. #line 503 "parser.y" /* yacc.c:1646 */
  2264. { (yyval) = (yyvsp[-1]); }
  2265. #line 2576 "parser.tab.c" /* yacc.c:1646 */
  2266. break;
  2267. case 106:
  2268. #line 504 "parser.y" /* yacc.c:1646 */
  2269. {
  2270. assoclist_node *cur = (yyvsp[-1]);
  2271. while(cur->next) cur = cur->next;
  2272. cur->next = NEW(assoclist_node);
  2273. cur = cur->next;
  2274. cur->item = (yyvsp[0]);
  2275. cur->next = NULL;
  2276. (yyval) = (yyvsp[-1]);
  2277. }
  2278. #line 2590 "parser.tab.c" /* yacc.c:1646 */
  2279. break;
  2280. case 107:
  2281. #line 516 "parser.y" /* yacc.c:1646 */
  2282. {
  2283. (yyval) = NEW(associtem_node);
  2284. AS((yyval), associtem_node)->key = (yyvsp[-3]);
  2285. AS((yyval), associtem_node)->value = (yyvsp[0]);
  2286. }
  2287. #line 2600 "parser.tab.c" /* yacc.c:1646 */
  2288. break;
  2289. case 108:
  2290. #line 521 "parser.y" /* yacc.c:1646 */
  2291. {
  2292. (yyval) = NEW(associtem_node);
  2293. AS((yyval), associtem_node)->key = NEW_EX();
  2294. AS((yyval), associtem_node)->key->type = EX_LIT;
  2295. AS((yyval), associtem_node)->key->lit = NEW(lit_node);
  2296. AS((yyval), associtem_node)->key->lit->type = LIT_STRING;
  2297. AS((yyval), associtem_node)->key->lit->str = (yyvsp[-2]);
  2298. AS((yyval), associtem_node)->value = (yyvsp[0]);
  2299. }
  2300. #line 2614 "parser.tab.c" /* yacc.c:1646 */
  2301. break;
  2302. #line 2618 "parser.tab.c" /* yacc.c:1646 */
  2303. default: break;
  2304. }
  2305. /* User semantic actions sometimes alter yychar, and that requires
  2306. that yytoken be updated with the new translation. We take the
  2307. approach of translating immediately before every use of yytoken.
  2308. One alternative is translating here after every semantic action,
  2309. but that translation would be missed if the semantic action invokes
  2310. YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
  2311. if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
  2312. incorrect destructor might then be invoked immediately. In the
  2313. case of YYERROR or YYBACKUP, subsequent parser actions might lead
  2314. to an incorrect destructor call or verbose syntax error message
  2315. before the lookahead is translated. */
  2316. YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
  2317. YYPOPSTACK (yylen);
  2318. yylen = 0;
  2319. YY_STACK_PRINT (yyss, yyssp);
  2320. *++yyvsp = yyval;
  2321. *++yylsp = yyloc;
  2322. /* Now 'shift' the result of the reduction. Determine what state
  2323. that goes to, based on the state we popped back to and the rule
  2324. number reduced by. */
  2325. yyn = yyr1[yyn];
  2326. yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  2327. if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  2328. yystate = yytable[yystate];
  2329. else
  2330. yystate = yydefgoto[yyn - YYNTOKENS];
  2331. goto yynewstate;
  2332. /*--------------------------------------.
  2333. | yyerrlab -- here on detecting error. |
  2334. `--------------------------------------*/
  2335. yyerrlab:
  2336. /* Make sure we have latest lookahead translation. See comments at
  2337. user semantic actions for why this is necessary. */
  2338. yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
  2339. /* If not already recovering from an error, report this error. */
  2340. if (!yyerrstatus)
  2341. {
  2342. ++yynerrs;
  2343. #if ! YYERROR_VERBOSE
  2344. yyerror (&yylloc, program, YY_("syntax error"));
  2345. #else
  2346. # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
  2347. yyssp, yytoken)
  2348. {
  2349. char const *yymsgp = YY_("syntax error");
  2350. int yysyntax_error_status;
  2351. yysyntax_error_status = YYSYNTAX_ERROR;
  2352. if (yysyntax_error_status == 0)
  2353. yymsgp = yymsg;
  2354. else if (yysyntax_error_status == 1)
  2355. {
  2356. if (yymsg != yymsgbuf)
  2357. YYSTACK_FREE (yymsg);
  2358. yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
  2359. if (!yymsg)
  2360. {
  2361. yymsg = yymsgbuf;
  2362. yymsg_alloc = sizeof yymsgbuf;
  2363. yysyntax_error_status = 2;
  2364. }
  2365. else
  2366. {
  2367. yysyntax_error_status = YYSYNTAX_ERROR;
  2368. yymsgp = yymsg;
  2369. }
  2370. }
  2371. yyerror (&yylloc, program, yymsgp);
  2372. if (yysyntax_error_status == 2)
  2373. goto yyexhaustedlab;
  2374. }
  2375. # undef YYSYNTAX_ERROR
  2376. #endif
  2377. }
  2378. yyerror_range[1] = yylloc;
  2379. if (yyerrstatus == 3)
  2380. {
  2381. /* If just tried and failed to reuse lookahead token after an
  2382. error, discard it. */
  2383. if (yychar <= YYEOF)
  2384. {
  2385. /* Return failure if at end of input. */
  2386. if (yychar == YYEOF)
  2387. YYABORT;
  2388. }
  2389. else
  2390. {
  2391. yydestruct ("Error: discarding",
  2392. yytoken, &yylval, &yylloc, program);
  2393. yychar = YYEMPTY;
  2394. }
  2395. }
  2396. /* Else will try to reuse lookahead token after shifting the error
  2397. token. */
  2398. goto yyerrlab1;
  2399. /*---------------------------------------------------.
  2400. | yyerrorlab -- error raised explicitly by YYERROR. |
  2401. `---------------------------------------------------*/
  2402. yyerrorlab:
  2403. /* Pacify compilers like GCC when the user code never invokes
  2404. YYERROR and the label yyerrorlab therefore never appears in user
  2405. code. */
  2406. if (/*CONSTCOND*/ 0)
  2407. goto yyerrorlab;
  2408. yyerror_range[1] = yylsp[1-yylen];
  2409. /* Do not reclaim the symbols of the rule whose action triggered
  2410. this YYERROR. */
  2411. YYPOPSTACK (yylen);
  2412. yylen = 0;
  2413. YY_STACK_PRINT (yyss, yyssp);
  2414. yystate = *yyssp;
  2415. goto yyerrlab1;
  2416. /*-------------------------------------------------------------.
  2417. | yyerrlab1 -- common code for both syntax error and YYERROR. |
  2418. `-------------------------------------------------------------*/
  2419. yyerrlab1:
  2420. yyerrstatus = 3; /* Each real token shifted decrements this. */
  2421. for (;;)
  2422. {
  2423. yyn = yypact[yystate];
  2424. if (!yypact_value_is_default (yyn))
  2425. {
  2426. yyn += YYTERROR;
  2427. if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
  2428. {
  2429. yyn = yytable[yyn];
  2430. if (0 < yyn)
  2431. break;
  2432. }
  2433. }
  2434. /* Pop the current state because it cannot handle the error token. */
  2435. if (yyssp == yyss)
  2436. YYABORT;
  2437. yyerror_range[1] = *yylsp;
  2438. yydestruct ("Error: popping",
  2439. yystos[yystate], yyvsp, yylsp, program);
  2440. YYPOPSTACK (1);
  2441. yystate = *yyssp;
  2442. YY_STACK_PRINT (yyss, yyssp);
  2443. }
  2444. YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  2445. *++yyvsp = yylval;
  2446. YY_IGNORE_MAYBE_UNINITIALIZED_END
  2447. yyerror_range[2] = yylloc;
  2448. /* Using YYLLOC is tempting, but would change the location of
  2449. the lookahead. YYLOC is available though. */
  2450. YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
  2451. *++yylsp = yyloc;
  2452. /* Shift the error token. */
  2453. YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
  2454. yystate = yyn;
  2455. goto yynewstate;
  2456. /*-------------------------------------.
  2457. | yyacceptlab -- YYACCEPT comes here. |
  2458. `-------------------------------------*/
  2459. yyacceptlab:
  2460. yyresult = 0;
  2461. goto yyreturn;
  2462. /*-----------------------------------.
  2463. | yyabortlab -- YYABORT comes here. |
  2464. `-----------------------------------*/
  2465. yyabortlab:
  2466. yyresult = 1;
  2467. goto yyreturn;
  2468. #if !defined yyoverflow || YYERROR_VERBOSE
  2469. /*-------------------------------------------------.
  2470. | yyexhaustedlab -- memory exhaustion comes here. |
  2471. `-------------------------------------------------*/
  2472. yyexhaustedlab:
  2473. yyerror (&yylloc, program, YY_("memory exhausted"));
  2474. yyresult = 2;
  2475. /* Fall through. */
  2476. #endif
  2477. yyreturn:
  2478. if (yychar != YYEMPTY)
  2479. {
  2480. /* Make sure we have latest lookahead translation. See comments at
  2481. user semantic actions for why this is necessary. */
  2482. yytoken = YYTRANSLATE (yychar);
  2483. yydestruct ("Cleanup: discarding lookahead",
  2484. yytoken, &yylval, &yylloc, program);
  2485. }
  2486. /* Do not reclaim the symbols of the rule whose action triggered
  2487. this YYABORT or YYACCEPT. */
  2488. YYPOPSTACK (yylen);
  2489. YY_STACK_PRINT (yyss, yyssp);
  2490. while (yyssp != yyss)
  2491. {
  2492. yydestruct ("Cleanup: popping",
  2493. yystos[*yyssp], yyvsp, yylsp, program);
  2494. YYPOPSTACK (1);
  2495. }
  2496. #ifndef yyoverflow
  2497. if (yyss != yyssa)
  2498. YYSTACK_FREE (yyss);
  2499. #endif
  2500. #if YYERROR_VERBOSE
  2501. if (yymsg != yymsgbuf)
  2502. YYSTACK_FREE (yymsg);
  2503. #endif
  2504. return yyresult;
  2505. }
  2506. #line 532 "parser.y" /* yacc.c:1906 */
  2507. // TODO