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

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