filter core
authorsiboud <siboud@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 10 Mar 2005 02:54:46 +0000 (02:54 +0000)
committersiboud <siboud@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 10 Mar 2005 02:54:46 +0000 (02:54 +0000)
 - not much, some debugging on the general structure

git-svn-id: http://ltt.polymtl.ca/svn@884 04897980-b3bd-0310-b5e0-8ef037075253

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

index df3873f61b6e6fc0c29164259ec72a403c4b3ce7..2cfc7d1018fd0adc41c4887332f5e9db887d418a 100644 (file)
@@ -93,8 +93,8 @@ lttv_filter_tree* lttv_filter_tree_new() {
   tree = g_new(lttv_filter_tree,1);
   tree->node = g_new(lttv_expression,1);
   tree->node->type = LTTV_UNDEFINED_EXPRESSION;
-  tree->left = LTTV_TREE_UNDEFINED;
-  tree->right = LTTV_TREE_UNDEFINED;
+  tree->left = LTTV_TREE_IDLE;
+  tree->right = LTTV_TREE_IDLE;
 
   return tree;
 }
@@ -272,7 +272,7 @@ lttv_filter_new(char *expression, LttvTraceState *tcs) {
        */
       case '&':   /* and */
         t1 = (lttv_filter_tree*)g_ptr_array_index(tree_stack,tree_stack->len-1);
-        while(t1->right != LTTV_TREE_UNDEFINED) t1 = t1->r_child.t;
+        while(t1->right != LTTV_TREE_IDLE) t1 = t1->r_child.t;
         t2 = lttv_filter_tree_new();
         t2->node->type = LTTV_EXPRESSION_OP;
         t2->node->e.op = LTTV_LOGICAL_AND;
@@ -294,7 +294,7 @@ lttv_filter_new(char *expression, LttvTraceState *tcs) {
         break;
       case '|':   /* or */
         t1 = (lttv_filter_tree*)g_ptr_array_index(tree_stack,tree_stack->len-1);
-        while(t1->right != LTTV_TREE_UNDEFINED) t1 = t1->r_child.t;
+        while(t1->right != LTTV_TREE_IDLE) t1 = t1->r_child.t;
         t2 = lttv_filter_tree_new();
         t2->node->type = LTTV_EXPRESSION_OP;
         t2->node->e.op = LTTV_LOGICAL_OR;
@@ -315,7 +315,7 @@ lttv_filter_new(char *expression, LttvTraceState *tcs) {
         break;
       case '^':   /* xor */
         t1 = (lttv_filter_tree*)g_ptr_array_index(tree_stack,tree_stack->len-1);
-        while(t1->right != LTTV_TREE_UNDEFINED) t1 = t1->r_child.t;
+        while(t1->right != LTTV_TREE_IDLE) t1 = t1->r_child.t;
         t2 = lttv_filter_tree_new();
         t2->node->type = LTTV_EXPRESSION_OP;
         t2->node->e.op = LTTV_LOGICAL_XOR;
@@ -342,7 +342,7 @@ lttv_filter_new(char *expression, LttvTraceState *tcs) {
         //  g_print("%s\n",a_field_component);
         //  a_field_component = g_string_new("");
           t1 = (lttv_filter_tree*)g_ptr_array_index(tree_stack,tree_stack->len-1);
-          while(t1->right != LTTV_TREE_UNDEFINED) t1 = t1->r_child.t;
+          while(t1->right != LTTV_TREE_IDLE) t1 = t1->r_child.t;
           t2 = lttv_filter_tree_new();
           t2->node->type = LTTV_EXPRESSION_OP;
           t2->node->e.op = LTTV_LOGICAL_NOT;
@@ -370,7 +370,7 @@ lttv_filter_new(char *expression, LttvTraceState *tcs) {
         g_assert(tree_stack->len>0);
         if(subtree != NULL) { 
           t1 = g_ptr_array_index(tree_stack,tree_stack->len-1);
-          while(t1->right != LTTV_TREE_UNDEFINED && t1->right != LTTV_TREE_LEAF) {
+          while(t1->right != LTTV_TREE_IDLE && t1->right != LTTV_TREE_LEAF) {
               g_assert(t1!=NULL && t1->r_child.t != NULL);
               t1 = t1->r_child.t;
           }
@@ -382,7 +382,7 @@ lttv_filter_new(char *expression, LttvTraceState *tcs) {
           a_simple_expression.value = a_field_component->str;
           a_field_component = g_string_new("");
           t1 = g_ptr_array_index(tree_stack,tree_stack->len-1);
-          while(t1->right != LTTV_TREE_UNDEFINED) t1 = t1->r_child.t;
+          while(t1->right != LTTV_TREE_IDLE) t1 = t1->r_child.t;
           t1->right = LTTV_TREE_LEAF;
           t1->r_child.leaf = g_new(lttv_simple_expression,1);
           subtree = g_ptr_array_index(tree_stack,tree_stack->len-1);
@@ -432,7 +432,7 @@ lttv_filter_new(char *expression, LttvTraceState *tcs) {
   /*  processing last element of expression   */
   g_assert(tree_stack->len==1); /* only root tree should remain */
   t1 = g_ptr_array_index(tree_stack,tree_stack->len-1);
-  while(t1->right != LTTV_TREE_UNDEFINED) t1 = t1->r_child.t;
+  while(t1->right != LTTV_TREE_IDLE) t1 = t1->r_child.t;
   if(subtree != NULL) {  /* add the subtree */
     t1->right = LTTV_TREE_NODE;
     t1->l_child.t = subtree;
index 763c30f8fa129bc213392f386eea452ff7efd6bc..2e41ba541c7240b86e3e231e1f7e732e810c3f2b 100644 (file)
@@ -95,7 +95,7 @@ typedef enum _lttv_expression_type
 } lttv_expression_type;
 
 typedef enum _lttv_tree_element {
-  LTTV_TREE_UNDEFINED,
+  LTTV_TREE_IDLE,
   LTTV_TREE_NODE,
   LTTV_TREE_LEAF
 } lttv_tree_element;
This page took 0.026249 seconds and 4 git commands to generate.