1
0

y.tab.c 63 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191
  1. /* A Bison parser, made by GNU Bison 2.3. */
  2. /* Skeleton implementation for Bison's Yacc-like parsers in C
  3. Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
  4. Free Software Foundation, Inc.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2, or (at your option)
  8. any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin Street, Fifth Floor,
  16. Boston, MA 02110-1301, USA. */
  17. /* As a special exception, you may create a larger work that contains
  18. part or all of the Bison parser skeleton and distribute that work
  19. under terms of your choice, so long as that work isn't itself a
  20. parser generator using the skeleton or a modified version thereof
  21. as a parser skeleton. Alternatively, if you modify or redistribute
  22. the parser skeleton itself, you may (at your option) remove this
  23. special exception, which will cause the skeleton and the resulting
  24. Bison output files to be licensed under the GNU General Public
  25. License without this special exception.
  26. This special exception was added by the Free Software Foundation in
  27. version 2.2 of Bison. */
  28. /* C LALR(1) parser skeleton written by Richard Stallman, by
  29. simplifying the original so-called "semantic" parser. */
  30. /* All symbols defined below should begin with yy or YY, to avoid
  31. infringing on user name space. This should be done even for local
  32. variables, as they might otherwise be expanded by user macros.
  33. There are some unavoidable exceptions within include files to
  34. define necessary library symbols; they are noted "INFRINGES ON
  35. USER NAME SPACE" below. */
  36. #include "ns-eel-int.h"
  37. /* Identify Bison output. */
  38. #define YYBISON 1
  39. /* Bison version. */
  40. #define YYBISON_VERSION "2.3"
  41. /* Skeleton name. */
  42. #define YYSKELETON_NAME "yacc.c"
  43. /* Pure parsers. */
  44. #define YYPURE 1
  45. /* Using locations. */
  46. #define YYLSP_NEEDED 1
  47. extern int nseellex(opcodeRec** output, YYLTYPE* yylloc_param, compileContext* scctx);
  48. extern void nseelerror(YYLTYPE* pos, compileContext* ctx, const char* str);
  49. /* Substitute the variable and function names. */
  50. #define yyparse nseelparse
  51. #define yylex nseellex
  52. #define yyerror nseelerror
  53. #define yylval nseellval
  54. #define yychar nseelchar
  55. #define yydebug nseeldebug
  56. #define yynerrs nseelnerrs
  57. #define yylloc nseellloc
  58. /* Tokens. */
  59. #ifndef YYTOKENTYPE
  60. # define YYTOKENTYPE
  61. /* Put the tokens into the symbol table, so that GDB and other debuggers
  62. know about them. */
  63. enum yytokentype {
  64. VALUE = 258,
  65. IDENTIFIER = 259,
  66. TOKEN_SHL = 260,
  67. TOKEN_SHR = 261,
  68. TOKEN_LTE = 262,
  69. TOKEN_GTE = 263,
  70. TOKEN_EQ = 264,
  71. TOKEN_EQ_EXACT = 265,
  72. TOKEN_NE = 266,
  73. TOKEN_NE_EXACT = 267,
  74. TOKEN_LOGICAL_AND = 268,
  75. TOKEN_LOGICAL_OR = 269,
  76. TOKEN_ADD_OP = 270,
  77. TOKEN_SUB_OP = 271,
  78. TOKEN_MOD_OP = 272,
  79. TOKEN_OR_OP = 273,
  80. TOKEN_AND_OP = 274,
  81. TOKEN_XOR_OP = 275,
  82. TOKEN_DIV_OP = 276,
  83. TOKEN_MUL_OP = 277,
  84. TOKEN_POW_OP = 278,
  85. STRING_LITERAL = 279,
  86. STRING_IDENTIFIER = 280
  87. };
  88. #endif
  89. /* Tokens. */
  90. #define VALUE 258
  91. #define IDENTIFIER 259
  92. #define TOKEN_SHL 260
  93. #define TOKEN_SHR 261
  94. #define TOKEN_LTE 262
  95. #define TOKEN_GTE 263
  96. #define TOKEN_EQ 264
  97. #define TOKEN_EQ_EXACT 265
  98. #define TOKEN_NE 266
  99. #define TOKEN_NE_EXACT 267
  100. #define TOKEN_LOGICAL_AND 268
  101. #define TOKEN_LOGICAL_OR 269
  102. #define TOKEN_ADD_OP 270
  103. #define TOKEN_SUB_OP 271
  104. #define TOKEN_MOD_OP 272
  105. #define TOKEN_OR_OP 273
  106. #define TOKEN_AND_OP 274
  107. #define TOKEN_XOR_OP 275
  108. #define TOKEN_DIV_OP 276
  109. #define TOKEN_MUL_OP 277
  110. #define TOKEN_POW_OP 278
  111. #define STRING_LITERAL 279
  112. #define STRING_IDENTIFIER 280
  113. /* Copy the first part of user declarations. */
  114. #line 13 "eel2.y"
  115. #ifdef _WIN32
  116. #include <windows.h>
  117. #endif
  118. #include <stdlib.h>
  119. #include <stdio.h>
  120. #include <string.h>
  121. #include <math.h>
  122. #include "y.tab.h"
  123. #include "ns-eel-int.h"
  124. #define scanner context->scanner
  125. #define YY_(x) ("")
  126. /* Enabling traces. */
  127. #ifndef YYDEBUG
  128. # define YYDEBUG 0
  129. #endif
  130. /* Enabling verbose error messages. */
  131. #ifdef YYERROR_VERBOSE
  132. # undef YYERROR_VERBOSE
  133. # define YYERROR_VERBOSE 1
  134. #else
  135. # define YYERROR_VERBOSE 0
  136. #endif
  137. /* Enabling the token table. */
  138. #ifndef YYTOKEN_TABLE
  139. # define YYTOKEN_TABLE 0
  140. #endif
  141. #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
  142. typedef int YYSTYPE;
  143. # define yystype YYSTYPE /* obsolescent; will be withdrawn */
  144. # define YYSTYPE_IS_DECLARED 1
  145. # define YYSTYPE_IS_TRIVIAL 1
  146. #endif
  147. #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
  148. typedef struct YYLTYPE
  149. {
  150. int first_line;
  151. int first_column;
  152. int last_line;
  153. int last_column;
  154. } YYLTYPE;
  155. # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
  156. # define YYLTYPE_IS_DECLARED 1
  157. # define YYLTYPE_IS_TRIVIAL 1
  158. #endif
  159. /* Copy the second part of user declarations. */
  160. /* Line 216 of yacc.c. */
  161. #line 193 "y.tab.c"
  162. #ifdef short
  163. # undef short
  164. #endif
  165. #ifdef YYTYPE_UINT8
  166. typedef YYTYPE_UINT8 yytype_uint8;
  167. #else
  168. typedef unsigned char yytype_uint8;
  169. #endif
  170. #ifdef YYTYPE_INT8
  171. typedef YYTYPE_INT8 yytype_int8;
  172. #elif (defined __STDC__ || defined __C99__FUNC__ \
  173. || defined __cplusplus || defined _MSC_VER)
  174. typedef signed char yytype_int8;
  175. #else
  176. typedef short int yytype_int8;
  177. #endif
  178. #ifdef YYTYPE_UINT16
  179. typedef YYTYPE_UINT16 yytype_uint16;
  180. #else
  181. typedef unsigned short int yytype_uint16;
  182. #endif
  183. #ifdef YYTYPE_INT16
  184. typedef YYTYPE_INT16 yytype_int16;
  185. #else
  186. typedef short int yytype_int16;
  187. #endif
  188. #ifndef YYSIZE_T
  189. # ifdef __SIZE_TYPE__
  190. # define YYSIZE_T __SIZE_TYPE__
  191. # elif defined size_t
  192. # define YYSIZE_T size_t
  193. # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
  194. || defined __cplusplus || defined _MSC_VER)
  195. # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
  196. # define YYSIZE_T size_t
  197. # else
  198. # define YYSIZE_T unsigned int
  199. # endif
  200. #endif
  201. #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
  202. #ifndef YY_
  203. # if defined YYENABLE_NLS && YYENABLE_NLS
  204. # if ENABLE_NLS
  205. # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
  206. # define YY_(msgid) dgettext ("bison-runtime", msgid)
  207. # endif
  208. # endif
  209. # ifndef YY_
  210. # define YY_(msgid) msgid
  211. # endif
  212. #endif
  213. /* Suppress unused-variable warnings by "using" E. */
  214. #if ! defined lint || defined __GNUC__
  215. # define YYUSE(e) ((void) (e))
  216. #else
  217. # define YYUSE(e) /* empty */
  218. #endif
  219. /* Identity function, used to suppress warnings about constant conditions. */
  220. #ifndef lint
  221. # define YYID(n) (n)
  222. #else
  223. #if (defined __STDC__ || defined __C99__FUNC__ \
  224. || defined __cplusplus || defined _MSC_VER)
  225. static int
  226. YYID (int i)
  227. #else
  228. static int
  229. YYID (i)
  230. int i;
  231. #endif
  232. {
  233. return i;
  234. }
  235. #endif
  236. #if ! defined yyoverflow || YYERROR_VERBOSE
  237. /* The parser invokes alloca or malloc; define the necessary symbols. */
  238. # ifdef YYSTACK_USE_ALLOCA
  239. # if YYSTACK_USE_ALLOCA
  240. # ifdef __GNUC__
  241. # define YYSTACK_ALLOC __builtin_alloca
  242. # elif defined __BUILTIN_VA_ARG_INCR
  243. # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
  244. # elif defined _AIX
  245. # define YYSTACK_ALLOC __alloca
  246. # elif defined _MSC_VER
  247. # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
  248. # define alloca _alloca
  249. # else
  250. # define YYSTACK_ALLOC alloca
  251. # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
  252. || defined __cplusplus || defined _MSC_VER)
  253. # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  254. # ifndef _STDLIB_H
  255. # define _STDLIB_H 1
  256. # endif
  257. # endif
  258. # endif
  259. # endif
  260. # endif
  261. # ifdef YYSTACK_ALLOC
  262. /* Pacify GCC's `empty if-body' warning. */
  263. # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
  264. # ifndef YYSTACK_ALLOC_MAXIMUM
  265. /* The OS might guarantee only one guard page at the bottom of the stack,
  266. and a page size can be as small as 4096 bytes. So we cannot safely
  267. invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
  268. to allow for a few compiler-allocated temporary stack slots. */
  269. # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
  270. # endif
  271. # else
  272. # define YYSTACK_ALLOC YYMALLOC
  273. # define YYSTACK_FREE YYFREE
  274. # ifndef YYSTACK_ALLOC_MAXIMUM
  275. # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
  276. # endif
  277. # if (defined __cplusplus && ! defined _STDLIB_H \
  278. && ! ((defined YYMALLOC || defined malloc) \
  279. && (defined YYFREE || defined free)))
  280. # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  281. # ifndef _STDLIB_H
  282. # define _STDLIB_H 1
  283. # endif
  284. # endif
  285. # ifndef YYMALLOC
  286. # define YYMALLOC malloc
  287. # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
  288. || defined __cplusplus || defined _MSC_VER)
  289. void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
  290. # endif
  291. # endif
  292. # ifndef YYFREE
  293. # define YYFREE free
  294. # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
  295. || defined __cplusplus || defined _MSC_VER)
  296. void free (void *); /* INFRINGES ON USER NAME SPACE */
  297. # endif
  298. # endif
  299. # endif
  300. #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
  301. #if (! defined yyoverflow \
  302. && (! defined __cplusplus \
  303. || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
  304. && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
  305. /* A type that is properly aligned for any stack member. */
  306. union yyalloc
  307. {
  308. yytype_int16 yyss;
  309. YYSTYPE yyvs;
  310. YYLTYPE yyls;
  311. };
  312. /* The size of the maximum gap between one aligned stack and the next. */
  313. # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
  314. /* The size of an array large to enough to hold all stacks, each with
  315. N elements. */
  316. # define YYSTACK_BYTES(N) \
  317. ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
  318. + 2 * YYSTACK_GAP_MAXIMUM)
  319. /* Copy COUNT objects from FROM to TO. The source and destination do
  320. not overlap. */
  321. # ifndef YYCOPY
  322. # if defined __GNUC__ && 1 < __GNUC__
  323. # define YYCOPY(To, From, Count) \
  324. __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
  325. # else
  326. # define YYCOPY(To, From, Count) \
  327. do \
  328. { \
  329. YYSIZE_T yyi; \
  330. for (yyi = 0; yyi < (Count); yyi++) \
  331. (To)[yyi] = (From)[yyi]; \
  332. } \
  333. while (YYID (0))
  334. # endif
  335. # endif
  336. /* Relocate STACK from its old location to the new one. The
  337. local variables YYSIZE and YYSTACKSIZE give the old and new number of
  338. elements in the stack, and YYPTR gives the new location of the
  339. stack. Advance YYPTR to a properly aligned location for the next
  340. stack. */
  341. # define YYSTACK_RELOCATE(Stack) \
  342. do \
  343. { \
  344. YYSIZE_T yynewbytes; \
  345. YYCOPY (&yyptr->Stack, Stack, yysize); \
  346. Stack = &yyptr->Stack; \
  347. yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
  348. yyptr += yynewbytes / sizeof (*yyptr); \
  349. } \
  350. while (YYID (0))
  351. #endif
  352. /* YYFINAL -- State number of the termination state. */
  353. #define YYFINAL 68
  354. /* YYLAST -- Last index in YYTABLE. */
  355. #define YYLAST 141
  356. /* YYNTOKENS -- Number of terminals. */
  357. #define YYNTOKENS 47
  358. /* YYNNTS -- Number of nonterminals. */
  359. #define YYNNTS 19
  360. /* YYNRULES -- Number of rules. */
  361. #define YYNRULES 73
  362. /* YYNRULES -- Number of states. */
  363. #define YYNSTATES 127
  364. /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
  365. #define YYUNDEFTOK 2
  366. #define YYMAXUTOK 280
  367. #define YYTRANSLATE(YYX) \
  368. ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
  369. /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
  370. static const yytype_uint8 yytranslate[] =
  371. {
  372. 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  373. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  374. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  375. 2, 2, 2, 34, 2, 2, 2, 36, 39, 2,
  376. 27, 28, 38, 32, 26, 33, 2, 37, 2, 2,
  377. 2, 2, 2, 2, 2, 2, 2, 2, 45, 46,
  378. 42, 31, 43, 44, 2, 2, 2, 2, 2, 2,
  379. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  380. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  381. 2, 29, 2, 30, 35, 2, 2, 2, 2, 2,
  382. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  383. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  384. 2, 2, 2, 2, 40, 2, 41, 2, 2, 2,
  385. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  386. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  387. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  388. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  389. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  390. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  391. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  392. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  393. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  394. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  395. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  396. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  397. 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
  398. 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
  399. 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
  400. 25
  401. };
  402. #if YYDEBUG
  403. /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
  404. YYRHS. */
  405. static const yytype_uint16 yyprhs[] =
  406. {
  407. 0, 0, 3, 5, 9, 11, 14, 16, 20, 28,
  408. 33, 37, 44, 53, 57, 62, 64, 66, 68, 70,
  409. 72, 76, 80, 84, 88, 92, 96, 100, 104, 108,
  410. 112, 116, 120, 122, 125, 128, 131, 133, 137, 139,
  411. 143, 147, 151, 153, 157, 159, 163, 165, 169, 171,
  412. 175, 177, 181, 185, 189, 191, 195, 199, 203, 207,
  413. 211, 215, 219, 223, 225, 229, 233, 235, 241, 246,
  414. 250, 252, 256, 259
  415. };
  416. /* YYRHS -- A `-1'-separated list of the rules' RHS. */
  417. static const yytype_int8 yyrhs[] =
  418. {
  419. 65, 0, -1, 64, -1, 64, 26, 48, -1, 24,
  420. -1, 24, 49, -1, 4, -1, 27, 64, 28, -1,
  421. 4, 27, 64, 28, 27, 64, 28, -1, 4, 27,
  422. 64, 28, -1, 4, 27, 28, -1, 4, 27, 64,
  423. 26, 64, 28, -1, 4, 27, 64, 26, 64, 26,
  424. 48, 28, -1, 51, 29, 30, -1, 51, 29, 64,
  425. 30, -1, 3, -1, 25, -1, 49, -1, 50, -1,
  426. 51, -1, 50, 31, 63, -1, 50, 15, 63, -1,
  427. 50, 16, 63, -1, 50, 17, 63, -1, 50, 18,
  428. 63, -1, 50, 19, 63, -1, 50, 20, 63, -1,
  429. 50, 21, 63, -1, 50, 22, 63, -1, 50, 23,
  430. 63, -1, 25, 31, 63, -1, 25, 15, 63, -1,
  431. 52, -1, 32, 53, -1, 33, 53, -1, 34, 53,
  432. -1, 53, -1, 54, 35, 53, -1, 54, -1, 55,
  433. 36, 54, -1, 55, 5, 54, -1, 55, 6, 54,
  434. -1, 55, -1, 56, 37, 55, -1, 56, -1, 57,
  435. 38, 56, -1, 57, -1, 58, 33, 57, -1, 58,
  436. -1, 59, 32, 58, -1, 59, -1, 60, 39, 59,
  437. -1, 60, 40, 59, -1, 60, 41, 59, -1, 60,
  438. -1, 61, 42, 60, -1, 61, 43, 60, -1, 61,
  439. 7, 60, -1, 61, 8, 60, -1, 61, 9, 60,
  440. -1, 61, 10, 60, -1, 61, 11, 60, -1, 61,
  441. 12, 60, -1, 61, -1, 62, 13, 61, -1, 62,
  442. 14, 61, -1, 62, -1, 62, 44, 63, 45, 63,
  443. -1, 62, 44, 45, 63, -1, 62, 44, 63, -1,
  444. 63, -1, 64, 46, 63, -1, 64, 46, -1, 64,
  445. -1
  446. };
  447. /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
  448. static const yytype_uint16 yyrline[] =
  449. {
  450. 0, 40, 40, 41, 48, 49, 57, 67, 71, 83,
  451. 93, 103, 114, 126, 130, 137, 138, 139, 143, 148,
  452. 149, 153, 157, 161, 165, 169, 173, 177, 181, 185,
  453. 189, 193, 200, 201, 205, 209, 216, 217, 224, 225,
  454. 229, 233, 240, 241, 249, 250, 258, 259, 266, 267,
  455. 274, 275, 279, 283, 290, 291, 295, 299, 303, 307,
  456. 311, 315, 319, 326, 327, 331, 338, 339, 343, 347,
  457. 355, 356, 360, 368
  458. };
  459. #endif
  460. #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
  461. /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
  462. First, the terminals, then, starting at YYNTOKENS, nonterminals. */
  463. static const char *const yytname[] =
  464. {
  465. "$end", "error", "$undefined", "VALUE", "IDENTIFIER", "TOKEN_SHL",
  466. "TOKEN_SHR", "TOKEN_LTE", "TOKEN_GTE", "TOKEN_EQ", "TOKEN_EQ_EXACT",
  467. "TOKEN_NE", "TOKEN_NE_EXACT", "TOKEN_LOGICAL_AND", "TOKEN_LOGICAL_OR",
  468. "TOKEN_ADD_OP", "TOKEN_SUB_OP", "TOKEN_MOD_OP", "TOKEN_OR_OP",
  469. "TOKEN_AND_OP", "TOKEN_XOR_OP", "TOKEN_DIV_OP", "TOKEN_MUL_OP",
  470. "TOKEN_POW_OP", "STRING_LITERAL", "STRING_IDENTIFIER", "','", "'('",
  471. "')'", "'['", "']'", "'='", "'+'", "'-'", "'!'", "'^'", "'%'", "'/'",
  472. "'*'", "'&'", "'|'", "'~'", "'<'", "'>'", "'?'", "':'", "';'", "$accept",
  473. "more_params", "string", "assignable_value", "rvalue", "assignment",
  474. "unary_expr", "pow_expr", "mod_expr", "div_expr", "mul_expr", "sub_expr",
  475. "add_expr", "andor_expr", "cmp_expr", "logical_and_or_expr",
  476. "if_else_expr", "expression", "program", 0
  477. };
  478. #endif
  479. # ifdef YYPRINT
  480. /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
  481. token YYLEX-NUM. */
  482. static const yytype_uint16 yytoknum[] =
  483. {
  484. 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
  485. 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
  486. 275, 276, 277, 278, 279, 280, 44, 40, 41, 91,
  487. 93, 61, 43, 45, 33, 94, 37, 47, 42, 38,
  488. 124, 126, 60, 62, 63, 58, 59
  489. };
  490. # endif
  491. /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
  492. static const yytype_uint8 yyr1[] =
  493. {
  494. 0, 47, 48, 48, 49, 49, 50, 50, 50, 50,
  495. 50, 50, 50, 50, 50, 51, 51, 51, 51, 52,
  496. 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
  497. 52, 52, 53, 53, 53, 53, 54, 54, 55, 55,
  498. 55, 55, 56, 56, 57, 57, 58, 58, 59, 59,
  499. 60, 60, 60, 60, 61, 61, 61, 61, 61, 61,
  500. 61, 61, 61, 62, 62, 62, 63, 63, 63, 63,
  501. 64, 64, 64, 65
  502. };
  503. /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
  504. static const yytype_uint8 yyr2[] =
  505. {
  506. 0, 2, 1, 3, 1, 2, 1, 3, 7, 4,
  507. 3, 6, 8, 3, 4, 1, 1, 1, 1, 1,
  508. 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  509. 3, 3, 1, 2, 2, 2, 1, 3, 1, 3,
  510. 3, 3, 1, 3, 1, 3, 1, 3, 1, 3,
  511. 1, 3, 3, 3, 1, 3, 3, 3, 3, 3,
  512. 3, 3, 3, 1, 3, 3, 1, 5, 4, 3,
  513. 1, 3, 2, 1
  514. };
  515. /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
  516. STATE-NUM when YYTABLE doesn't specify something else to do. Zero
  517. means the default is an error. */
  518. static const yytype_uint8 yydefact[] =
  519. {
  520. 0, 15, 6, 4, 16, 0, 0, 0, 0, 17,
  521. 18, 19, 32, 36, 38, 42, 44, 46, 48, 50,
  522. 54, 63, 66, 70, 73, 0, 0, 5, 0, 0,
  523. 0, 33, 34, 35, 0, 0, 0, 0, 0, 0,
  524. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  525. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  526. 0, 0, 0, 0, 0, 0, 0, 72, 1, 10,
  527. 0, 31, 30, 7, 21, 22, 23, 24, 25, 26,
  528. 27, 28, 29, 20, 13, 0, 37, 40, 41, 39,
  529. 43, 45, 47, 49, 51, 52, 53, 57, 58, 59,
  530. 60, 61, 62, 55, 56, 64, 65, 0, 69, 71,
  531. 0, 9, 14, 68, 0, 0, 0, 67, 0, 11,
  532. 0, 0, 2, 8, 12, 0, 3
  533. };
  534. /* YYDEFGOTO[NTERM-NUM]. */
  535. static const yytype_int8 yydefgoto[] =
  536. {
  537. -1, 121, 9, 10, 11, 12, 13, 14, 15, 16,
  538. 17, 18, 19, 20, 21, 22, 23, 122, 25
  539. };
  540. /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
  541. STATE-NUM. */
  542. #define YYPACT_NINF -38
  543. static const yytype_int8 yypact[] =
  544. {
  545. 70, -38, -21, 12, -11, 70, 70, 70, 70, -38,
  546. 102, 6, -38, -38, 50, 19, 4, 8, 14, 25,
  547. 51, 22, 40, -38, 47, 96, 34, -38, 70, 70,
  548. 43, -38, -38, -38, 70, 70, 70, 70, 70, 70,
  549. 70, 70, 70, 70, 45, 70, 70, 70, 70, 70,
  550. 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
  551. 70, 70, 70, 70, 70, 70, 18, 70, -38, -38,
  552. 55, -38, -38, -38, -38, -38, -38, -38, -38, -38,
  553. -38, -38, -38, -38, -38, 30, -38, 50, 50, 50,
  554. 19, 4, 8, 14, 25, 25, 25, 51, 51, 51,
  555. 51, 51, 51, 51, 51, 22, 22, 70, 53, -38,
  556. 70, 72, -38, -38, 70, 60, 70, -38, 70, -38,
  557. 54, 77, -23, -38, -38, 70, -38
  558. };
  559. /* YYPGOTO[NTERM-NUM]. */
  560. static const yytype_int8 yypgoto[] =
  561. {
  562. -38, -10, 111, -38, -38, -38, 11, 61, 79, 76,
  563. 80, 75, 58, 78, -37, -38, -27, 0, -38
  564. };
  565. /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
  566. positive, shift that token. If negative, reduce the rule which
  567. number is the opposite. If zero, do what YYDEFACT says.
  568. If YYTABLE_NINF, syntax error. */
  569. #define YYTABLE_NINF -1
  570. static const yytype_uint8 yytable[] =
  571. {
  572. 24, 71, 72, 125, 28, 30, 26, 74, 75, 76,
  573. 77, 78, 79, 80, 81, 82, 83, 31, 32, 33,
  574. 29, 1, 2, 67, 46, 47, 70, 105, 106, 56,
  575. 57, 58, 59, 60, 61, 44, 3, 1, 2, 108,
  576. 109, 49, 3, 4, 85, 5, 50, 51, 1, 2,
  577. 6, 7, 8, 64, 65, 48, 86, 52, 3, 4,
  578. 112, 5, 69, 107, 62, 63, 6, 7, 8, 3,
  579. 4, 73, 5, 1, 2, 84, 67, 6, 7, 8,
  580. 113, 110, 123, 111, 66, 45, 118, 117, 119, 67,
  581. 53, 54, 55, 67, 3, 4, 68, 5, 114, 116,
  582. 67, 67, 6, 7, 8, 124, 67, 87, 88, 89,
  583. 115, 94, 95, 96, 27, 126, 120, 34, 35, 36,
  584. 37, 38, 39, 40, 41, 42, 91, 93, 90, 0,
  585. 0, 92, 0, 43, 97, 98, 99, 100, 101, 102,
  586. 103, 104
  587. };
  588. static const yytype_int8 yycheck[] =
  589. {
  590. 0, 28, 29, 26, 15, 5, 27, 34, 35, 36,
  591. 37, 38, 39, 40, 41, 42, 43, 6, 7, 8,
  592. 31, 3, 4, 46, 5, 6, 26, 64, 65, 7,
  593. 8, 9, 10, 11, 12, 29, 24, 3, 4, 66,
  594. 67, 37, 24, 25, 44, 27, 38, 33, 3, 4,
  595. 32, 33, 34, 13, 14, 36, 45, 32, 24, 25,
  596. 30, 27, 28, 45, 42, 43, 32, 33, 34, 24,
  597. 25, 28, 27, 3, 4, 30, 46, 32, 33, 34,
  598. 107, 26, 28, 28, 44, 35, 26, 114, 28, 46,
  599. 39, 40, 41, 46, 24, 25, 0, 27, 45, 27,
  600. 46, 46, 32, 33, 34, 28, 46, 46, 47, 48,
  601. 110, 53, 54, 55, 3, 125, 116, 15, 16, 17,
  602. 18, 19, 20, 21, 22, 23, 50, 52, 49, -1,
  603. -1, 51, -1, 31, 56, 57, 58, 59, 60, 61,
  604. 62, 63
  605. };
  606. /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
  607. symbol of state STATE-NUM. */
  608. static const yytype_uint8 yystos[] =
  609. {
  610. 0, 3, 4, 24, 25, 27, 32, 33, 34, 49,
  611. 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
  612. 60, 61, 62, 63, 64, 65, 27, 49, 15, 31,
  613. 64, 53, 53, 53, 15, 16, 17, 18, 19, 20,
  614. 21, 22, 23, 31, 29, 35, 5, 6, 36, 37,
  615. 38, 33, 32, 39, 40, 41, 7, 8, 9, 10,
  616. 11, 12, 42, 43, 13, 14, 44, 46, 0, 28,
  617. 64, 63, 63, 28, 63, 63, 63, 63, 63, 63,
  618. 63, 63, 63, 63, 30, 64, 53, 54, 54, 54,
  619. 55, 56, 57, 58, 59, 59, 59, 60, 60, 60,
  620. 60, 60, 60, 60, 60, 61, 61, 45, 63, 63,
  621. 26, 28, 30, 63, 45, 64, 27, 63, 26, 28,
  622. 64, 48, 64, 28, 28, 26, 48
  623. };
  624. #define yyerrok (yyerrstatus = 0)
  625. #define yyclearin (yychar = YYEMPTY)
  626. #define YYEMPTY (-2)
  627. #define YYEOF 0
  628. #define YYACCEPT goto yyacceptlab
  629. #define YYABORT goto yyabortlab
  630. #define YYERROR goto yyerrorlab
  631. /* Like YYERROR except do call yyerror. This remains here temporarily
  632. to ease the transition to the new meaning of YYERROR, for GCC.
  633. Once GCC version 2 has supplanted version 1, this can go. */
  634. #define YYFAIL goto yyerrlab
  635. #define YYRECOVERING() (!!yyerrstatus)
  636. #define YYBACKUP(Token, Value) \
  637. do \
  638. if (yychar == YYEMPTY && yylen == 1) \
  639. { \
  640. yychar = (Token); \
  641. yylval = (Value); \
  642. yytoken = YYTRANSLATE (yychar); \
  643. YYPOPSTACK (1); \
  644. goto yybackup; \
  645. } \
  646. else \
  647. { \
  648. yyerror (&yylloc, context, YY_("syntax error: cannot back up")); \
  649. YYERROR; \
  650. } \
  651. while (YYID (0))
  652. #define YYTERROR 1
  653. #define YYERRCODE 256
  654. /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
  655. If N is 0, then set CURRENT to the empty location which ends
  656. the previous symbol: RHS[0] (always defined). */
  657. #define YYRHSLOC(Rhs, K) ((Rhs)[K])
  658. #ifndef YYLLOC_DEFAULT
  659. # define YYLLOC_DEFAULT(Current, Rhs, N) \
  660. do \
  661. if (YYID (N)) \
  662. { \
  663. (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
  664. (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
  665. (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
  666. (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
  667. } \
  668. else \
  669. { \
  670. (Current).first_line = (Current).last_line = \
  671. YYRHSLOC (Rhs, 0).last_line; \
  672. (Current).first_column = (Current).last_column = \
  673. YYRHSLOC (Rhs, 0).last_column; \
  674. } \
  675. while (YYID (0))
  676. #endif
  677. /* YY_LOCATION_PRINT -- Print the location on the stream.
  678. This macro was not mandated originally: define only if we know
  679. we won't break user code: when these are the locations we know. */
  680. #ifndef YY_LOCATION_PRINT
  681. # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
  682. # define YY_LOCATION_PRINT(File, Loc) \
  683. fprintf (File, "%d.%d-%d.%d", \
  684. (Loc).first_line, (Loc).first_column, \
  685. (Loc).last_line, (Loc).last_column)
  686. # else
  687. # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
  688. # endif
  689. #endif
  690. /* YYLEX -- calling `yylex' with the right arguments. */
  691. #ifdef YYLEX_PARAM
  692. # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
  693. #else
  694. # define YYLEX yylex (&yylval, &yylloc, scanner)
  695. #endif
  696. /* Enable debugging if requested. */
  697. #if YYDEBUG
  698. # ifndef YYFPRINTF
  699. # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
  700. # define YYFPRINTF fprintf
  701. # endif
  702. # define YYDPRINTF(Args) \
  703. do { \
  704. if (yydebug) \
  705. YYFPRINTF Args; \
  706. } while (YYID (0))
  707. # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
  708. do { \
  709. if (yydebug) \
  710. { \
  711. YYFPRINTF (stderr, "%s ", Title); \
  712. yy_symbol_print (stderr, \
  713. Type, Value, Location, context); \
  714. YYFPRINTF (stderr, "\n"); \
  715. } \
  716. } while (YYID (0))
  717. /*--------------------------------.
  718. | Print this symbol on YYOUTPUT. |
  719. `--------------------------------*/
  720. /*ARGSUSED*/
  721. #if (defined __STDC__ || defined __C99__FUNC__ \
  722. || defined __cplusplus || defined _MSC_VER)
  723. static void
  724. yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, compileContext* context)
  725. #else
  726. static void
  727. yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, context)
  728. FILE *yyoutput;
  729. int yytype;
  730. YYSTYPE const * const yyvaluep;
  731. YYLTYPE const * const yylocationp;
  732. compileContext* context;
  733. #endif
  734. {
  735. if (!yyvaluep)
  736. return;
  737. YYUSE (yylocationp);
  738. YYUSE (context);
  739. # ifdef YYPRINT
  740. if (yytype < YYNTOKENS)
  741. YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
  742. # else
  743. YYUSE (yyoutput);
  744. # endif
  745. switch (yytype)
  746. {
  747. default:
  748. break;
  749. }
  750. }
  751. /*--------------------------------.
  752. | Print this symbol on YYOUTPUT. |
  753. `--------------------------------*/
  754. #if (defined __STDC__ || defined __C99__FUNC__ \
  755. || defined __cplusplus || defined _MSC_VER)
  756. static void
  757. yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, compileContext* context)
  758. #else
  759. static void
  760. yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, context)
  761. FILE *yyoutput;
  762. int yytype;
  763. YYSTYPE const * const yyvaluep;
  764. YYLTYPE const * const yylocationp;
  765. compileContext* context;
  766. #endif
  767. {
  768. if (yytype < YYNTOKENS)
  769. YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
  770. else
  771. YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
  772. YY_LOCATION_PRINT (yyoutput, *yylocationp);
  773. YYFPRINTF (yyoutput, ": ");
  774. yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, context);
  775. YYFPRINTF (yyoutput, ")");
  776. }
  777. /*------------------------------------------------------------------.
  778. | yy_stack_print -- Print the state stack from its BOTTOM up to its |
  779. | TOP (included). |
  780. `------------------------------------------------------------------*/
  781. #if (defined __STDC__ || defined __C99__FUNC__ \
  782. || defined __cplusplus || defined _MSC_VER)
  783. static void
  784. yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
  785. #else
  786. static void
  787. yy_stack_print (bottom, top)
  788. yytype_int16 *bottom;
  789. yytype_int16 *top;
  790. #endif
  791. {
  792. YYFPRINTF (stderr, "Stack now");
  793. for (; bottom <= top; ++bottom)
  794. YYFPRINTF (stderr, " %d", *bottom);
  795. YYFPRINTF (stderr, "\n");
  796. }
  797. # define YY_STACK_PRINT(Bottom, Top) \
  798. do { \
  799. if (yydebug) \
  800. yy_stack_print ((Bottom), (Top)); \
  801. } while (YYID (0))
  802. /*------------------------------------------------.
  803. | Report that the YYRULE is going to be reduced. |
  804. `------------------------------------------------*/
  805. #if (defined __STDC__ || defined __C99__FUNC__ \
  806. || defined __cplusplus || defined _MSC_VER)
  807. static void
  808. yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, compileContext* context)
  809. #else
  810. static void
  811. yy_reduce_print (yyvsp, yylsp, yyrule, context)
  812. YYSTYPE *yyvsp;
  813. YYLTYPE *yylsp;
  814. int yyrule;
  815. compileContext* context;
  816. #endif
  817. {
  818. int yynrhs = yyr2[yyrule];
  819. int yyi;
  820. unsigned long int yylno = yyrline[yyrule];
  821. YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
  822. yyrule - 1, yylno);
  823. /* The symbols being reduced. */
  824. for (yyi = 0; yyi < yynrhs; yyi++)
  825. {
  826. fprintf (stderr, " $%d = ", yyi + 1);
  827. yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
  828. &(yyvsp[(yyi + 1) - (yynrhs)])
  829. , &(yylsp[(yyi + 1) - (yynrhs)]) , context);
  830. fprintf (stderr, "\n");
  831. }
  832. }
  833. # define YY_REDUCE_PRINT(Rule) \
  834. do { \
  835. if (yydebug) \
  836. yy_reduce_print (yyvsp, yylsp, Rule, context); \
  837. } while (YYID (0))
  838. /* Nonzero means print parse trace. It is left uninitialized so that
  839. multiple parsers can coexist. */
  840. int yydebug;
  841. #else /* !YYDEBUG */
  842. # define YYDPRINTF(Args)
  843. # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
  844. # define YY_STACK_PRINT(Bottom, Top)
  845. # define YY_REDUCE_PRINT(Rule)
  846. #endif /* !YYDEBUG */
  847. /* YYINITDEPTH -- initial size of the parser's stacks. */
  848. #ifndef YYINITDEPTH
  849. # define YYINITDEPTH 200
  850. #endif
  851. /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
  852. if the built-in stack extension method is used).
  853. Do not make this value too large; the results are undefined if
  854. YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
  855. evaluated with infinite-precision integer arithmetic. */
  856. #ifndef YYMAXDEPTH
  857. # define YYMAXDEPTH 10000
  858. #endif
  859. #if YYERROR_VERBOSE
  860. # ifndef yystrlen
  861. # if defined __GLIBC__ && defined _STRING_H
  862. # define yystrlen strlen
  863. # else
  864. /* Return the length of YYSTR. */
  865. #if (defined __STDC__ || defined __C99__FUNC__ \
  866. || defined __cplusplus || defined _MSC_VER)
  867. static YYSIZE_T
  868. yystrlen (const char *yystr)
  869. #else
  870. static YYSIZE_T
  871. yystrlen (yystr)
  872. const char *yystr;
  873. #endif
  874. {
  875. YYSIZE_T yylen;
  876. for (yylen = 0; yystr[yylen]; yylen++)
  877. continue;
  878. return yylen;
  879. }
  880. # endif
  881. # endif
  882. # ifndef yystpcpy
  883. # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
  884. # define yystpcpy stpcpy
  885. # else
  886. /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
  887. YYDEST. */
  888. #if (defined __STDC__ || defined __C99__FUNC__ \
  889. || defined __cplusplus || defined _MSC_VER)
  890. static char *
  891. yystpcpy (char *yydest, const char *yysrc)
  892. #else
  893. static char *
  894. yystpcpy (yydest, yysrc)
  895. char *yydest;
  896. const char *yysrc;
  897. #endif
  898. {
  899. char *yyd = yydest;
  900. const char *yys = yysrc;
  901. while ((*yyd++ = *yys++) != '\0')
  902. continue;
  903. return yyd - 1;
  904. }
  905. # endif
  906. # endif
  907. # ifndef yytnamerr
  908. /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
  909. quotes and backslashes, so that it's suitable for yyerror. The
  910. heuristic is that double-quoting is unnecessary unless the string
  911. contains an apostrophe, a comma, or backslash (other than
  912. backslash-backslash). YYSTR is taken from yytname. If YYRES is
  913. null, do not copy; instead, return the length of what the result
  914. would have been. */
  915. static YYSIZE_T
  916. yytnamerr (char *yyres, const char *yystr)
  917. {
  918. if (*yystr == '"')
  919. {
  920. YYSIZE_T yyn = 0;
  921. char const *yyp = yystr;
  922. for (;;)
  923. switch (*++yyp)
  924. {
  925. case '\'':
  926. case ',':
  927. goto do_not_strip_quotes;
  928. case '\\':
  929. if (*++yyp != '\\')
  930. goto do_not_strip_quotes;
  931. /* Fall through. */
  932. default:
  933. if (yyres)
  934. yyres[yyn] = *yyp;
  935. yyn++;
  936. break;
  937. case '"':
  938. if (yyres)
  939. yyres[yyn] = '\0';
  940. return yyn;
  941. }
  942. do_not_strip_quotes: ;
  943. }
  944. if (! yyres)
  945. return yystrlen (yystr);
  946. return yystpcpy (yyres, yystr) - yyres;
  947. }
  948. # endif
  949. /* Copy into YYRESULT an error message about the unexpected token
  950. YYCHAR while in state YYSTATE. Return the number of bytes copied,
  951. including the terminating null byte. If YYRESULT is null, do not
  952. copy anything; just return the number of bytes that would be
  953. copied. As a special case, return 0 if an ordinary "syntax error"
  954. message will do. Return YYSIZE_MAXIMUM if overflow occurs during
  955. size calculation. */
  956. static YYSIZE_T
  957. yysyntax_error (char *yyresult, int yystate, int yychar)
  958. {
  959. int yyn = yypact[yystate];
  960. if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
  961. return 0;
  962. else
  963. {
  964. int yytype = YYTRANSLATE (yychar);
  965. YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
  966. YYSIZE_T yysize = yysize0;
  967. YYSIZE_T yysize1;
  968. int yysize_overflow = 0;
  969. enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
  970. char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
  971. int yyx;
  972. # if 0
  973. /* This is so xgettext sees the translatable formats that are
  974. constructed on the fly. */
  975. YY_("syntax error, unexpected %s");
  976. YY_("syntax error, unexpected %s, expecting %s");
  977. YY_("syntax error, unexpected %s, expecting %s or %s");
  978. YY_("syntax error, unexpected %s, expecting %s or %s or %s");
  979. YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
  980. # endif
  981. char *yyfmt;
  982. char const *yyf;
  983. static char const yyunexpected[] = "syntax error, unexpected %s";
  984. static char const yyexpecting[] = ", expecting %s";
  985. static char const yyor[] = " or %s";
  986. char yyformat[sizeof yyunexpected
  987. + sizeof yyexpecting - 1
  988. + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
  989. * (sizeof yyor - 1))];
  990. char const *yyprefix = yyexpecting;
  991. /* Start YYX at -YYN if negative to avoid negative indexes in
  992. YYCHECK. */
  993. int yyxbegin = yyn < 0 ? -yyn : 0;
  994. /* Stay within bounds of both yycheck and yytname. */
  995. int yychecklim = YYLAST - yyn + 1;
  996. int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
  997. int yycount = 1;
  998. yyarg[0] = yytname[yytype];
  999. yyfmt = yystpcpy (yyformat, yyunexpected);
  1000. for (yyx = yyxbegin; yyx < yyxend; ++yyx)
  1001. if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
  1002. {
  1003. if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
  1004. {
  1005. yycount = 1;
  1006. yysize = yysize0;
  1007. yyformat[sizeof yyunexpected - 1] = '\0';
  1008. break;
  1009. }
  1010. yyarg[yycount++] = yytname[yyx];
  1011. yysize1 = yysize + yytnamerr (0, yytname[yyx]);
  1012. yysize_overflow |= (yysize1 < yysize);
  1013. yysize = yysize1;
  1014. yyfmt = yystpcpy (yyfmt, yyprefix);
  1015. yyprefix = yyor;
  1016. }
  1017. yyf = YY_(yyformat);
  1018. yysize1 = yysize + yystrlen (yyf);
  1019. yysize_overflow |= (yysize1 < yysize);
  1020. yysize = yysize1;
  1021. if (yysize_overflow)
  1022. return YYSIZE_MAXIMUM;
  1023. if (yyresult)
  1024. {
  1025. /* Avoid sprintf, as that infringes on the user's name space.
  1026. Don't have undefined behavior even if the translation
  1027. produced a string with the wrong number of "%s"s. */
  1028. char *yyp = yyresult;
  1029. int yyi = 0;
  1030. while ((*yyp = *yyf) != '\0')
  1031. {
  1032. if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
  1033. {
  1034. yyp += yytnamerr (yyp, yyarg[yyi++]);
  1035. yyf += 2;
  1036. }
  1037. else
  1038. {
  1039. yyp++;
  1040. yyf++;
  1041. }
  1042. }
  1043. }
  1044. return yysize;
  1045. }
  1046. }
  1047. #endif /* YYERROR_VERBOSE */
  1048. /*-----------------------------------------------.
  1049. | Release the memory associated to this symbol. |
  1050. `-----------------------------------------------*/
  1051. /*ARGSUSED*/
  1052. #if (defined __STDC__ || defined __C99__FUNC__ \
  1053. || defined __cplusplus || defined _MSC_VER)
  1054. static void
  1055. yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, compileContext* context)
  1056. #else
  1057. static void
  1058. yydestruct (yymsg, yytype, yyvaluep, yylocationp, context)
  1059. const char *yymsg;
  1060. int yytype;
  1061. YYSTYPE *yyvaluep;
  1062. YYLTYPE *yylocationp;
  1063. compileContext* context;
  1064. #endif
  1065. {
  1066. YYUSE (yyvaluep);
  1067. YYUSE (yylocationp);
  1068. YYUSE (context);
  1069. if (!yymsg)
  1070. yymsg = "Deleting";
  1071. YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
  1072. switch (yytype)
  1073. {
  1074. case 3: /* "VALUE" */
  1075. #line 8 "eel2.y"
  1076. {
  1077. #define yydestruct(a,b,c,d,e)
  1078. };
  1079. #line 1222 "y.tab.c"
  1080. break;
  1081. default:
  1082. break;
  1083. }
  1084. }
  1085. /* Prevent warnings from -Wmissing-prototypes. */
  1086. #ifdef YYPARSE_PARAM
  1087. #if defined __STDC__ || defined __cplusplus
  1088. int yyparse (void *YYPARSE_PARAM);
  1089. #else
  1090. int yyparse ();
  1091. #endif
  1092. #else /* ! YYPARSE_PARAM */
  1093. #if defined __STDC__ || defined __cplusplus
  1094. int yyparse (compileContext* context);
  1095. #else
  1096. int yyparse ();
  1097. #endif
  1098. #endif /* ! YYPARSE_PARAM */
  1099. /*----------.
  1100. | yyparse. |
  1101. `----------*/
  1102. #ifdef YYPARSE_PARAM
  1103. #if (defined __STDC__ || defined __C99__FUNC__ \
  1104. || defined __cplusplus || defined _MSC_VER)
  1105. int
  1106. yyparse (void *YYPARSE_PARAM)
  1107. #else
  1108. int
  1109. yyparse (YYPARSE_PARAM)
  1110. void *YYPARSE_PARAM;
  1111. #endif
  1112. #else /* ! YYPARSE_PARAM */
  1113. #if (defined __STDC__ || defined __C99__FUNC__ \
  1114. || defined __cplusplus || defined _MSC_VER)
  1115. int
  1116. yyparse (compileContext* context)
  1117. #else
  1118. int
  1119. yyparse (context)
  1120. compileContext* context;
  1121. #endif
  1122. #endif
  1123. {
  1124. /* The look-ahead symbol. */
  1125. int yychar;
  1126. /* The semantic value of the look-ahead symbol. */
  1127. YYSTYPE yylval;
  1128. /* Number of syntax errors so far. */
  1129. int yynerrs;
  1130. /* Location data for the look-ahead symbol. */
  1131. YYLTYPE yylloc;
  1132. int yystate;
  1133. int yyn;
  1134. int yyresult;
  1135. /* Number of tokens to shift before error messages enabled. */
  1136. int yyerrstatus;
  1137. /* Look-ahead token as an internal (translated) token number. */
  1138. int yytoken = 0;
  1139. #if YYERROR_VERBOSE
  1140. /* Buffer for error messages, and its allocated size. */
  1141. char yymsgbuf[128];
  1142. char *yymsg = yymsgbuf;
  1143. YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
  1144. #endif
  1145. /* Three stacks and their tools:
  1146. `yyss': related to states,
  1147. `yyvs': related to semantic values,
  1148. `yyls': related to locations.
  1149. Refer to the stacks thru separate pointers, to allow yyoverflow
  1150. to reallocate them elsewhere. */
  1151. /* The state stack. */
  1152. yytype_int16 yyssa[YYINITDEPTH];
  1153. yytype_int16 *yyss = yyssa;
  1154. yytype_int16 *yyssp;
  1155. /* The semantic value stack. */
  1156. YYSTYPE yyvsa[YYINITDEPTH];
  1157. YYSTYPE *yyvs = yyvsa;
  1158. YYSTYPE *yyvsp;
  1159. /* The location stack. */
  1160. YYLTYPE yylsa[YYINITDEPTH];
  1161. YYLTYPE *yyls = yylsa;
  1162. YYLTYPE *yylsp;
  1163. /* The locations where the error started and ended. */
  1164. YYLTYPE yyerror_range[2];
  1165. #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
  1166. YYSIZE_T yystacksize = YYINITDEPTH;
  1167. /* The variables used to return semantic value and location from the
  1168. action routines. */
  1169. YYSTYPE yyval;
  1170. YYLTYPE yyloc;
  1171. /* The number of symbols on the RHS of the reduced rule.
  1172. Keep to zero when no symbol should be popped. */
  1173. int yylen = 0;
  1174. YYDPRINTF ((stderr, "Starting parse\n"));
  1175. yystate = 0;
  1176. yyerrstatus = 0;
  1177. yynerrs = 0;
  1178. yychar = YYEMPTY; /* Cause a token to be read. */
  1179. /* Initialize stack pointers.
  1180. Waste one element of value and location stack
  1181. so that they stay on the same level as the state stack.
  1182. The wasted elements are never initialized. */
  1183. yyssp = yyss;
  1184. yyvsp = yyvs;
  1185. yylsp = yyls;
  1186. #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
  1187. /* Initialize the default location before parsing starts. */
  1188. yylloc.first_line = yylloc.last_line = 1;
  1189. yylloc.first_column = yylloc.last_column = 0;
  1190. #endif
  1191. goto yysetstate;
  1192. /*------------------------------------------------------------.
  1193. | yynewstate -- Push a new state, which is found in yystate. |
  1194. `------------------------------------------------------------*/
  1195. yynewstate:
  1196. /* In all cases, when you get here, the value and location stacks
  1197. have just been pushed. So pushing a state here evens the stacks. */
  1198. yyssp++;
  1199. yysetstate:
  1200. *yyssp = yystate;
  1201. if (yyss + yystacksize - 1 <= yyssp)
  1202. {
  1203. /* Get the current used size of the three stacks, in elements. */
  1204. YYSIZE_T yysize = yyssp - yyss + 1;
  1205. #ifdef yyoverflow
  1206. {
  1207. /* Give user a chance to reallocate the stack. Use copies of
  1208. these so that the &'s don't force the real ones into
  1209. memory. */
  1210. YYSTYPE *yyvs1 = yyvs;
  1211. yytype_int16 *yyss1 = yyss;
  1212. YYLTYPE *yyls1 = yyls;
  1213. /* Each stack pointer address is followed by the size of the
  1214. data in use in that stack, in bytes. This used to be a
  1215. conditional around just the two extra args, but that might
  1216. be undefined if yyoverflow is a macro. */
  1217. yyoverflow (YY_("memory exhausted"),
  1218. &yyss1, yysize * sizeof (*yyssp),
  1219. &yyvs1, yysize * sizeof (*yyvsp),
  1220. &yyls1, yysize * sizeof (*yylsp),
  1221. &yystacksize);
  1222. yyls = yyls1;
  1223. yyss = yyss1;
  1224. yyvs = yyvs1;
  1225. }
  1226. #else /* no yyoverflow */
  1227. # ifndef YYSTACK_RELOCATE
  1228. goto yyexhaustedlab;
  1229. # else
  1230. /* Extend the stack our own way. */
  1231. if (YYMAXDEPTH <= yystacksize)
  1232. goto yyexhaustedlab;
  1233. yystacksize *= 2;
  1234. if (YYMAXDEPTH < yystacksize)
  1235. yystacksize = YYMAXDEPTH;
  1236. {
  1237. yytype_int16 *yyss1 = yyss;
  1238. union yyalloc *yyptr =
  1239. (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
  1240. if (! yyptr)
  1241. goto yyexhaustedlab;
  1242. YYSTACK_RELOCATE (yyss);
  1243. YYSTACK_RELOCATE (yyvs);
  1244. YYSTACK_RELOCATE (yyls);
  1245. # undef YYSTACK_RELOCATE
  1246. if (yyss1 != yyssa)
  1247. YYSTACK_FREE (yyss1);
  1248. }
  1249. # endif
  1250. #endif /* no yyoverflow */
  1251. yyssp = yyss + yysize - 1;
  1252. yyvsp = yyvs + yysize - 1;
  1253. yylsp = yyls + yysize - 1;
  1254. YYDPRINTF ((stderr, "Stack size increased to %lu\n",
  1255. (unsigned long int) yystacksize));
  1256. if (yyss + yystacksize - 1 <= yyssp)
  1257. YYABORT;
  1258. }
  1259. YYDPRINTF ((stderr, "Entering state %d\n", yystate));
  1260. goto yybackup;
  1261. /*-----------.
  1262. | yybackup. |
  1263. `-----------*/
  1264. yybackup:
  1265. /* Do appropriate processing given the current state. Read a
  1266. look-ahead token if we need one and don't already have one. */
  1267. /* First try to decide what to do without reference to look-ahead token. */
  1268. yyn = yypact[yystate];
  1269. if (yyn == YYPACT_NINF)
  1270. goto yydefault;
  1271. /* Not known => get a look-ahead token if don't already have one. */
  1272. /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
  1273. if (yychar == YYEMPTY)
  1274. {
  1275. YYDPRINTF ((stderr, "Reading a token: "));
  1276. yychar = YYLEX;
  1277. }
  1278. if (yychar <= YYEOF)
  1279. {
  1280. yychar = yytoken = YYEOF;
  1281. YYDPRINTF ((stderr, "Now at end of input.\n"));
  1282. }
  1283. else
  1284. {
  1285. yytoken = YYTRANSLATE (yychar);
  1286. YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
  1287. }
  1288. /* If the proper action on seeing token YYTOKEN is to reduce or to
  1289. detect an error, take that action. */
  1290. yyn += yytoken;
  1291. if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
  1292. goto yydefault;
  1293. yyn = yytable[yyn];
  1294. if (yyn <= 0)
  1295. {
  1296. if (yyn == 0 || yyn == YYTABLE_NINF)
  1297. goto yyerrlab;
  1298. yyn = -yyn;
  1299. goto yyreduce;
  1300. }
  1301. if (yyn == YYFINAL)
  1302. YYACCEPT;
  1303. /* Count tokens shifted since error; after three, turn off error
  1304. status. */
  1305. if (yyerrstatus)
  1306. yyerrstatus--;
  1307. /* Shift the look-ahead token. */
  1308. YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
  1309. /* Discard the shifted token unless it is eof. */
  1310. if (yychar != YYEOF)
  1311. yychar = YYEMPTY;
  1312. yystate = yyn;
  1313. *++yyvsp = yylval;
  1314. *++yylsp = yylloc;
  1315. goto yynewstate;
  1316. /*-----------------------------------------------------------.
  1317. | yydefault -- do the default action for the current state. |
  1318. `-----------------------------------------------------------*/
  1319. yydefault:
  1320. yyn = yydefact[yystate];
  1321. if (yyn == 0)
  1322. goto yyerrlab;
  1323. goto yyreduce;
  1324. /*-----------------------------.
  1325. | yyreduce -- Do a reduction. |
  1326. `-----------------------------*/
  1327. yyreduce:
  1328. /* yyn is the number of a rule to reduce with. */
  1329. yylen = yyr2[yyn];
  1330. /* If YYLEN is nonzero, implement the default value of the action:
  1331. `$$ = $1'.
  1332. Otherwise, the following line sets YYVAL to garbage.
  1333. This behavior is undocumented and Bison
  1334. users should not rely upon it. Assigning to YYVAL
  1335. unconditionally makes the parser a bit smaller, and it avoids a
  1336. GCC warning that YYVAL may be used uninitialized. */
  1337. yyval = yyvsp[1-yylen];
  1338. /* Default location. */
  1339. YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
  1340. YY_REDUCE_PRINT (yyn);
  1341. switch (yyn)
  1342. {
  1343. case 3:
  1344. #line 42 "eel2.y"
  1345. {
  1346. (yyval) = nseel_createMoreParametersOpcode(context,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1347. }
  1348. break;
  1349. case 5:
  1350. #line 50 "eel2.y"
  1351. {
  1352. ((struct eelStringSegmentRec *)(yyvsp[(1) - (2)]))->_next = (struct eelStringSegmentRec *)(yyvsp[(2) - (2)]);
  1353. (yyval) = (yyvsp[(1) - (2)]);
  1354. }
  1355. break;
  1356. case 6:
  1357. #line 58 "eel2.y"
  1358. {
  1359. if (!((yyval) = nseel_resolve_named_symbol(context, (yyvsp[(1) - (1)]), -1, NULL))) /* convert from purely named to namespace-relative, etc */
  1360. {
  1361. yyerror(&yyloc, context, "");
  1362. YYERROR;
  1363. }
  1364. }
  1365. break;
  1366. case 7:
  1367. #line 68 "eel2.y"
  1368. {
  1369. (yyval) = (yyvsp[(2) - (3)]);
  1370. }
  1371. break;
  1372. case 8:
  1373. #line 72 "eel2.y"
  1374. {
  1375. int err;
  1376. if (!((yyval) = nseel_setCompiledFunctionCallParameters(context,(yyvsp[(1) - (7)]), (yyvsp[(3) - (7)]), 0, 0, (yyvsp[(6) - (7)]), &err)))
  1377. {
  1378. if (err == -1) yyerror(&yylsp[-2], context, "");
  1379. else if (err == 0) yyerror(&yylsp[-6], context, "");
  1380. else yyerror(&yylsp[-3], context, ""); // parameter count wrong
  1381. YYERROR;
  1382. }
  1383. }
  1384. break;
  1385. case 9:
  1386. #line 84 "eel2.y"
  1387. {
  1388. int err;
  1389. if (!((yyval) = nseel_setCompiledFunctionCallParameters(context,(yyvsp[(1) - (4)]), (yyvsp[(3) - (4)]), 0, 0, 0, &err)))
  1390. {
  1391. if (err == 0) yyerror(&yylsp[-3], context, "");
  1392. else yyerror(&yylsp[0], context, ""); // parameter count wrong
  1393. YYERROR;
  1394. }
  1395. }
  1396. break;
  1397. case 10:
  1398. #line 94 "eel2.y"
  1399. {
  1400. int err;
  1401. if (!((yyval) = nseel_setCompiledFunctionCallParameters(context,(yyvsp[(1) - (3)]), nseel_createCompiledValue(context,0.0), 0, 0, 0,&err)))
  1402. {
  1403. if (err == 0) yyerror(&yylsp[-2], context, ""); // function not found
  1404. else yyerror(&yylsp[0], context, ""); // parameter count wrong
  1405. YYERROR;
  1406. }
  1407. }
  1408. break;
  1409. case 11:
  1410. #line 104 "eel2.y"
  1411. {
  1412. int err;
  1413. if (!((yyval) = nseel_setCompiledFunctionCallParameters(context,(yyvsp[(1) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(5) - (6)]), 0, 0,&err)))
  1414. {
  1415. if (err == 0) yyerror(&yylsp[-5], context, "");
  1416. else if (err == 2) yyerror(&yylsp[0], context, ""); // needs more than 2 parameters
  1417. else yyerror(&yylsp[-2], context, ""); // less than 2
  1418. YYERROR;
  1419. }
  1420. }
  1421. break;
  1422. case 12:
  1423. #line 115 "eel2.y"
  1424. {
  1425. int err;
  1426. if (!((yyval) = nseel_setCompiledFunctionCallParameters(context,(yyvsp[(1) - (8)]), (yyvsp[(3) - (8)]), (yyvsp[(5) - (8)]), (yyvsp[(7) - (8)]), 0, &err)))
  1427. {
  1428. if (err == 0) yyerror(&yylsp[-7], context, "");
  1429. else if (err==2) yyerror(&yylsp[0], context, ""); // needs more parameters
  1430. else if (err==4) yyerror(&yylsp[-4], context, ""); // needs single parameter
  1431. else yyerror(&yylsp[-2], context, ""); // less parm
  1432. YYERROR;
  1433. }
  1434. }
  1435. break;
  1436. case 13:
  1437. #line 127 "eel2.y"
  1438. {
  1439. (yyval) = nseel_createMemoryAccess(context,(yyvsp[(1) - (3)]),0);
  1440. }
  1441. break;
  1442. case 14:
  1443. #line 131 "eel2.y"
  1444. {
  1445. (yyval) = nseel_createMemoryAccess(context,(yyvsp[(1) - (4)]),(yyvsp[(3) - (4)]));
  1446. }
  1447. break;
  1448. case 17:
  1449. #line 140 "eel2.y"
  1450. {
  1451. (yyval) = nseel_eelMakeOpcodeFromStringSegments(context,(struct eelStringSegmentRec *)(yyvsp[(1) - (1)]));
  1452. }
  1453. break;
  1454. case 20:
  1455. #line 150 "eel2.y"
  1456. {
  1457. (yyval) = nseel_createSimpleCompiledFunction(context,FN_ASSIGN,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1458. }
  1459. break;
  1460. case 21:
  1461. #line 154 "eel2.y"
  1462. {
  1463. (yyval) = nseel_createSimpleCompiledFunction(context,FN_ADD_OP,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1464. }
  1465. break;
  1466. case 22:
  1467. #line 158 "eel2.y"
  1468. {
  1469. (yyval) = nseel_createSimpleCompiledFunction(context,FN_SUB_OP,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1470. }
  1471. break;
  1472. case 23:
  1473. #line 162 "eel2.y"
  1474. {
  1475. (yyval) = nseel_createSimpleCompiledFunction(context,FN_MOD_OP,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1476. }
  1477. break;
  1478. case 24:
  1479. #line 166 "eel2.y"
  1480. {
  1481. (yyval) = nseel_createSimpleCompiledFunction(context,FN_OR_OP,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1482. }
  1483. break;
  1484. case 25:
  1485. #line 170 "eel2.y"
  1486. {
  1487. (yyval) = nseel_createSimpleCompiledFunction(context,FN_AND_OP,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1488. }
  1489. break;
  1490. case 26:
  1491. #line 174 "eel2.y"
  1492. {
  1493. (yyval) = nseel_createSimpleCompiledFunction(context,FN_XOR_OP,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1494. }
  1495. break;
  1496. case 27:
  1497. #line 178 "eel2.y"
  1498. {
  1499. (yyval) = nseel_createSimpleCompiledFunction(context,FN_DIV_OP,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1500. }
  1501. break;
  1502. case 28:
  1503. #line 182 "eel2.y"
  1504. {
  1505. (yyval) = nseel_createSimpleCompiledFunction(context,FN_MUL_OP,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1506. }
  1507. break;
  1508. case 29:
  1509. #line 186 "eel2.y"
  1510. {
  1511. (yyval) = nseel_createSimpleCompiledFunction(context,FN_POW_OP,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1512. }
  1513. break;
  1514. case 30:
  1515. #line 190 "eel2.y"
  1516. {
  1517. (yyval) = nseel_createFunctionByName(context,"strcpy",2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),NULL);
  1518. }
  1519. break;
  1520. case 31:
  1521. #line 194 "eel2.y"
  1522. {
  1523. (yyval) = nseel_createFunctionByName(context,"strcat",2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),NULL);
  1524. }
  1525. break;
  1526. case 33:
  1527. #line 202 "eel2.y"
  1528. {
  1529. (yyval) = (yyvsp[(2) - (2)]);
  1530. }
  1531. break;
  1532. case 34:
  1533. #line 206 "eel2.y"
  1534. {
  1535. (yyval) = nseel_createSimpleCompiledFunction(context,FN_UMINUS,1,(yyvsp[(2) - (2)]),0);
  1536. }
  1537. break;
  1538. case 35:
  1539. #line 210 "eel2.y"
  1540. {
  1541. (yyval) = nseel_createSimpleCompiledFunction(context,FN_NOT,1,(yyvsp[(2) - (2)]),0);
  1542. }
  1543. break;
  1544. case 37:
  1545. #line 218 "eel2.y"
  1546. {
  1547. (yyval) = nseel_createSimpleCompiledFunction(context,FN_POW,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1548. }
  1549. break;
  1550. case 39:
  1551. #line 226 "eel2.y"
  1552. {
  1553. (yyval) = nseel_createSimpleCompiledFunction(context,FN_MOD,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1554. }
  1555. break;
  1556. case 40:
  1557. #line 230 "eel2.y"
  1558. {
  1559. (yyval) = nseel_createSimpleCompiledFunction(context,FN_SHL,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1560. }
  1561. break;
  1562. case 41:
  1563. #line 234 "eel2.y"
  1564. {
  1565. (yyval) = nseel_createSimpleCompiledFunction(context,FN_SHR,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1566. }
  1567. break;
  1568. case 43:
  1569. #line 242 "eel2.y"
  1570. {
  1571. (yyval) = nseel_createSimpleCompiledFunction(context,FN_DIVIDE,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1572. }
  1573. break;
  1574. case 45:
  1575. #line 251 "eel2.y"
  1576. {
  1577. (yyval) = nseel_createSimpleCompiledFunction(context,FN_MULTIPLY,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1578. }
  1579. break;
  1580. case 47:
  1581. #line 260 "eel2.y"
  1582. {
  1583. (yyval) = nseel_createSimpleCompiledFunction(context,FN_SUB,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1584. }
  1585. break;
  1586. case 49:
  1587. #line 268 "eel2.y"
  1588. {
  1589. (yyval) = nseel_createSimpleCompiledFunction(context,FN_ADD,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1590. }
  1591. break;
  1592. case 51:
  1593. #line 276 "eel2.y"
  1594. {
  1595. (yyval) = nseel_createSimpleCompiledFunction(context,FN_AND,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1596. }
  1597. break;
  1598. case 52:
  1599. #line 280 "eel2.y"
  1600. {
  1601. (yyval) = nseel_createSimpleCompiledFunction(context,FN_OR,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1602. }
  1603. break;
  1604. case 53:
  1605. #line 284 "eel2.y"
  1606. {
  1607. (yyval) = nseel_createSimpleCompiledFunction(context,FN_XOR,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1608. }
  1609. break;
  1610. case 55:
  1611. #line 292 "eel2.y"
  1612. {
  1613. (yyval) = nseel_createSimpleCompiledFunction(context,FN_LT,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1614. }
  1615. break;
  1616. case 56:
  1617. #line 296 "eel2.y"
  1618. {
  1619. (yyval) = nseel_createSimpleCompiledFunction(context,FN_GT,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1620. }
  1621. break;
  1622. case 57:
  1623. #line 300 "eel2.y"
  1624. {
  1625. (yyval) = nseel_createSimpleCompiledFunction(context,FN_LTE,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1626. }
  1627. break;
  1628. case 58:
  1629. #line 304 "eel2.y"
  1630. {
  1631. (yyval) = nseel_createSimpleCompiledFunction(context,FN_GTE,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1632. }
  1633. break;
  1634. case 59:
  1635. #line 308 "eel2.y"
  1636. {
  1637. (yyval) = nseel_createSimpleCompiledFunction(context,FN_EQ,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1638. }
  1639. break;
  1640. case 60:
  1641. #line 312 "eel2.y"
  1642. {
  1643. (yyval) = nseel_createSimpleCompiledFunction(context,FN_EQ_EXACT,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1644. }
  1645. break;
  1646. case 61:
  1647. #line 316 "eel2.y"
  1648. {
  1649. (yyval) = nseel_createSimpleCompiledFunction(context,FN_NE,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1650. }
  1651. break;
  1652. case 62:
  1653. #line 320 "eel2.y"
  1654. {
  1655. (yyval) = nseel_createSimpleCompiledFunction(context,FN_NE_EXACT,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1656. }
  1657. break;
  1658. case 64:
  1659. #line 328 "eel2.y"
  1660. {
  1661. (yyval) = nseel_createSimpleCompiledFunction(context,FN_LOGICAL_AND,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1662. }
  1663. break;
  1664. case 65:
  1665. #line 332 "eel2.y"
  1666. {
  1667. (yyval) = nseel_createSimpleCompiledFunction(context,FN_LOGICAL_OR,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1668. }
  1669. break;
  1670. case 67:
  1671. #line 340 "eel2.y"
  1672. {
  1673. (yyval) = nseel_createIfElse(context, (yyvsp[(1) - (5)]), (yyvsp[(3) - (5)]), (yyvsp[(5) - (5)]));
  1674. }
  1675. break;
  1676. case 68:
  1677. #line 344 "eel2.y"
  1678. {
  1679. (yyval) = nseel_createIfElse(context, (yyvsp[(1) - (4)]), 0, (yyvsp[(4) - (4)]));
  1680. }
  1681. break;
  1682. case 69:
  1683. #line 348 "eel2.y"
  1684. {
  1685. (yyval) = nseel_createIfElse(context, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), 0);
  1686. }
  1687. break;
  1688. case 71:
  1689. #line 357 "eel2.y"
  1690. {
  1691. (yyval) = nseel_createSimpleCompiledFunction(context,FN_JOIN_STATEMENTS,2,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));
  1692. }
  1693. break;
  1694. case 72:
  1695. #line 361 "eel2.y"
  1696. {
  1697. (yyval) = (yyvsp[(1) - (2)]);
  1698. }
  1699. break;
  1700. case 73:
  1701. #line 369 "eel2.y"
  1702. {
  1703. if ((yylsp[(1) - (1)]).first_line) { }
  1704. context->result = (yyvsp[(1) - (1)]);
  1705. }
  1706. break;
  1707. /* Line 1267 of yacc.c. */
  1708. #line 1965 "y.tab.c"
  1709. default: break;
  1710. }
  1711. YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
  1712. YYPOPSTACK (yylen);
  1713. yylen = 0;
  1714. YY_STACK_PRINT (yyss, yyssp);
  1715. *++yyvsp = yyval;
  1716. *++yylsp = yyloc;
  1717. /* Now `shift' the result of the reduction. Determine what state
  1718. that goes to, based on the state we popped back to and the rule
  1719. number reduced by. */
  1720. yyn = yyr1[yyn];
  1721. yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  1722. if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1723. yystate = yytable[yystate];
  1724. else
  1725. yystate = yydefgoto[yyn - YYNTOKENS];
  1726. goto yynewstate;
  1727. /*------------------------------------.
  1728. | yyerrlab -- here on detecting error |
  1729. `------------------------------------*/
  1730. yyerrlab:
  1731. /* If not already recovering from an error, report this error. */
  1732. if (!yyerrstatus)
  1733. {
  1734. ++yynerrs;
  1735. #if ! YYERROR_VERBOSE
  1736. yyerror (&yylloc, context, YY_("syntax error"));
  1737. #else
  1738. {
  1739. YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
  1740. if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
  1741. {
  1742. YYSIZE_T yyalloc = 2 * yysize;
  1743. if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
  1744. yyalloc = YYSTACK_ALLOC_MAXIMUM;
  1745. if (yymsg != yymsgbuf)
  1746. YYSTACK_FREE (yymsg);
  1747. yymsg = (char *) YYSTACK_ALLOC (yyalloc);
  1748. if (yymsg)
  1749. yymsg_alloc = yyalloc;
  1750. else
  1751. {
  1752. yymsg = yymsgbuf;
  1753. yymsg_alloc = sizeof yymsgbuf;
  1754. }
  1755. }
  1756. if (0 < yysize && yysize <= yymsg_alloc)
  1757. {
  1758. (void) yysyntax_error (yymsg, yystate, yychar);
  1759. yyerror (&yylloc, context, yymsg);
  1760. }
  1761. else
  1762. {
  1763. yyerror (&yylloc, context, YY_("syntax error"));
  1764. if (yysize != 0)
  1765. goto yyexhaustedlab;
  1766. }
  1767. }
  1768. #endif
  1769. }
  1770. yyerror_range[0] = yylloc;
  1771. if (yyerrstatus == 3)
  1772. {
  1773. /* If just tried and failed to reuse look-ahead token after an
  1774. error, discard it. */
  1775. if (yychar <= YYEOF)
  1776. {
  1777. /* Return failure if at end of input. */
  1778. if (yychar == YYEOF)
  1779. YYABORT;
  1780. }
  1781. else
  1782. {
  1783. yydestruct ("Error: discarding",
  1784. yytoken, &yylval, &yylloc, context);
  1785. yychar = YYEMPTY;
  1786. }
  1787. }
  1788. /* Else will try to reuse look-ahead token after shifting the error
  1789. token. */
  1790. goto yyerrlab1;
  1791. /*---------------------------------------------------.
  1792. | yyerrorlab -- error raised explicitly by YYERROR. |
  1793. `---------------------------------------------------*/
  1794. yyerrorlab:
  1795. /* Pacify compilers like GCC when the user code never invokes
  1796. YYERROR and the label yyerrorlab therefore never appears in user
  1797. code. */
  1798. if (/*CONSTCOND*/ 0)
  1799. goto yyerrorlab;
  1800. yyerror_range[0] = yylsp[1-yylen];
  1801. /* Do not reclaim the symbols of the rule which action triggered
  1802. this YYERROR. */
  1803. YYPOPSTACK (yylen);
  1804. yylen = 0;
  1805. YY_STACK_PRINT (yyss, yyssp);
  1806. yystate = *yyssp;
  1807. goto yyerrlab1;
  1808. /*-------------------------------------------------------------.
  1809. | yyerrlab1 -- common code for both syntax error and YYERROR. |
  1810. `-------------------------------------------------------------*/
  1811. yyerrlab1:
  1812. yyerrstatus = 3; /* Each real token shifted decrements this. */
  1813. for (;;)
  1814. {
  1815. yyn = yypact[yystate];
  1816. if (yyn != YYPACT_NINF)
  1817. {
  1818. yyn += YYTERROR;
  1819. if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
  1820. {
  1821. yyn = yytable[yyn];
  1822. if (0 < yyn)
  1823. break;
  1824. }
  1825. }
  1826. /* Pop the current state because it cannot handle the error token. */
  1827. if (yyssp == yyss)
  1828. YYABORT;
  1829. yyerror_range[0] = *yylsp;
  1830. yydestruct ("Error: popping",
  1831. yystos[yystate], yyvsp, yylsp, context);
  1832. YYPOPSTACK (1);
  1833. yystate = *yyssp;
  1834. YY_STACK_PRINT (yyss, yyssp);
  1835. }
  1836. if (yyn == YYFINAL)
  1837. YYACCEPT;
  1838. *++yyvsp = yylval;
  1839. yyerror_range[1] = yylloc;
  1840. /* Using YYLLOC is tempting, but would change the location of
  1841. the look-ahead. YYLOC is available though. */
  1842. YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
  1843. *++yylsp = yyloc;
  1844. /* Shift the error token. */
  1845. YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
  1846. yystate = yyn;
  1847. goto yynewstate;
  1848. /*-------------------------------------.
  1849. | yyacceptlab -- YYACCEPT comes here. |
  1850. `-------------------------------------*/
  1851. yyacceptlab:
  1852. yyresult = 0;
  1853. goto yyreturn;
  1854. /*-----------------------------------.
  1855. | yyabortlab -- YYABORT comes here. |
  1856. `-----------------------------------*/
  1857. yyabortlab:
  1858. yyresult = 1;
  1859. goto yyreturn;
  1860. #ifndef yyoverflow
  1861. /*-------------------------------------------------.
  1862. | yyexhaustedlab -- memory exhaustion comes here. |
  1863. `-------------------------------------------------*/
  1864. yyexhaustedlab:
  1865. yyerror (&yylloc, context, YY_("memory exhausted"));
  1866. yyresult = 2;
  1867. /* Fall through. */
  1868. #endif
  1869. yyreturn:
  1870. if (yychar != YYEOF && yychar != YYEMPTY)
  1871. yydestruct ("Cleanup: discarding lookahead",
  1872. yytoken, &yylval, &yylloc, context);
  1873. /* Do not reclaim the symbols of the rule which action triggered
  1874. this YYABORT or YYACCEPT. */
  1875. YYPOPSTACK (yylen);
  1876. YY_STACK_PRINT (yyss, yyssp);
  1877. while (yyssp != yyss)
  1878. {
  1879. yydestruct ("Cleanup: popping",
  1880. yystos[*yyssp], yyvsp, yylsp, context);
  1881. YYPOPSTACK (1);
  1882. }
  1883. #ifndef yyoverflow
  1884. if (yyss != yyssa)
  1885. YYSTACK_FREE (yyss);
  1886. #endif
  1887. #if YYERROR_VERBOSE
  1888. if (yymsg != yymsgbuf)
  1889. YYSTACK_FREE (yymsg);
  1890. #endif
  1891. /* Make sure YYID is used. */
  1892. return YYID (yyresult);
  1893. }
  1894. #line 376 "eel2.y"