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 106KB

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