fixed some errors !
authorsiboud <siboud@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 7 Feb 2005 14:14:03 +0000 (14:14 +0000)
committersiboud <siboud@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 7 Feb 2005 14:14:03 +0000 (14:14 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@868 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/lttv/filter.c

index 380cfe0639d3f29bba64361fd7feceafd044ecb7..6142235309a9fd9c62187483758c7cba0e3fdba7 100644 (file)
@@ -57,9 +57,9 @@ parse_simple_expression(GString* expression) {
        
        unsigned i;
 
-       for(i=0;i<strlen(expression);i++) {
-
-       }
+//     for(i=0;i<strlen(expression);i++) {
+//
+//     }
 }
 
 /**
@@ -99,70 +99,69 @@ lttv_filter_new(char *expression, LttvTrace *t) {
        /*
         *      Parse entire expression and construct
         *      the binary tree.  There are two steps 
-   *   in browsing that string
-   *     1. finding boolean ops ( &,|,^,! ) and parenthesis
-   *     2. finding simple expressions
-   *       - field path
-   *       - op ( >, <, =, >=, <=, !=)
-   *       - value
-        */
+        *      in browsing that string
+        *        1. finding boolean ops ( &,|,^,! ) and parenthesis
+        *        2. finding simple expressions
+        *          - field path
+        *          - op ( >, <, =, >=, <=, !=)
+        *          - value
+       */
+
        for(i=0;i<strlen(expression);i++) {
                switch(expression[i]) {
-      /*
-       *  boolean operators
-       */
+                       /*
+                        *   boolean operators
+                        */
                        case '&':               /* and */
-                               parse_simple_expression(currentOption);
-                               g_print("%s\n",&currentOption);
-                               currentOption = g_string_new("");
+                               parse_simple_expression(current_option);
+                               g_print("%s\n",&current_option);
+                               current_option = g_string_new("");
                                break;
                        case '|':               /* or */
-                               g_print("%s\n",currentOption);
-                               currentOption = g_string_new("");
+                               g_print("%s\n",current_option);
+                               current_option = g_string_new("");
                                break;
                        case '^':               /* xor */
-                               g_print("%s\n",currentOption);
-                               currentOption = g_string_new("");
+                               g_print("%s\n",current_option);
+                               current_option = g_string_new("");
                                break;
                        case '!':               /* not, or not equal (math op) */
-        if(expression[i+1] == '=') {  /* != */
-          current_expression.op = LTTV_FIELD_NE;
-          i++;
-        } else {  /* ! */
-                               g_print("%s\n",currentOption);
-                               currentOption = g_string_new("");
-        }
-        break;
+                               if(expression[i+1] == '=') {  /* != */
+                                 current_expression.op = LTTV_FIELD_NE;
+                                 i++;
+                               } else {  /* ! */
+                                 g_print("%s\n",current_option);
+                                 current_option = g_string_new("");
+                               }
+                               break;
                        case '(':               /* start of parenthesis */
                                p++;
                                break;
                        case ')':               /* end of parenthesis */
                                p--;
                                break;
-      /*
-       *  mathematic operators
-       */
-      case '<':   /* lower, lower or equal */
-        if(expression[i+1] == '=') { /* <= */
-          i++;
-          current_expression.op = LTTV_FIELD_LE;                  
-        } else current_expression.op = LTTV_FIELD_LT;
-        break;
-      case '>':   /* higher, higher or equal */
-        if(expression[i+1] == '=') { /* >= */
-          i++;
-          current_expression.op = LTTV_FIELD_GE;                  
-        } else current_expression.op = LTTV_FIELD_GT;
-        break;
-      case '=':   /* equal */
-        current_expression.op = LTTV_FIELD_EQ;
-        break;
-      case 
+
+                       /*      
+                        *      mathematic operators
+                        */
+                       case '<':   /* lower, lower or equal */
+                               if(expression[i+1] == '=') { /* <= */
+                                 i++;
+                                 current_expression.op = LTTV_FIELD_LE;                  
+                               } else current_expression.op = LTTV_FIELD_LT;
+                               break;
+                       case '>':   /* higher, higher or equal */
+                               if(expression[i+1] == '=') { /* >= */
+                                 i++;
+                                 current_expression.op = LTTV_FIELD_GE;                  
+                               } else current_expression.op = LTTV_FIELD_GT;
+                               break;
+                       case '=':   /* equal */
+                               current_expression.op = LTTV_FIELD_EQ;
+                               break;
                        default:                /* concatening current string */
-                               g_string_append_c(currentOption,expression[i]);                                 
+                               g_string_append_c(current_option,expression[i]);                                
                }
-               
-               
        }
        
        if( p>0 ) { 
This page took 0.026064 seconds and 4 git commands to generate.