add filtering conditions message greater than, smaller than, and exactly matching...
[claws.git] / src / matcher_parser_parse.y
index 685bbd97bc81fc0a9d624f73dcae1b655e702875..0ba0abfaa8ee2385c84b35481b25492afcd18583 100644 (file)
@@ -1,13 +1,15 @@
 %{
 %{
+#include "defs.h"
+
+#include <glib.h>
+
+#include "intl.h"
+#include "utils.h"
 #include "filtering.h"
 #include "scoring.h"
 #include "matcher.h"
 #include "matcher_parser.h"
 #include "matcher_parser_lex.h"
 #include "filtering.h"
 #include "scoring.h"
 #include "matcher.h"
 #include "matcher_parser.h"
 #include "matcher_parser_lex.h"
-#include "intl.h"
-#include <glib.h>
-#include "defs.h"
-#include "utils.h"
 
 static gint error = 0;
 static gint bool_op = 0;
 
 static gint error = 0;
 static gint bool_op = 0;
@@ -160,7 +162,8 @@ int matcher_parserwrap(void)
 %token MATCHER_MARK_AS_READ  MATCHER_MARK_AS_UNREAD  MATCHER_FORWARD
 %token MATCHER_FORWARD_AS_ATTACHMENT  MATCHER_EOL  MATCHER_STRING  
 %token MATCHER_OR MATCHER_AND  
 %token MATCHER_MARK_AS_READ  MATCHER_MARK_AS_UNREAD  MATCHER_FORWARD
 %token MATCHER_FORWARD_AS_ATTACHMENT  MATCHER_EOL  MATCHER_STRING  
 %token MATCHER_OR MATCHER_AND  
-%token MATCHER_COLOR MATCHER_SCORE_EQUAL MATCHER_BOUNCE
+%token MATCHER_COLOR MATCHER_SCORE_EQUAL MATCHER_BOUNCE MATCHER_DELETE_ON_SERVER
+%token MATCHER_SIZE_GREATER MATCHER_SIZE_SMALLER MATCHER_SIZE_EQUAL
 
 %start file
 
 
 %start file
 
@@ -599,6 +602,30 @@ MATCHER_ALL
        value = atoi($2);
        prop = matcherprop_new(criteria, NULL, 0, NULL, value);
 }
        value = atoi($2);
        prop = matcherprop_new(criteria, NULL, 0, NULL, value);
 }
+| MATCHER_SIZE_GREATER MATCHER_INTEGER 
+{
+       gint criteria = 0;
+       gint value    = 0;
+       criteria = MATCHCRITERIA_SIZE_GREATER;
+       value = atoi($2);
+       prop = matcherprop_new(criteria, NULL, 0, NULL, value);
+}
+| MATCHER_SIZE_SMALLER MATCHER_INTEGER
+{
+       gint criteria = 0;
+       gint value    = 0;
+       criteria = MATCHCRITERIA_SIZE_SMALLER;
+       value = atoi($2);
+       prop = matcherprop_new(criteria, NULL, 0, NULL, value);
+}
+| MATCHER_SIZE_EQUAL MATCHER_INTEGER
+{
+       gint criteria = 0;
+       gint value    = 0;
+       criteria = MATCHCRITERIA_SIZE_EQUAL;
+       value = atoi($2);
+       prop = matcherprop_new(criteria, NULL, 0, NULL, value);
+}
 | MATCHER_HEADER MATCHER_STRING
 {
        header = g_strdup($2);
 | MATCHER_HEADER MATCHER_STRING
 {
        header = g_strdup($2);
@@ -804,6 +831,12 @@ MATCHER_EXECUTE MATCHER_STRING
        color = atoi($2);
        action = filteringaction_new(action_type, 0, NULL, color);
 }
        color = atoi($2);
        action = filteringaction_new(action_type, 0, NULL, color);
 }
+| MATCHER_DELETE_ON_SERVER
+{
+       gint action_type = 0;
+       action_type = MATCHACTION_DELETE_ON_SERVER;
+       action = filteringaction_new(action_type, 0, NULL, 0);
+}
 ;
 
 scoring_rule:
 ;
 
 scoring_rule: