parser.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
  1. #ifndef lint
  2. static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93";
  3. #endif
  4. #define YYBYACC 1
  5. #define YYMAJOR 1
  6. #define YYMINOR 9
  7. #define YYPATCH 20140101
  8. #define YYEMPTY (-1)
  9. #define yyclearin (yychar = YYEMPTY)
  10. #define yyerrok (yyerrflag = 0)
  11. #define YYRECOVERING() (yyerrflag != 0)
  12. #define YYPREFIX "yy"
  13. #define YYPURE 0
  14. #line 2 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/parser.y"
  15. #include <stdio.h>
  16. #include <string.h>
  17. #include "expression.h"
  18. #include "lexer.h"
  19. #include "filter.h"
  20. void yyerror(const char *str)
  21. {
  22. fprintf(stderr,"Parse error: %s\n",str);
  23. }
  24. int yywrap()
  25. {
  26. return 1;
  27. }
  28. extern node_t *zfilter;
  29. #line 22 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/parser.y"
  30. #ifdef YYSTYPE
  31. #undef YYSTYPE_IS_DECLARED
  32. #define YYSTYPE_IS_DECLARED 1
  33. #endif
  34. #ifndef YYSTYPE_IS_DECLARED
  35. #define YYSTYPE_IS_DECLARED 1
  36. typedef union {
  37. int int_literal;
  38. char *string_literal;
  39. struct node_st *expr;
  40. } YYSTYPE;
  41. #endif /* !YYSTYPE_IS_DECLARED */
  42. #line 51 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/parser.c"
  43. /* compatibility with bison */
  44. #ifdef YYPARSE_PARAM
  45. /* compatibility with FreeBSD */
  46. # ifdef YYPARSE_PARAM_TYPE
  47. # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
  48. # else
  49. # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
  50. # endif
  51. #else
  52. # define YYPARSE_DECL() yyparse(void)
  53. #endif
  54. /* Parameters sent to lex. */
  55. #ifdef YYLEX_PARAM
  56. # define YYLEX_DECL() yylex(void *YYLEX_PARAM)
  57. # define YYLEX yylex(YYLEX_PARAM)
  58. #else
  59. # define YYLEX_DECL() yylex(void)
  60. # define YYLEX yylex()
  61. #endif
  62. /* Parameters sent to yyerror. */
  63. #ifndef YYERROR_DECL
  64. #define YYERROR_DECL() yyerror(const char *s)
  65. #endif
  66. #ifndef YYERROR_CALL
  67. #define YYERROR_CALL(msg) yyerror(msg)
  68. #endif
  69. extern int YYPARSE_DECL();
  70. #define T_AND 257
  71. #define T_OR 258
  72. #define T_NUMBER 259
  73. #define T_FIELD 260
  74. #define T_NOT_EQ 261
  75. #define T_GT_EQ 262
  76. #define T_LT_EQ 263
  77. #define YYERRCODE 256
  78. static const short yylhs[] = { -1,
  79. 0, 4, 4, 4, 4, 1, 1, 2, 2, 2,
  80. 2, 2, 2, 3, 3,
  81. };
  82. static const short yylen[] = { 2,
  83. 1, 3, 3, 3, 1, 1, 1, 3, 3, 3,
  84. 3, 3, 3, 3, 3,
  85. };
  86. static const short yydefred[] = { 0,
  87. 0, 0, 0, 5, 6, 7, 0, 0, 0, 0,
  88. 0, 0, 0, 0, 0, 0, 4, 11, 15, 12,
  89. 9, 10, 8, 14, 13, 3, 0,
  90. };
  91. static const short yydgoto[] = { 3,
  92. 4, 5, 6, 7,
  93. };
  94. static const short yysindex[] = { -40,
  95. -40, -57, 0, 0, 0, 0, -250, -39, -249, -245,
  96. -244, -243, -247, -242, -40, -40, 0, 0, 0, 0,
  97. 0, 0, 0, 0, 0, 0, -248,
  98. };
  99. static const short yyrindex[] = { 0,
  100. 0, 0, 0, 0, 0, 0, 18, 0, 0, 0,
  101. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  102. 0, 0, 0, 0, 0, 0, 1,
  103. };
  104. static const short yygindex[] = { 0,
  105. 0, 0, 0, 5,
  106. };
  107. #define YYTABLESIZE 259
  108. static const short yytable[] = { 1,
  109. 2, 17, 12, 13, 11, 8, 15, 16, 15, 18,
  110. 19, 23, 24, 20, 21, 22, 25, 1, 0, 26,
  111. 27, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  112. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  113. 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,
  114. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  115. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  116. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  117. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  118. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  119. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  120. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  121. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  122. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  123. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  124. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  125. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  126. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  127. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  128. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  129. 0, 0, 0, 9, 10, 14, 0, 0, 0, 0,
  130. 0, 0, 0, 0, 0, 0, 0, 15, 16, 2,
  131. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  132. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  133. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  134. 0, 0, 0, 0, 0, 0, 0, 0, 2,
  135. };
  136. static const short yycheck[] = { 40,
  137. 0, 41, 60, 61, 62, 1, 257, 258, 257, 259,
  138. 260, 259, 260, 259, 259, 259, 259, 0, -1, 15,
  139. 16, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  140. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  141. -1, 41, -1, -1, -1, -1, -1, -1, -1, -1,
  142. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  143. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  144. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  145. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  146. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  147. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  148. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  149. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  150. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  151. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  152. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  153. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  154. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  155. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  156. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  157. -1, -1, -1, 261, 262, 263, -1, -1, -1, -1,
  158. -1, -1, -1, -1, -1, -1, -1, 257, 258, 260,
  159. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  160. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  161. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  162. -1, -1, -1, -1, -1, -1, -1, -1, 258,
  163. };
  164. #define YYFINAL 3
  165. #ifndef YYDEBUG
  166. #define YYDEBUG 0
  167. #endif
  168. #define YYMAXTOKEN 263
  169. #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
  170. #if YYDEBUG
  171. static const char *yyname[] = {
  172. "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  173. 0,0,0,0,0,0,"'('","')'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'<'","'='","'>'",0,
  174. 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  175. 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  176. 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  177. 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  178. 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"T_AND",
  179. "T_OR","T_NUMBER","T_FIELD","T_NOT_EQ","T_GT_EQ","T_LT_EQ","illegal-symbol",
  180. };
  181. static const char *yyrule[] = {
  182. "$accept : expression",
  183. "expression : filter_expr",
  184. "filter_expr : filter_expr T_OR filter_expr",
  185. "filter_expr : filter_expr T_AND filter_expr",
  186. "filter_expr : '(' filter_expr ')'",
  187. "filter_expr : filter",
  188. "filter : number_filter",
  189. "filter : string_filter",
  190. "number_filter : T_FIELD '=' T_NUMBER",
  191. "number_filter : T_FIELD '>' T_NUMBER",
  192. "number_filter : T_FIELD '<' T_NUMBER",
  193. "number_filter : T_FIELD T_NOT_EQ T_NUMBER",
  194. "number_filter : T_FIELD T_GT_EQ T_NUMBER",
  195. "number_filter : T_FIELD T_LT_EQ T_NUMBER",
  196. "string_filter : T_FIELD '=' T_FIELD",
  197. "string_filter : T_FIELD T_NOT_EQ T_FIELD",
  198. };
  199. #endif
  200. int yydebug;
  201. int yynerrs;
  202. int yyerrflag;
  203. int yychar;
  204. YYSTYPE yyval;
  205. YYSTYPE yylval;
  206. /* define the initial stack-sizes */
  207. #ifdef YYSTACKSIZE
  208. #undef YYMAXDEPTH
  209. #define YYMAXDEPTH YYSTACKSIZE
  210. #else
  211. #ifdef YYMAXDEPTH
  212. #define YYSTACKSIZE YYMAXDEPTH
  213. #else
  214. #define YYSTACKSIZE 10000
  215. #define YYMAXDEPTH 10000
  216. #endif
  217. #endif
  218. #define YYINITSTACKSIZE 200
  219. typedef struct {
  220. unsigned stacksize;
  221. short *s_base;
  222. short *s_mark;
  223. short *s_last;
  224. YYSTYPE *l_base;
  225. YYSTYPE *l_mark;
  226. } YYSTACKDATA;
  227. /* variables for the parser stack */
  228. static YYSTACKDATA yystack;
  229. #line 143 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/parser.y"
  230. #line 252 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/parser.c"
  231. #if YYDEBUG
  232. #include <stdio.h> /* needed for printf */
  233. #endif
  234. #include <stdlib.h> /* needed for malloc, etc */
  235. #include <string.h> /* needed for memset */
  236. /* allocate initial stack or double stack size, up to YYMAXDEPTH */
  237. static int yygrowstack(YYSTACKDATA *data)
  238. {
  239. int i;
  240. unsigned newsize;
  241. short *newss;
  242. YYSTYPE *newvs;
  243. if ((newsize = data->stacksize) == 0)
  244. newsize = YYINITSTACKSIZE;
  245. else if (newsize >= YYMAXDEPTH)
  246. return -1;
  247. else if ((newsize *= 2) > YYMAXDEPTH)
  248. newsize = YYMAXDEPTH;
  249. i = (int) (data->s_mark - data->s_base);
  250. newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
  251. if (newss == 0)
  252. return -1;
  253. data->s_base = newss;
  254. data->s_mark = newss + i;
  255. newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
  256. if (newvs == 0)
  257. return -1;
  258. data->l_base = newvs;
  259. data->l_mark = newvs + i;
  260. data->stacksize = newsize;
  261. data->s_last = data->s_base + newsize - 1;
  262. return 0;
  263. }
  264. #if YYPURE || defined(YY_NO_LEAKS)
  265. static void yyfreestack(YYSTACKDATA *data)
  266. {
  267. free(data->s_base);
  268. free(data->l_base);
  269. memset(data, 0, sizeof(*data));
  270. }
  271. #else
  272. #define yyfreestack(data) /* nothing */
  273. #endif
  274. #define YYABORT goto yyabort
  275. #define YYREJECT goto yyabort
  276. #define YYACCEPT goto yyaccept
  277. #define YYERROR goto yyerrlab
  278. int
  279. YYPARSE_DECL()
  280. {
  281. int yym, yyn, yystate;
  282. #if YYDEBUG
  283. const char *yys;
  284. if ((yys = getenv("YYDEBUG")) != 0)
  285. {
  286. yyn = *yys;
  287. if (yyn >= '0' && yyn <= '9')
  288. yydebug = yyn - '0';
  289. }
  290. #endif
  291. yynerrs = 0;
  292. yyerrflag = 0;
  293. yychar = YYEMPTY;
  294. yystate = 0;
  295. #if YYPURE
  296. memset(&yystack, 0, sizeof(yystack));
  297. #endif
  298. if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow;
  299. yystack.s_mark = yystack.s_base;
  300. yystack.l_mark = yystack.l_base;
  301. yystate = 0;
  302. *yystack.s_mark = 0;
  303. yyloop:
  304. if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
  305. if (yychar < 0)
  306. {
  307. if ((yychar = YYLEX) < 0) yychar = 0;
  308. #if YYDEBUG
  309. if (yydebug)
  310. {
  311. yys = yyname[YYTRANSLATE(yychar)];
  312. printf("%sdebug: state %d, reading %d (%s)\n",
  313. YYPREFIX, yystate, yychar, yys);
  314. }
  315. #endif
  316. }
  317. if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
  318. yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
  319. {
  320. #if YYDEBUG
  321. if (yydebug)
  322. printf("%sdebug: state %d, shifting to state %d\n",
  323. YYPREFIX, yystate, yytable[yyn]);
  324. #endif
  325. if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
  326. {
  327. goto yyoverflow;
  328. }
  329. yystate = yytable[yyn];
  330. *++yystack.s_mark = yytable[yyn];
  331. *++yystack.l_mark = yylval;
  332. yychar = YYEMPTY;
  333. if (yyerrflag > 0) --yyerrflag;
  334. goto yyloop;
  335. }
  336. if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
  337. yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
  338. {
  339. yyn = yytable[yyn];
  340. goto yyreduce;
  341. }
  342. if (yyerrflag) goto yyinrecovery;
  343. yyerror("syntax error");
  344. goto yyerrlab;
  345. yyerrlab:
  346. ++yynerrs;
  347. yyinrecovery:
  348. if (yyerrflag < 3)
  349. {
  350. yyerrflag = 3;
  351. for (;;)
  352. {
  353. if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 &&
  354. yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
  355. {
  356. #if YYDEBUG
  357. if (yydebug)
  358. printf("%sdebug: state %d, error recovery shifting\
  359. to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
  360. #endif
  361. if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
  362. {
  363. goto yyoverflow;
  364. }
  365. yystate = yytable[yyn];
  366. *++yystack.s_mark = yytable[yyn];
  367. *++yystack.l_mark = yylval;
  368. goto yyloop;
  369. }
  370. else
  371. {
  372. #if YYDEBUG
  373. if (yydebug)
  374. printf("%sdebug: error recovery discarding state %d\n",
  375. YYPREFIX, *yystack.s_mark);
  376. #endif
  377. if (yystack.s_mark <= yystack.s_base) goto yyabort;
  378. --yystack.s_mark;
  379. --yystack.l_mark;
  380. }
  381. }
  382. }
  383. else
  384. {
  385. if (yychar == 0) goto yyabort;
  386. #if YYDEBUG
  387. if (yydebug)
  388. {
  389. yys = yyname[YYTRANSLATE(yychar)];
  390. printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
  391. YYPREFIX, yystate, yychar, yys);
  392. }
  393. #endif
  394. yychar = YYEMPTY;
  395. goto yyloop;
  396. }
  397. yyreduce:
  398. #if YYDEBUG
  399. if (yydebug)
  400. printf("%sdebug: state %d, reducing by rule %d (%s)\n",
  401. YYPREFIX, yystate, yyn, yyrule[yyn]);
  402. #endif
  403. yym = yylen[yyn];
  404. if (yym)
  405. yyval = yystack.l_mark[1-yym];
  406. else
  407. memset(&yyval, 0, sizeof yyval);
  408. switch (yyn)
  409. {
  410. case 1:
  411. #line 45 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/parser.y"
  412. {
  413. zfilter = yystack.l_mark[0].expr;
  414. }
  415. break;
  416. case 2:
  417. #line 52 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/parser.y"
  418. {
  419. yyval.expr = make_op_node(OR);
  420. yyval.expr->left_child = yystack.l_mark[-2].expr;
  421. yyval.expr->right_child = yystack.l_mark[0].expr;
  422. }
  423. break;
  424. case 3:
  425. #line 58 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/parser.y"
  426. {
  427. yyval.expr = make_op_node(AND);
  428. yyval.expr->left_child = yystack.l_mark[-2].expr;
  429. yyval.expr->right_child = yystack.l_mark[0].expr;
  430. }
  431. break;
  432. case 4:
  433. #line 64 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/parser.y"
  434. {
  435. yyval.expr = yystack.l_mark[-1].expr;
  436. }
  437. break;
  438. case 5:
  439. #line 68 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/parser.y"
  440. {
  441. yyval.expr = yystack.l_mark[0].expr;
  442. }
  443. break;
  444. case 6:
  445. #line 74 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/parser.y"
  446. {
  447. yyval.expr = yystack.l_mark[0].expr;
  448. }
  449. break;
  450. case 7:
  451. #line 78 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/parser.y"
  452. {
  453. yyval.expr = yystack.l_mark[0].expr;
  454. }
  455. break;
  456. case 8:
  457. #line 84 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/parser.y"
  458. {
  459. yyval.expr = make_op_node(EQ);
  460. yyval.expr->left_child = make_field_node(yystack.l_mark[-2].string_literal);
  461. yyval.expr->right_child = make_int_node(yystack.l_mark[0].int_literal);
  462. }
  463. break;
  464. case 9:
  465. #line 91 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/parser.y"
  466. {
  467. yyval.expr = make_op_node(GT);
  468. yyval.expr->left_child = make_field_node(yystack.l_mark[-2].string_literal);
  469. yyval.expr->right_child = make_int_node(yystack.l_mark[0].int_literal);
  470. }
  471. break;
  472. case 10:
  473. #line 98 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/parser.y"
  474. {
  475. yyval.expr = make_op_node(LT);
  476. yyval.expr->left_child = make_field_node(yystack.l_mark[-2].string_literal);
  477. yyval.expr->right_child = make_int_node(yystack.l_mark[0].int_literal);
  478. }
  479. break;
  480. case 11:
  481. #line 105 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/parser.y"
  482. {
  483. yyval.expr = make_op_node(NEQ);
  484. yyval.expr->left_child = make_field_node(yystack.l_mark[-2].string_literal);
  485. yyval.expr->right_child = make_int_node(yystack.l_mark[0].int_literal);
  486. }
  487. break;
  488. case 12:
  489. #line 112 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/parser.y"
  490. {
  491. yyval.expr = make_op_node(GT_EQ);
  492. yyval.expr->left_child = make_field_node(yystack.l_mark[-2].string_literal);
  493. yyval.expr->right_child = make_int_node(yystack.l_mark[0].int_literal);
  494. }
  495. break;
  496. case 13:
  497. #line 119 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/parser.y"
  498. {
  499. yyval.expr = make_op_node(LT_EQ);
  500. yyval.expr->left_child = make_field_node(yystack.l_mark[-2].string_literal);
  501. yyval.expr->right_child = make_int_node(yystack.l_mark[0].int_literal);
  502. }
  503. break;
  504. case 14:
  505. #line 128 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/parser.y"
  506. {
  507. yyval.expr = make_op_node(EQ);
  508. yyval.expr->left_child = make_field_node(yystack.l_mark[-2].string_literal);
  509. yyval.expr->right_child = make_string_node(yystack.l_mark[0].string_literal);
  510. }
  511. break;
  512. case 15:
  513. #line 135 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/parser.y"
  514. {
  515. yyval.expr = make_op_node(NEQ);
  516. yyval.expr->left_child = make_field_node(yystack.l_mark[-2].string_literal);
  517. yyval.expr->right_child = make_string_node(yystack.l_mark[0].string_literal);
  518. }
  519. break;
  520. #line 564 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/parser.c"
  521. }
  522. yystack.s_mark -= yym;
  523. yystate = *yystack.s_mark;
  524. yystack.l_mark -= yym;
  525. yym = yylhs[yyn];
  526. if (yystate == 0 && yym == 0)
  527. {
  528. #if YYDEBUG
  529. if (yydebug)
  530. printf("%sdebug: after reduction, shifting from state 0 to\
  531. state %d\n", YYPREFIX, YYFINAL);
  532. #endif
  533. yystate = YYFINAL;
  534. *++yystack.s_mark = YYFINAL;
  535. *++yystack.l_mark = yyval;
  536. if (yychar < 0)
  537. {
  538. if ((yychar = YYLEX) < 0) yychar = 0;
  539. #if YYDEBUG
  540. if (yydebug)
  541. {
  542. yys = yyname[YYTRANSLATE(yychar)];
  543. printf("%sdebug: state %d, reading %d (%s)\n",
  544. YYPREFIX, YYFINAL, yychar, yys);
  545. }
  546. #endif
  547. }
  548. if (yychar == 0) goto yyaccept;
  549. goto yyloop;
  550. }
  551. if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
  552. yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
  553. yystate = yytable[yyn];
  554. else
  555. yystate = yydgoto[yym];
  556. #if YYDEBUG
  557. if (yydebug)
  558. printf("%sdebug: after reduction, shifting from state %d \
  559. to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
  560. #endif
  561. if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
  562. {
  563. goto yyoverflow;
  564. }
  565. *++yystack.s_mark = (short) yystate;
  566. *++yystack.l_mark = yyval;
  567. goto yyloop;
  568. yyoverflow:
  569. yyerror("yacc stack overflow");
  570. yyabort:
  571. yyfreestack(&yystack);
  572. return (1);
  573. yyaccept:
  574. yyfreestack(&yystack);
  575. return (0);
  576. }