Example #1
0
bool ExprTree::
Evaluate( EvalState &state, Value &val, ExprTree *&sig ) const
{
	double diff = 0;
#ifndef WIN32
	struct timeval begin, end;
	if (state.debug) {
		gettimeofday(&begin, NULL);
	}
#endif
	bool eval = _Evaluate( state, val, sig );
#ifndef WIN32
	if (state.debug) {
		gettimeofday(&end, NULL);
		diff = (end.tv_sec + (end.tv_usec * 0.000001)) -
			(begin.tv_sec + (begin.tv_usec * 0.000001));
	}
#endif

	if(state.debug && GetKind() != ExprTree::LITERAL_NODE &&
			GetKind() != ExprTree::OP_NODE)
	{
		debug_format_value(val, diff);
	}

	return eval;
}
bool ExprTree::
Evaluate( EvalState &state, Value &val, ExprTree *&sig ) const
{
	bool eval = _Evaluate( state, val, sig );

	if(state.debug && GetKind() != ExprTree::LITERAL_NODE &&
			GetKind() != ExprTree::OP_NODE)
	{
		debug_format_value(val);
	}

	return eval;
}