jsquery_extract.c
bool
execRecursiveTristate(ExtractedNode *node, GinTernaryValue *check)
{
	GinTernaryValue	res, v;
	int i;

	switch(node->type)
	{
		case eAnd:
			res = GIN_TRUE;
			for (i = 0; i < node->args.count; i++)
			{
				v = execRecursiveTristate(node->args.items[i], check);
				if (v == GIN_FALSE)
					return GIN_FALSE;
				else if (v == GIN_MAYBE)
					res = GIN_MAYBE;
			}
			return res;
		case eOr:
			res = GIN_FALSE;
			for (i = 0; i < node->args.count; i++)
			{
				v = execRecursiveTristate(node->args.items[i], check);
				if (v == GIN_TRUE)
					return GIN_TRUE;
				else if (v == GIN_MAYBE)
					res = GIN_MAYBE;
			}
			return res;
		default:
			return check[node->entryNum];
	}
}
/*
 * Evaluate previously extracted tree using tri-state logic.
 */
Evaluate previously extracted tree using tri-state logic.
Evaluate previously extracted tree using tri - state logic .
bool
execRecursiveTristate(ExtractedNode *node, GinTernaryValue *check)
{
	GinTernaryValue	res, v;
	int i;
	switch(node->type)
	{
		case eAnd:
			res = GIN_TRUE;
			for (i = 0; i < node->args.count; i++)
			{
				v = execRecursiveTristate(node->args.items[i], check);
				if (v == GIN_FALSE)
					return GIN_FALSE;
				else if (v == GIN_MAYBE)
					res = GIN_MAYBE;
			}
			return res;
		case eOr:
			res = GIN_FALSE;
			for (i = 0; i < node->args.count; i++)
			{
				v = execRecursiveTristate(node->args.items[i], check);
				if (v == GIN_TRUE)
					return GIN_TRUE;
				else if (v == GIN_MAYBE)
					res = GIN_MAYBE;
			}
			return res;
		default:
			return check[node->entryNum];
	}
}
bool execRecursiveTristate ( ExtractedNode * node , GinTernaryValue * check ) { GinTernaryValue res , v ; int i ; switch ( node -> type ) { case eAnd : res = GIN_TRUE ; for ( i = 0 ; i < node -> args . count ; i ++ ) { v = execRecursiveTristate ( node -> args . items [ i ] , check ) ; if ( v == GIN_FALSE ) return GIN_FALSE ; else if ( v == GIN_MAYBE ) res = GIN_MAYBE ; } return res ; case eOr : res = GIN_FALSE ; for ( i = 0 ; i < node -> args . count ; i ++ ) { v = execRecursiveTristate ( node -> args . items [ i ] , check ) ; if ( v == GIN_TRUE ) return GIN_TRUE ; else if ( v == GIN_MAYBE ) res = GIN_MAYBE ; } return res ; default : return check [ node -> entryNum ] ; } }
Evaluate previously extracted tree using tri-state logic.
Evaluate previously extracted tree using tri - state logic .