2 /* A Bison parser, made from matcher_parser_parse.y
3 by GNU Bison version 1.28 */
5 #define YYBISON 1 /* Identify Bison output. */
7 #define MATCHER_ALL 257
8 #define MATCHER_UNREAD 258
9 #define MATCHER_NOT_UNREAD 259
10 #define MATCHER_NEW 260
11 #define MATCHER_NOT_NEW 261
12 #define MATCHER_MARKED 262
13 #define MATCHER_NOT_MARKED 263
14 #define MATCHER_DELETED 264
15 #define MATCHER_NOT_DELETED 265
16 #define MATCHER_REPLIED 266
17 #define MATCHER_NOT_REPLIED 267
18 #define MATCHER_FORWARDED 268
19 #define MATCHER_NOT_FORWARDED 269
20 #define MATCHER_SUBJECT 270
21 #define MATCHER_NOT_SUBJECT 271
22 #define MATCHER_FROM 272
23 #define MATCHER_NOT_FROM 273
24 #define MATCHER_TO 274
25 #define MATCHER_NOT_TO 275
26 #define MATCHER_CC 276
27 #define MATCHER_NOT_CC 277
28 #define MATCHER_TO_OR_CC 278
29 #define MATCHER_NOT_TO_AND_NOT_CC 279
30 #define MATCHER_AGE_GREATER 280
31 #define MATCHER_AGE_LOWER 281
32 #define MATCHER_NEWSGROUPS 282
33 #define MATCHER_NOT_NEWSGROUPS 283
34 #define MATCHER_INREPLYTO 284
35 #define MATCHER_NOT_INREPLYTO 285
36 #define MATCHER_REFERENCES 286
37 #define MATCHER_NOT_REFERENCES 287
38 #define MATCHER_SCORE_GREATER 288
39 #define MATCHER_SCORE_LOWER 289
40 #define MATCHER_HEADER 290
41 #define MATCHER_NOT_HEADER 291
42 #define MATCHER_HEADERS_PART 292
43 #define MATCHER_NOT_HEADERS_PART 293
44 #define MATCHER_MESSAGE 294
45 #define MATCHER_NOT_MESSAGE 295
46 #define MATCHER_BODY_PART 296
47 #define MATCHER_NOT_BODY_PART 297
48 #define MATCHER_EXECUTE 298
49 #define MATCHER_NOT_EXECUTE 299
50 #define MATCHER_MATCHCASE 300
51 #define MATCHER_MATCH 301
52 #define MATCHER_REGEXPCASE 302
53 #define MATCHER_REGEXP 303
54 #define MATCHER_SCORE 304
55 #define MATCHER_MOVE 305
56 #define MATCHER_COPY 306
57 #define MATCHER_DELETE 307
58 #define MATCHER_MARK 308
59 #define MATCHER_UNMARK 309
60 #define MATCHER_MARK_AS_READ 310
61 #define MATCHER_MARK_AS_UNREAD 311
62 #define MATCHER_FORWARD 312
63 #define MATCHER_FORWARD_AS_ATTACHMENT 313
64 #define MATCHER_EOL 314
65 #define MATCHER_STRING 315
66 #define MATCHER_OR 316
67 #define MATCHER_AND 317
68 #define MATCHER_COLOR 318
69 #define MATCHER_SCORE_EQUAL 319
70 #define MATCHER_BOUNCE 320
71 #define MATCHER_DELETE_ON_SERVER 321
72 #define MATCHER_SECTION 322
73 #define MATCHER_INTEGER 323
75 #line 1 "matcher_parser_parse.y"
77 #include "filtering.h"
80 #include "matcher_parser.h"
81 #include "matcher_parser_lex.h"
87 static gint error = 0;
88 static gint bool_op = 0;
89 static gint match_type = 0;
90 static gchar * header = NULL;
92 static MatcherProp * prop;
94 static GSList * matchers_list = NULL;
96 static MatcherList * cond;
97 static gint score = 0;
98 static FilteringAction * action = NULL;
100 static FilteringProp * filtering;
101 static ScoringProp * scoring = NULL;
103 static GSList ** prefs_scoring = NULL;
104 static GSList ** prefs_filtering = NULL;
106 static int matcher_parser_dialog = 0;
109 /* ******************************************************************** */
113 void matcher_parser_start_parsing(FILE * f)
115 matcher_parserrestart(f);
116 matcher_parserparse();
119 FilteringProp * matcher_parser_get_filtering(gchar * str)
123 /* bad coding to enable the sub-grammar matching
125 matcher_parserlineno = 1;
126 matcher_parser_dialog = 1;
127 bufstate = matcher_parser_scan_string(str);
128 if (matcher_parserparse() != 0)
130 matcher_parser_dialog = 0;
131 matcher_parser_delete_buffer(bufstate);
135 ScoringProp * matcher_parser_get_scoring(gchar * str)
139 /* bad coding to enable the sub-grammar matching
141 matcher_parserlineno = 1;
142 matcher_parser_dialog = 1;
143 bufstate = matcher_parser_scan_string(str);
144 if (matcher_parserparse() != 0)
146 matcher_parser_dialog = 0;
147 matcher_parser_delete_buffer(bufstate);
151 MatcherList * matcher_parser_get_cond(gchar * str)
155 /* bad coding to enable the sub-grammar matching
157 matcher_parserlineno = 1;
158 matcher_parser_dialog = 1;
159 bufstate = matcher_parser_scan_string(str);
160 matcher_parserparse();
161 matcher_parser_dialog = 0;
162 matcher_parser_delete_buffer(bufstate);
166 MatcherProp * matcher_parser_get_prop(gchar * str)
171 matcher_parserlineno = 1;
172 list = matcher_parser_get_cond(str);
176 if (list->matchers == NULL)
179 if (list->matchers->next != NULL)
182 prop = list->matchers->data;
184 g_slist_free(list->matchers);
190 void matcher_parsererror(char * str)
195 for(l = matchers_list ; l != NULL ;
197 matcherprop_free((MatcherProp *)
199 g_slist_free(matchers_list);
200 matchers_list = NULL;
203 g_warning(_("scoring / filtering parsing: %i: %s\n"),
204 matcher_parserlineno, str);
208 int matcher_parserwrap(void)
213 #line 139 "matcher_parser_parse.y"
229 #define YYFLAG -32768
232 #define YYTRANSLATE(x) ((unsigned)(x) <= 323 ? yytranslate[x] : 88)
234 static const char yytranslate[] = { 0,
235 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
236 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
237 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
238 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
239 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
240 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
241 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
242 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
243 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
244 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
245 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
246 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
247 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
248 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
249 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
250 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
251 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
252 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
253 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
254 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
255 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
256 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
257 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
258 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
259 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
260 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
261 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
262 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
263 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
264 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
265 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
266 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
271 static const short yyprhs[] = { 0,
272 0, 1, 4, 7, 9, 11, 13, 16, 19, 22,
273 24, 27, 28, 30, 31, 33, 35, 37, 39, 41,
274 43, 45, 49, 51, 53, 55, 57, 59, 61, 63,
275 65, 67, 69, 71, 73, 75, 77, 79, 81, 85,
276 89, 93, 97, 101, 105, 109, 113, 117, 121, 124,
277 127, 131, 135, 139, 143, 147, 151, 154, 157, 160,
278 161, 167, 168, 174, 178, 182, 186, 190, 194, 198,
279 201, 204, 207, 210, 213, 215, 217, 219, 221, 223,
280 227, 231, 235, 238, 240
283 static const short yyrhs[] = { -1,
284 71, 72, 0, 73, 72, 0, 73, 0, 74, 0,
285 75, 0, 1, 60, 0, 68, 60, 0, 80, 76,
286 0, 60, 0, 78, 77, 0, 0, 60, 0, 0,
287 86, 0, 87, 0, 46, 0, 47, 0, 48, 0,
288 49, 0, 81, 0, 81, 82, 83, 0, 83, 0,
289 63, 0, 62, 0, 3, 0, 4, 0, 5, 0,
290 6, 0, 7, 0, 8, 0, 9, 0, 10, 0,
291 11, 0, 12, 0, 13, 0, 14, 0, 15, 0,
292 16, 79, 61, 0, 17, 79, 61, 0, 18, 79,
293 61, 0, 19, 79, 61, 0, 20, 79, 61, 0,
294 21, 79, 61, 0, 22, 79, 61, 0, 23, 79,
295 61, 0, 24, 79, 61, 0, 25, 79, 61, 0,
296 26, 69, 0, 27, 69, 0, 28, 79, 61, 0,
297 29, 79, 61, 0, 30, 79, 61, 0, 31, 79,
298 61, 0, 32, 79, 61, 0, 33, 79, 61, 0,
299 34, 69, 0, 35, 69, 0, 65, 69, 0, 0,
300 36, 61, 84, 79, 61, 0, 0, 37, 61, 85,
301 79, 61, 0, 38, 79, 61, 0, 39, 79, 61,
302 0, 40, 79, 61, 0, 41, 79, 61, 0, 42,
303 79, 61, 0, 43, 79, 61, 0, 44, 61, 0,
304 45, 61, 0, 44, 61, 0, 51, 61, 0, 52,
305 61, 0, 53, 0, 54, 0, 55, 0, 56, 0,
306 57, 0, 58, 69, 61, 0, 59, 69, 61, 0,
307 66, 69, 61, 0, 64, 69, 0, 67, 0, 50,
314 static const short yyrline[] = { 0,
315 173, 180, 182, 185, 188, 190, 191, 196, 216, 218,
316 221, 223, 234, 236, 247, 259, 271, 276, 280, 284,
317 290, 298, 303, 310, 315, 321, 329, 336, 343, 350,
318 357, 364, 371, 378, 385, 392, 399, 406, 413, 422,
319 431, 440, 449, 458, 467, 476, 485, 494, 503, 512,
320 521, 530, 539, 548, 557, 566, 575, 584, 593, 602,
321 605, 615, 618, 628, 637, 646, 655, 664, 673, 682,
322 691, 702, 712, 721, 730, 737, 744, 751, 758, 765,
323 776, 787, 798, 807, 815
328 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
330 static const char * const yytname[] = { "$","error","$undefined.","MATCHER_ALL",
331 "MATCHER_UNREAD","MATCHER_NOT_UNREAD","MATCHER_NEW","MATCHER_NOT_NEW","MATCHER_MARKED",
332 "MATCHER_NOT_MARKED","MATCHER_DELETED","MATCHER_NOT_DELETED","MATCHER_REPLIED",
333 "MATCHER_NOT_REPLIED","MATCHER_FORWARDED","MATCHER_NOT_FORWARDED","MATCHER_SUBJECT",
334 "MATCHER_NOT_SUBJECT","MATCHER_FROM","MATCHER_NOT_FROM","MATCHER_TO","MATCHER_NOT_TO",
335 "MATCHER_CC","MATCHER_NOT_CC","MATCHER_TO_OR_CC","MATCHER_NOT_TO_AND_NOT_CC",
336 "MATCHER_AGE_GREATER","MATCHER_AGE_LOWER","MATCHER_NEWSGROUPS","MATCHER_NOT_NEWSGROUPS",
337 "MATCHER_INREPLYTO","MATCHER_NOT_INREPLYTO","MATCHER_REFERENCES","MATCHER_NOT_REFERENCES",
338 "MATCHER_SCORE_GREATER","MATCHER_SCORE_LOWER","MATCHER_HEADER","MATCHER_NOT_HEADER",
339 "MATCHER_HEADERS_PART","MATCHER_NOT_HEADERS_PART","MATCHER_MESSAGE","MATCHER_NOT_MESSAGE",
340 "MATCHER_BODY_PART","MATCHER_NOT_BODY_PART","MATCHER_EXECUTE","MATCHER_NOT_EXECUTE",
341 "MATCHER_MATCHCASE","MATCHER_MATCH","MATCHER_REGEXPCASE","MATCHER_REGEXP","MATCHER_SCORE",
342 "MATCHER_MOVE","MATCHER_COPY","MATCHER_DELETE","MATCHER_MARK","MATCHER_UNMARK",
343 "MATCHER_MARK_AS_READ","MATCHER_MARK_AS_UNREAD","MATCHER_FORWARD","MATCHER_FORWARD_AS_ATTACHMENT",
344 "MATCHER_EOL","MATCHER_STRING","MATCHER_OR","MATCHER_AND","MATCHER_COLOR","MATCHER_SCORE_EQUAL",
345 "MATCHER_BOUNCE","MATCHER_DELETE_ON_SERVER","MATCHER_SECTION","MATCHER_INTEGER",
346 "file","@1","file_line_list","file_line","section_notification","instruction",
347 "end_instr_opt","end_action","filtering_or_scoring","match_type","condition",
348 "condition_list","bool_op","one_condition","@2","@3","filtering_action","scoring_rule", NULL
352 static const short yyr1[] = { 0,
353 71, 70, 72, 72, 73, 73, 73, 74, 75, 75,
354 76, 76, 77, 77, 78, 78, 79, 79, 79, 79,
355 80, 81, 81, 82, 82, 83, 83, 83, 83, 83,
356 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
357 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
358 83, 83, 83, 83, 83, 83, 83, 83, 83, 84,
359 83, 85, 83, 83, 83, 83, 83, 83, 83, 83,
360 83, 86, 86, 86, 86, 86, 86, 86, 86, 86,
364 static const short yyr2[] = { 0,
365 0, 2, 2, 1, 1, 1, 2, 2, 2, 1,
366 2, 0, 1, 0, 1, 1, 1, 1, 1, 1,
367 1, 3, 1, 1, 1, 1, 1, 1, 1, 1,
368 1, 1, 1, 1, 1, 1, 1, 1, 3, 3,
369 3, 3, 3, 3, 3, 3, 3, 3, 2, 2,
370 3, 3, 3, 3, 3, 3, 2, 2, 2, 0,
371 5, 0, 5, 3, 3, 3, 3, 3, 3, 2,
372 2, 2, 2, 2, 1, 1, 1, 1, 1, 3,
376 static const short yydefact[] = { 1,
377 0, 0, 26, 27, 28, 29, 30, 31, 32, 33,
378 34, 35, 36, 37, 38, 0, 0, 0, 0, 0,
379 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
380 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
381 0, 0, 0, 0, 0, 10, 0, 0, 2, 0,
382 5, 6, 12, 21, 23, 7, 17, 18, 19, 20,
383 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
384 49, 50, 0, 0, 0, 0, 0, 0, 57, 58,
385 60, 62, 0, 0, 0, 0, 0, 0, 70, 71,
386 59, 8, 3, 0, 0, 0, 0, 75, 76, 77,
387 78, 79, 0, 0, 0, 0, 84, 9, 14, 15,
388 16, 25, 24, 0, 39, 40, 41, 42, 43, 44,
389 45, 46, 47, 48, 51, 52, 53, 54, 55, 56,
390 0, 0, 64, 65, 66, 67, 68, 69, 72, 85,
391 73, 74, 0, 0, 83, 0, 13, 11, 22, 0,
392 0, 80, 81, 82, 61, 63, 0, 0, 0
395 static const short yydefgoto[] = { 157,
396 1, 49, 50, 51, 52, 108, 148, 109, 61, 53,
397 54, 114, 55, 131, 132, 110, 111
400 static const short yypact[] = {-32768,
401 115, -31,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
402 -32768,-32768,-32768,-32768,-32768, -29, -29, -29, -29, -29,
403 -29, -29, -29, -29, -29, 4, 5, -29, -29, -29,
404 -29, -29, -29, 6, 7, 16, 17, -29, -29, -29,
405 -29, -29, -29, 18, 19,-32768, 12, 22,-32768, 27,
406 -32768,-32768, 46, -53,-32768,-32768,-32768,-32768,-32768,-32768,
407 23, 24, 25, 28, 30, 32, 33, 45, 47, 48,
408 -32768,-32768, 50, 56, 100, 101, 102, 103,-32768,-32768,
409 -32768,-32768, 104, 105, 106, 107, 108, 109,-32768,-32768,
410 -32768,-32768,-32768, 110, 14, 111, 112,-32768,-32768,-32768,
411 -32768,-32768, 38, 113, 158, 159,-32768,-32768, 114,-32768,
412 -32768,-32768,-32768, 181,-32768,-32768,-32768,-32768,-32768,-32768,
413 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
414 -29, -29,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
415 -32768,-32768, 116, 117,-32768, 118,-32768,-32768,-32768, 120,
416 168,-32768,-32768,-32768,-32768,-32768, 88, 176,-32768
419 static const short yypgoto[] = {-32768,
420 -32768, 180,-32768,-32768,-32768,-32768,-32768,-32768, -17,-32768,
421 -32768,-32768, 119,-32768,-32768,-32768,-32768
428 static const short yytable[] = { 62,
429 63, 64, 65, 66, 67, 68, 69, 70, 112, 113,
430 73, 74, 75, 76, 77, 78, 57, 58, 59, 60,
431 83, 84, 85, 86, 87, 88, -4, 2, 56, 3,
432 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
433 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
434 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
435 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
436 44, 45, 71, 72, 79, 80, 81, 82, 89, 90,
437 91, 92, 140, 115, 116, 117, 46, 158, 118, 94,
438 119, 47, 120, 121, 48, 95, 96, 97, 98, 99,
439 100, 101, 102, 103, 104, 122, 143, 123, 124, 105,
440 125, 106, 107, 150, 151, 2, 126, 3, 4, 5,
441 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
442 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
443 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
444 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
445 127, 128, 129, 130, 133, 134, 135, 136, 137, 138,
446 139, 141, 142, 147, 46, 159, 152, 153, 154, 47,
447 155, 144, 48, 3, 4, 5, 6, 7, 8, 9,
448 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
449 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
450 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
451 40, 41, 42, 43, 44, 45, 145, 146, 156, 93,
452 0, 0, 149, 0, 0, 0, 0, 0, 0, 0,
456 static const short yycheck[] = { 17,
457 18, 19, 20, 21, 22, 23, 24, 25, 62, 63,
458 28, 29, 30, 31, 32, 33, 46, 47, 48, 49,
459 38, 39, 40, 41, 42, 43, 0, 1, 60, 3,
460 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
461 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
462 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
463 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
464 44, 45, 69, 69, 69, 69, 61, 61, 61, 61,
465 69, 60, 69, 61, 61, 61, 60, 0, 61, 44,
466 61, 65, 61, 61, 68, 50, 51, 52, 53, 54,
467 55, 56, 57, 58, 59, 61, 69, 61, 61, 64,
468 61, 66, 67, 131, 132, 1, 61, 3, 4, 5,
469 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
470 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
471 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
472 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
473 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
474 61, 61, 61, 60, 60, 0, 61, 61, 61, 65,
475 61, 69, 68, 3, 4, 5, 6, 7, 8, 9,
476 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
477 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
478 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
479 40, 41, 42, 43, 44, 45, 69, 69, 61, 50,
480 -1, -1, 114, -1, -1, -1, -1, -1, -1, -1,
481 -1, -1, -1, -1, -1, 65
483 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
484 #line 3 "/usr/lib/bison.simple"
485 /* This file comes from bison-1.28. */
487 /* Skeleton output parser for bison,
488 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
490 This program is free software; you can redistribute it and/or modify
491 it under the terms of the GNU General Public License as published by
492 the Free Software Foundation; either version 2, or (at your option)
495 This program is distributed in the hope that it will be useful,
496 but WITHOUT ANY WARRANTY; without even the implied warranty of
497 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
498 GNU General Public License for more details.
500 You should have received a copy of the GNU General Public License
501 along with this program; if not, write to the Free Software
502 Foundation, Inc., 59 Temple Place - Suite 330,
503 Boston, MA 02111-1307, USA. */
505 /* As a special exception, when this file is copied by Bison into a
506 Bison output file, you may use that output file without restriction.
507 This special exception was added by the Free Software Foundation
508 in version 1.24 of Bison. */
510 /* This is the parser code that is written into each bison parser
511 when the %semantic_parser declaration is not specified in the grammar.
512 It was written by Richard Stallman by simplifying the hairy parser
513 used when %semantic_parser is specified. */
515 #ifndef YYSTACK_USE_ALLOCA
517 #define YYSTACK_USE_ALLOCA
518 #else /* alloca not defined */
520 #define YYSTACK_USE_ALLOCA
521 #define alloca __builtin_alloca
522 #else /* not GNU C. */
523 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
524 #define YYSTACK_USE_ALLOCA
526 #else /* not sparc */
527 /* We think this test detects Watcom and Microsoft C. */
528 /* This used to test MSDOS, but that is a bad idea
529 since that symbol is in the user namespace. */
530 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
531 #if 0 /* No need for malloc.h, which pollutes the namespace;
532 instead, just don't use alloca. */
535 #else /* not MSDOS, or __TURBOC__ */
537 /* I don't know what this was needed for, but it pollutes the namespace.
538 So I turned it off. rms, 2 May 1997. */
539 /* #include <malloc.h> */
541 #define YYSTACK_USE_ALLOCA
542 #else /* not MSDOS, or __TURBOC__, or _AIX */
544 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
545 and on HPUX 10. Eventually we can turn this on. */
546 #define YYSTACK_USE_ALLOCA
547 #define alloca __builtin_alloca
550 #endif /* not _AIX */
551 #endif /* not MSDOS, or __TURBOC__ */
552 #endif /* not sparc */
553 #endif /* not GNU C */
554 #endif /* alloca not defined */
555 #endif /* YYSTACK_USE_ALLOCA not defined */
557 #ifdef YYSTACK_USE_ALLOCA
558 #define YYSTACK_ALLOC alloca
560 #define YYSTACK_ALLOC malloc
563 /* Note: there must be only one dollar sign in this file.
564 It is replaced by the list of actions, each action
565 as one case of the switch. */
567 #define yyerrok (yyerrstatus = 0)
568 #define yyclearin (yychar = YYEMPTY)
571 #define YYACCEPT goto yyacceptlab
572 #define YYABORT goto yyabortlab
573 #define YYERROR goto yyerrlab1
574 /* Like YYERROR except do call yyerror.
575 This remains here temporarily to ease the
576 transition to the new meaning of YYERROR, for GCC.
577 Once GCC version 2 has supplanted version 1, this can go. */
578 #define YYFAIL goto yyerrlab
579 #define YYRECOVERING() (!!yyerrstatus)
580 #define YYBACKUP(token, value) \
582 if (yychar == YYEMPTY && yylen == 1) \
583 { yychar = (token), yylval = (value); \
584 yychar1 = YYTRANSLATE (yychar); \
589 { yyerror ("syntax error: cannot back up"); YYERROR; } \
593 #define YYERRCODE 256
596 #define YYLEX yylex()
602 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
604 #define YYLEX yylex(&yylval, &yylloc)
606 #else /* not YYLSP_NEEDED */
608 #define YYLEX yylex(&yylval, YYLEX_PARAM)
610 #define YYLEX yylex(&yylval)
612 #endif /* not YYLSP_NEEDED */
615 /* If nonreentrant, generate the variables here */
619 int yychar; /* the lookahead symbol */
620 YYSTYPE yylval; /* the semantic value of the */
621 /* lookahead symbol */
624 YYLTYPE yylloc; /* location data for the lookahead */
628 int yynerrs; /* number of parse errors so far */
629 #endif /* not YYPURE */
632 int yydebug; /* nonzero means print parse trace */
633 /* Since this is uninitialized, it does not stop multiple parsers
637 /* YYINITDEPTH indicates the initial size of the parser's stacks */
640 #define YYINITDEPTH 200
643 /* YYMAXDEPTH is the maximum size the stacks can grow to
644 (effective only if the built-in stack extension method is used). */
651 #define YYMAXDEPTH 10000
654 /* Define __yy_memcpy. Note that the size argument
655 should be passed with type unsigned int, because that is what the non-GCC
656 definitions require. With GCC, __builtin_memcpy takes an arg
657 of type size_t, but it can handle unsigned int. */
659 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
660 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
661 #else /* not GNU C or C++ */
664 /* This is the most reliable way to avoid incompatibilities
665 in available built-in functions on various systems. */
667 __yy_memcpy (to, from, count)
672 register char *f = from;
673 register char *t = to;
674 register int i = count;
680 #else /* __cplusplus */
682 /* This is the most reliable way to avoid incompatibilities
683 in available built-in functions on various systems. */
685 __yy_memcpy (char *to, char *from, unsigned int count)
687 register char *t = to;
688 register char *f = from;
689 register int i = count;
698 #line 217 "/usr/lib/bison.simple"
700 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
701 into yyparse. The argument should have type void *.
702 It should actually point to an object.
703 Grammar actions can access the variable by casting it
704 to the proper pointer type. */
708 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
709 #define YYPARSE_PARAM_DECL
710 #else /* not __cplusplus */
711 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
712 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
713 #endif /* not __cplusplus */
714 #else /* not YYPARSE_PARAM */
715 #define YYPARSE_PARAM_ARG
716 #define YYPARSE_PARAM_DECL
717 #endif /* not YYPARSE_PARAM */
719 /* Prevent warning if -Wstrict-prototypes. */
722 int yyparse (void *);
729 yyparse(YYPARSE_PARAM_ARG)
732 register int yystate;
734 register short *yyssp;
735 register YYSTYPE *yyvsp;
736 int yyerrstatus; /* number of tokens to shift before error messages enabled */
737 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
739 short yyssa[YYINITDEPTH]; /* the state stack */
740 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
742 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
743 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
746 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
747 YYLTYPE *yyls = yylsa;
750 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
752 #define YYPOPSTACK (yyvsp--, yyssp--)
755 int yystacksize = YYINITDEPTH;
756 int yyfree_stacks = 0;
767 YYSTYPE yyval; /* the variable used to return */
768 /* semantic values from the action */
775 fprintf(stderr, "Starting parse\n");
781 yychar = YYEMPTY; /* Cause a token to be read. */
783 /* Initialize stack pointers.
784 Waste one element of value and location stack
785 so that they stay on the same level as the state stack.
786 The wasted elements are never initialized. */
794 /* Push a new state, which is found in yystate . */
795 /* In all cases, when you get here, the value and location stacks
796 have just been pushed. so pushing a state here evens the stacks. */
801 if (yyssp >= yyss + yystacksize - 1)
803 /* Give user a chance to reallocate the stack */
804 /* Use copies of these so that the &'s don't force the real ones into memory. */
805 YYSTYPE *yyvs1 = yyvs;
808 YYLTYPE *yyls1 = yyls;
811 /* Get the current used size of the three stacks, in elements. */
812 int size = yyssp - yyss + 1;
815 /* Each stack pointer address is followed by the size of
816 the data in use in that stack, in bytes. */
818 /* This used to be a conditional around just the two extra args,
819 but that might be undefined if yyoverflow is a macro. */
820 yyoverflow("parser stack overflow",
821 &yyss1, size * sizeof (*yyssp),
822 &yyvs1, size * sizeof (*yyvsp),
823 &yyls1, size * sizeof (*yylsp),
826 yyoverflow("parser stack overflow",
827 &yyss1, size * sizeof (*yyssp),
828 &yyvs1, size * sizeof (*yyvsp),
832 yyss = yyss1; yyvs = yyvs1;
836 #else /* no yyoverflow */
837 /* Extend the stack our own way. */
838 if (yystacksize >= YYMAXDEPTH)
840 yyerror("parser stack overflow");
852 if (yystacksize > YYMAXDEPTH)
853 yystacksize = YYMAXDEPTH;
854 #ifndef YYSTACK_USE_ALLOCA
857 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
858 __yy_memcpy ((char *)yyss, (char *)yyss1,
859 size * (unsigned int) sizeof (*yyssp));
860 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
861 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
862 size * (unsigned int) sizeof (*yyvsp));
864 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
865 __yy_memcpy ((char *)yyls, (char *)yyls1,
866 size * (unsigned int) sizeof (*yylsp));
868 #endif /* no yyoverflow */
870 yyssp = yyss + size - 1;
871 yyvsp = yyvs + size - 1;
873 yylsp = yyls + size - 1;
878 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
881 if (yyssp >= yyss + yystacksize - 1)
887 fprintf(stderr, "Entering state %d\n", yystate);
893 /* Do appropriate processing given the current state. */
894 /* Read a lookahead token if we need one and don't already have one. */
897 /* First try to decide what to do without reference to lookahead token. */
899 yyn = yypact[yystate];
903 /* Not known => get a lookahead token if don't already have one. */
905 /* yychar is either YYEMPTY or YYEOF
906 or a valid token in external form. */
908 if (yychar == YYEMPTY)
912 fprintf(stderr, "Reading a token: ");
917 /* Convert token to internal form (in yychar1) for indexing tables with */
919 if (yychar <= 0) /* This means end of input. */
922 yychar = YYEOF; /* Don't call YYLEX any more */
926 fprintf(stderr, "Now at end of input.\n");
931 yychar1 = YYTRANSLATE(yychar);
936 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
937 /* Give the individual parser a way to print the precise meaning
938 of a token, for further debugging info. */
940 YYPRINT (stderr, yychar, yylval);
942 fprintf (stderr, ")\n");
948 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
953 /* yyn is what to do for this token type in this state.
954 Negative => reduce, -yyn is rule number.
955 Positive => shift, yyn is new state.
956 New state is final state => don't bother to shift,
958 0, or most negative number => error. */
973 /* Shift the lookahead token. */
977 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
980 /* Discard the token being shifted unless it is eof. */
989 /* count tokens shifted since error; after three, turn off error status. */
990 if (yyerrstatus) yyerrstatus--;
995 /* Do the default action for the current state. */
998 yyn = yydefact[yystate];
1002 /* Do a reduction. yyn is the number of a rule to reduce with. */
1006 yyval = yyvsp[1-yylen]; /* implement default value of the action */
1013 fprintf (stderr, "Reducing via rule %d (line %d), ",
1016 /* Print the symbols being reduced, and their result. */
1017 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1018 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1019 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1027 #line 174 "matcher_parser_parse.y"
1029 if (!matcher_parser_dialog) {
1030 prefs_scoring = &global_scoring;
1031 prefs_filtering = &global_processing;
1036 #line 192 "matcher_parser_parse.y"
1042 #line 198 "matcher_parser_parse.y"
1044 gchar * folder = yyvsp[-1].str;
1045 FolderItem * item = NULL;
1047 if (!matcher_parser_dialog) {
1048 item = folder_find_item_from_identifier(folder);
1050 prefs_scoring = &global_scoring;
1051 prefs_filtering = &global_processing;
1054 prefs_scoring = &item->prefs->scoring;
1055 prefs_filtering = &item->prefs->processing;
1061 #line 224 "matcher_parser_parse.y"
1063 if (matcher_parser_dialog)
1066 matcher_parsererror("parse error");
1072 #line 237 "matcher_parser_parse.y"
1074 if (matcher_parser_dialog)
1077 matcher_parsererror("parse error");
1083 #line 249 "matcher_parser_parse.y"
1085 filtering = filteringprop_new(cond, action);
1088 if (!matcher_parser_dialog) {
1089 * prefs_filtering = g_slist_append(* prefs_filtering,
1096 #line 260 "matcher_parser_parse.y"
1098 scoring = scoringprop_new(cond, score);
1101 if (!matcher_parser_dialog) {
1102 * prefs_scoring = g_slist_append(* prefs_scoring, scoring);
1108 #line 273 "matcher_parser_parse.y"
1110 match_type = MATCHTYPE_MATCHCASE;
1114 #line 277 "matcher_parser_parse.y"
1116 match_type = MATCHTYPE_MATCH;
1120 #line 281 "matcher_parser_parse.y"
1122 match_type = MATCHTYPE_REGEXPCASE;
1126 #line 285 "matcher_parser_parse.y"
1128 match_type = MATCHTYPE_REGEXP;
1132 #line 292 "matcher_parser_parse.y"
1134 cond = matcherlist_new(matchers_list, (bool_op == MATCHERBOOL_AND));
1135 matchers_list = NULL;
1139 #line 300 "matcher_parser_parse.y"
1141 matchers_list = g_slist_append(matchers_list, prop);
1145 #line 304 "matcher_parser_parse.y"
1147 matchers_list = NULL;
1148 matchers_list = g_slist_append(matchers_list, prop);
1152 #line 312 "matcher_parser_parse.y"
1154 bool_op = MATCHERBOOL_AND;
1158 #line 316 "matcher_parser_parse.y"
1160 bool_op = MATCHERBOOL_OR;
1164 #line 323 "matcher_parser_parse.y"
1168 criteria = MATCHCRITERIA_ALL;
1169 prop = matcherprop_new(criteria, NULL, 0, NULL, 0);
1173 #line 330 "matcher_parser_parse.y"
1177 criteria = MATCHCRITERIA_UNREAD;
1178 prop = matcherprop_new(criteria, NULL, 0, NULL, 0);
1182 #line 337 "matcher_parser_parse.y"
1186 criteria = MATCHCRITERIA_NOT_UNREAD;
1187 prop = matcherprop_new(criteria, NULL, 0, NULL, 0);
1191 #line 344 "matcher_parser_parse.y"
1195 criteria = MATCHCRITERIA_NEW;
1196 prop = matcherprop_new(criteria, NULL, 0, NULL, 0);
1200 #line 351 "matcher_parser_parse.y"
1204 criteria = MATCHCRITERIA_NOT_NEW;
1205 prop = matcherprop_new(criteria, NULL, 0, NULL, 0);
1209 #line 358 "matcher_parser_parse.y"
1213 criteria = MATCHCRITERIA_MARKED;
1214 prop = matcherprop_new(criteria, NULL, 0, NULL, 0);
1218 #line 365 "matcher_parser_parse.y"
1222 criteria = MATCHCRITERIA_NOT_MARKED;
1223 prop = matcherprop_new(criteria, NULL, 0, NULL, 0);
1227 #line 372 "matcher_parser_parse.y"
1231 criteria = MATCHCRITERIA_DELETED;
1232 prop = matcherprop_new(criteria, NULL, 0, NULL, 0);
1236 #line 379 "matcher_parser_parse.y"
1240 criteria = MATCHCRITERIA_NOT_DELETED;
1241 prop = matcherprop_new(criteria, NULL, 0, NULL, 0);
1245 #line 386 "matcher_parser_parse.y"
1249 criteria = MATCHCRITERIA_REPLIED;
1250 prop = matcherprop_new(criteria, NULL, 0, NULL, 0);
1254 #line 393 "matcher_parser_parse.y"
1258 criteria = MATCHCRITERIA_NOT_REPLIED;
1259 prop = matcherprop_new(criteria, NULL, 0, NULL, 0);
1263 #line 400 "matcher_parser_parse.y"
1267 criteria = MATCHCRITERIA_FORWARDED;
1268 prop = matcherprop_new(criteria, NULL, 0, NULL, 0);
1272 #line 407 "matcher_parser_parse.y"
1276 criteria = MATCHCRITERIA_NOT_FORWARDED;
1277 prop = matcherprop_new(criteria, NULL, 0, NULL, 0);
1281 #line 414 "matcher_parser_parse.y"
1284 gchar * expr = NULL;
1286 criteria = MATCHCRITERIA_SUBJECT;
1287 expr = yyvsp[0].str;
1288 prop = matcherprop_new(criteria, NULL, match_type, expr, 0);
1292 #line 423 "matcher_parser_parse.y"
1295 gchar * expr = NULL;
1297 criteria = MATCHCRITERIA_NOT_SUBJECT;
1298 expr = yyvsp[0].str;
1299 prop = matcherprop_new(criteria, NULL, match_type, expr, 0);
1303 #line 432 "matcher_parser_parse.y"
1306 gchar * expr = NULL;
1308 criteria = MATCHCRITERIA_FROM;
1309 expr = yyvsp[0].str;
1310 prop = matcherprop_new(criteria, NULL, match_type, expr, 0);
1314 #line 441 "matcher_parser_parse.y"
1317 gchar * expr = NULL;
1319 criteria = MATCHCRITERIA_NOT_FROM;
1320 expr = yyvsp[0].str;
1321 prop = matcherprop_new(criteria, NULL, match_type, expr, 0);
1325 #line 450 "matcher_parser_parse.y"
1328 gchar * expr = NULL;
1330 criteria = MATCHCRITERIA_TO;
1331 expr = yyvsp[0].str;
1332 prop = matcherprop_new(criteria, NULL, match_type, expr, 0);
1336 #line 459 "matcher_parser_parse.y"
1339 gchar * expr = NULL;
1341 criteria = MATCHCRITERIA_NOT_TO;
1342 expr = yyvsp[0].str;
1343 prop = matcherprop_new(criteria, NULL, match_type, expr, 0);
1347 #line 468 "matcher_parser_parse.y"
1350 gchar * expr = NULL;
1352 criteria = MATCHCRITERIA_CC;
1353 expr = yyvsp[0].str;
1354 prop = matcherprop_new(criteria, NULL, match_type, expr, 0);
1358 #line 477 "matcher_parser_parse.y"
1361 gchar * expr = NULL;
1363 criteria = MATCHCRITERIA_NOT_CC;
1364 expr = yyvsp[0].str;
1365 prop = matcherprop_new(criteria, NULL, match_type, expr, 0);
1369 #line 486 "matcher_parser_parse.y"
1372 gchar * expr = NULL;
1374 criteria = MATCHCRITERIA_TO_OR_CC;
1375 expr = yyvsp[0].str;
1376 prop = matcherprop_new(criteria, NULL, match_type, expr, 0);
1380 #line 495 "matcher_parser_parse.y"
1383 gchar * expr = NULL;
1385 criteria = MATCHCRITERIA_NOT_TO_AND_NOT_CC;
1386 expr = yyvsp[0].str;
1387 prop = matcherprop_new(criteria, NULL, match_type, expr, 0);
1391 #line 504 "matcher_parser_parse.y"
1396 criteria = MATCHCRITERIA_AGE_GREATER;
1397 value = atoi(yyvsp[0].value);
1398 prop = matcherprop_new(criteria, NULL, 0, NULL, value);
1402 #line 513 "matcher_parser_parse.y"
1407 criteria = MATCHCRITERIA_AGE_LOWER;
1408 value = atoi(yyvsp[0].value);
1409 prop = matcherprop_new(criteria, NULL, 0, NULL, value);
1413 #line 522 "matcher_parser_parse.y"
1416 gchar * expr = NULL;
1418 criteria = MATCHCRITERIA_NEWSGROUPS;
1419 expr = yyvsp[0].str;
1420 prop = matcherprop_new(criteria, NULL, match_type, expr, 0);
1424 #line 531 "matcher_parser_parse.y"
1427 gchar * expr = NULL;
1429 criteria = MATCHCRITERIA_NOT_NEWSGROUPS;
1430 expr = yyvsp[0].str;
1431 prop = matcherprop_new(criteria, NULL, match_type, expr, 0);
1435 #line 540 "matcher_parser_parse.y"
1438 gchar * expr = NULL;
1440 criteria = MATCHCRITERIA_INREPLYTO;
1441 expr = yyvsp[0].str;
1442 prop = matcherprop_new(criteria, NULL, match_type, expr, 0);
1446 #line 549 "matcher_parser_parse.y"
1449 gchar * expr = NULL;
1451 criteria = MATCHCRITERIA_NOT_INREPLYTO;
1452 expr = yyvsp[0].str;
1453 prop = matcherprop_new(criteria, NULL, match_type, expr, 0);
1457 #line 558 "matcher_parser_parse.y"
1460 gchar * expr = NULL;
1462 criteria = MATCHCRITERIA_REFERENCES;
1463 expr = yyvsp[0].str;
1464 prop = matcherprop_new(criteria, NULL, match_type, expr, 0);
1468 #line 567 "matcher_parser_parse.y"
1471 gchar * expr = NULL;
1473 criteria = MATCHCRITERIA_NOT_REFERENCES;
1474 expr = yyvsp[0].str;
1475 prop = matcherprop_new(criteria, NULL, match_type, expr, 0);
1479 #line 576 "matcher_parser_parse.y"
1484 criteria = MATCHCRITERIA_SCORE_GREATER;
1485 value = atoi(yyvsp[0].value);
1486 prop = matcherprop_new(criteria, NULL, 0, NULL, value);
1490 #line 585 "matcher_parser_parse.y"
1495 criteria = MATCHCRITERIA_SCORE_LOWER;
1496 value = atoi(yyvsp[0].value);
1497 prop = matcherprop_new(criteria, NULL, 0, NULL, value);
1501 #line 594 "matcher_parser_parse.y"
1506 criteria = MATCHCRITERIA_SCORE_EQUAL;
1507 value = atoi(yyvsp[0].value);
1508 prop = matcherprop_new(criteria, NULL, 0, NULL, value);
1512 #line 603 "matcher_parser_parse.y"
1514 header = g_strdup(yyvsp[0].str);
1518 #line 606 "matcher_parser_parse.y"
1521 gchar * expr = NULL;
1523 criteria = MATCHCRITERIA_HEADER;
1524 expr = yyvsp[-3].str;
1525 prop = matcherprop_new(criteria, header, match_type, expr, 0);
1530 #line 616 "matcher_parser_parse.y"
1532 header = g_strdup(yyvsp[0].str);
1536 #line 619 "matcher_parser_parse.y"
1539 gchar * expr = NULL;
1541 criteria = MATCHCRITERIA_NOT_HEADER;
1542 expr = yyvsp[-3].str;
1543 prop = matcherprop_new(criteria, header, match_type, expr, 0);
1548 #line 629 "matcher_parser_parse.y"
1551 gchar * expr = NULL;
1553 criteria = MATCHCRITERIA_HEADERS_PART;
1554 expr = yyvsp[0].str;
1555 prop = matcherprop_new(criteria, NULL, match_type, expr, 0);
1559 #line 638 "matcher_parser_parse.y"
1562 gchar * expr = NULL;
1564 criteria = MATCHCRITERIA_NOT_HEADERS_PART;
1565 expr = yyvsp[0].str;
1566 prop = matcherprop_new(criteria, NULL, match_type, expr, 0);
1570 #line 647 "matcher_parser_parse.y"
1573 gchar * expr = NULL;
1575 criteria = MATCHCRITERIA_MESSAGE;
1576 expr = yyvsp[0].str;
1577 prop = matcherprop_new(criteria, NULL, match_type, expr, 0);
1581 #line 656 "matcher_parser_parse.y"
1584 gchar * expr = NULL;
1586 criteria = MATCHCRITERIA_NOT_MESSAGE;
1587 expr = yyvsp[0].str;
1588 prop = matcherprop_new(criteria, NULL, match_type, expr, 0);
1592 #line 665 "matcher_parser_parse.y"
1595 gchar * expr = NULL;
1597 criteria = MATCHCRITERIA_BODY_PART;
1598 expr = yyvsp[0].str;
1599 prop = matcherprop_new(criteria, NULL, match_type, expr, 0);
1603 #line 674 "matcher_parser_parse.y"
1606 gchar * expr = NULL;
1608 criteria = MATCHCRITERIA_NOT_BODY_PART;
1609 expr = yyvsp[0].str;
1610 prop = matcherprop_new(criteria, NULL, match_type, expr, 0);
1614 #line 683 "matcher_parser_parse.y"
1617 gchar * expr = NULL;
1619 criteria = MATCHCRITERIA_EXECUTE;
1620 expr = yyvsp[0].str;
1621 prop = matcherprop_new(criteria, NULL, 0, expr, 0);
1625 #line 692 "matcher_parser_parse.y"
1628 gchar * expr = NULL;
1630 criteria = MATCHCRITERIA_NOT_EXECUTE;
1631 expr = yyvsp[0].str;
1632 prop = matcherprop_new(criteria, NULL, 0, expr, 0);
1636 #line 704 "matcher_parser_parse.y"
1639 gint action_type = 0;
1641 action_type = MATCHACTION_EXECUTE;
1643 action = filteringaction_new(action_type, 0, cmd, 0);
1647 #line 713 "matcher_parser_parse.y"
1649 gchar * destination = NULL;
1650 gint action_type = 0;
1652 action_type = MATCHACTION_MOVE;
1653 destination = yyvsp[0].str;
1654 action = filteringaction_new(action_type, 0, destination, 0);
1658 #line 722 "matcher_parser_parse.y"
1660 gchar * destination = NULL;
1661 gint action_type = 0;
1663 action_type = MATCHACTION_COPY;
1664 destination = yyvsp[0].str;
1665 action = filteringaction_new(action_type, 0, destination, 0);
1669 #line 731 "matcher_parser_parse.y"
1671 gint action_type = 0;
1673 action_type = MATCHACTION_DELETE;
1674 action = filteringaction_new(action_type, 0, NULL, 0);
1678 #line 738 "matcher_parser_parse.y"
1680 gint action_type = 0;
1682 action_type = MATCHACTION_MARK;
1683 action = filteringaction_new(action_type, 0, NULL, 0);
1687 #line 745 "matcher_parser_parse.y"
1689 gint action_type = 0;
1691 action_type = MATCHACTION_UNMARK;
1692 action = filteringaction_new(action_type, 0, NULL, 0);
1696 #line 752 "matcher_parser_parse.y"
1698 gint action_type = 0;
1700 action_type = MATCHACTION_MARK_AS_READ;
1701 action = filteringaction_new(action_type, 0, NULL, 0);
1705 #line 759 "matcher_parser_parse.y"
1707 gint action_type = 0;
1709 action_type = MATCHACTION_MARK_AS_UNREAD;
1710 action = filteringaction_new(action_type, 0, NULL, 0);
1714 #line 766 "matcher_parser_parse.y"
1716 gchar * destination = NULL;
1717 gint action_type = 0;
1718 gint account_id = 0;
1720 action_type = MATCHACTION_FORWARD;
1721 account_id = atoi(yyvsp[-1].value);
1722 destination = yyvsp[0].str;
1723 action = filteringaction_new(action_type, account_id, destination, 0);
1727 #line 777 "matcher_parser_parse.y"
1729 gchar * destination = NULL;
1730 gint action_type = 0;
1731 gint account_id = 0;
1733 action_type = MATCHACTION_FORWARD_AS_ATTACHMENT;
1734 account_id = atoi(yyvsp[-1].value);
1735 destination = yyvsp[0].str;
1736 action = filteringaction_new(action_type, account_id, destination, 0);
1740 #line 788 "matcher_parser_parse.y"
1742 gchar * destination = NULL;
1743 gint action_type = 0;
1744 gint account_id = 0;
1746 action_type = MATCHACTION_BOUNCE;
1747 account_id = atoi(yyvsp[-1].value);
1748 destination = yyvsp[0].str;
1749 action = filteringaction_new(action_type, account_id, destination, 0);
1753 #line 799 "matcher_parser_parse.y"
1755 gint action_type = 0;
1758 action_type = MATCHACTION_COLOR;
1759 color = atoi(yyvsp[0].value);
1760 action = filteringaction_new(action_type, 0, NULL, color);
1764 #line 808 "matcher_parser_parse.y"
1766 gint action_type = 0;
1767 action_type = MATCHACTION_DELETE_ON_SERVER;
1768 action = filteringaction_new(action_type, 0, NULL, 0);
1772 #line 817 "matcher_parser_parse.y"
1774 score = atoi(yyvsp[0].value);
1778 /* the action file gets copied in in place of this dollarsign */
1779 #line 543 "/usr/lib/bison.simple"
1790 short *ssp1 = yyss - 1;
1791 fprintf (stderr, "state stack now");
1792 while (ssp1 != yyssp)
1793 fprintf (stderr, " %d", *++ssp1);
1794 fprintf (stderr, "\n");
1804 yylsp->first_line = yylloc.first_line;
1805 yylsp->first_column = yylloc.first_column;
1806 yylsp->last_line = (yylsp-1)->last_line;
1807 yylsp->last_column = (yylsp-1)->last_column;
1812 yylsp->last_line = (yylsp+yylen-1)->last_line;
1813 yylsp->last_column = (yylsp+yylen-1)->last_column;
1817 /* Now "shift" the result of the reduction.
1818 Determine what state that goes to,
1819 based on the state we popped back to
1820 and the rule number reduced by. */
1824 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1825 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1826 yystate = yytable[yystate];
1828 yystate = yydefgoto[yyn - YYNTBASE];
1832 yyerrlab: /* here on detecting error */
1835 /* If not already recovering from an error, report this error. */
1839 #ifdef YYERROR_VERBOSE
1840 yyn = yypact[yystate];
1842 if (yyn > YYFLAG && yyn < YYLAST)
1849 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
1850 for (x = (yyn < 0 ? -yyn : 0);
1851 x < (sizeof(yytname) / sizeof(char *)); x++)
1852 if (yycheck[x + yyn] == x)
1853 size += strlen(yytname[x]) + 15, count++;
1854 msg = (char *) malloc(size + 15);
1857 strcpy(msg, "parse error");
1862 for (x = (yyn < 0 ? -yyn : 0);
1863 x < (sizeof(yytname) / sizeof(char *)); x++)
1864 if (yycheck[x + yyn] == x)
1866 strcat(msg, count == 0 ? ", expecting `" : " or `");
1867 strcat(msg, yytname[x]);
1876 yyerror ("parse error; also virtual memory exceeded");
1879 #endif /* YYERROR_VERBOSE */
1880 yyerror("parse error");
1884 yyerrlab1: /* here on error raised explicitly by an action */
1886 if (yyerrstatus == 3)
1888 /* if just tried and failed to reuse lookahead token after an error, discard it. */
1890 /* return failure if at end of input */
1891 if (yychar == YYEOF)
1896 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
1902 /* Else will try to reuse lookahead token
1903 after shifting the error token. */
1905 yyerrstatus = 3; /* Each real token shifted decrements this */
1909 yyerrdefault: /* current state does not do anything special for the error token. */
1912 /* This is wrong; only states that explicitly want error tokens
1913 should shift them. */
1914 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
1915 if (yyn) goto yydefault;
1918 yyerrpop: /* pop the current state because it cannot handle the error token */
1920 if (yyssp == yyss) YYABORT;
1930 short *ssp1 = yyss - 1;
1931 fprintf (stderr, "Error: state stack now");
1932 while (ssp1 != yyssp)
1933 fprintf (stderr, " %d", *++ssp1);
1934 fprintf (stderr, "\n");
1940 yyn = yypact[yystate];
1945 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1964 fprintf(stderr, "Shifting error token, ");
1976 /* YYACCEPT comes here. */
1988 /* YYABORT comes here. */
1999 #line 821 "matcher_parser_parse.y"