- not much, some debugging on the general structure
git-svn-id: http://ltt.polymtl.ca/svn@884
04897980-b3bd-0310-b5e0-
8ef037075253
tree = g_new(lttv_filter_tree,1);
tree->node = g_new(lttv_expression,1);
tree->node->type = LTTV_UNDEFINED_EXPRESSION;
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;
*/
case '&': /* and */
t1 = (lttv_filter_tree*)g_ptr_array_index(tree_stack,tree_stack->len-1);
*/
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;
t2 = lttv_filter_tree_new();
t2->node->type = LTTV_EXPRESSION_OP;
t2->node->e.op = LTTV_LOGICAL_AND;
break;
case '|': /* or */
t1 = (lttv_filter_tree*)g_ptr_array_index(tree_stack,tree_stack->len-1);
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;
t2 = lttv_filter_tree_new();
t2->node->type = LTTV_EXPRESSION_OP;
t2->node->e.op = LTTV_LOGICAL_OR;
break;
case '^': /* xor */
t1 = (lttv_filter_tree*)g_ptr_array_index(tree_stack,tree_stack->len-1);
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;
t2 = lttv_filter_tree_new();
t2->node->type = LTTV_EXPRESSION_OP;
t2->node->e.op = LTTV_LOGICAL_XOR;
// 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);
// 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;
t2 = lttv_filter_tree_new();
t2->node->type = LTTV_EXPRESSION_OP;
t2->node->e.op = LTTV_LOGICAL_NOT;
g_assert(tree_stack->len>0);
if(subtree != NULL) {
t1 = g_ptr_array_index(tree_stack,tree_stack->len-1);
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;
}
g_assert(t1!=NULL && t1->r_child.t != NULL);
t1 = t1->r_child.t;
}
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);
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);
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);
/* 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);
/* 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;
if(subtree != NULL) { /* add the subtree */
t1->right = LTTV_TREE_NODE;
t1->l_child.t = subtree;
} lttv_expression_type;
typedef enum _lttv_tree_element {
} lttv_expression_type;
typedef enum _lttv_tree_element {
LTTV_TREE_NODE,
LTTV_TREE_LEAF
} lttv_tree_element;
LTTV_TREE_NODE,
LTTV_TREE_LEAF
} lttv_tree_element;