private NhPartialEvaluatingExpressionVisitor(
     PartialEvaluationInfo partialEvaluationInfo,
     PreTransformationParameters preTransformationParameters)
 {
     _partialEvaluationInfo       = partialEvaluationInfo;
     _preTransformationParameters = preTransformationParameters;
 }
        /// <summary>
        /// Takes an expression tree and finds and evaluates all its evaluatable subtrees.
        /// </summary>
        public static Expression EvaluateIndependentSubtrees(
            Expression expressionTree,
            PreTransformationParameters preTransformationParameters)
        {
            var partialEvaluationInfo = EvaluatableTreeFindingExpressionVisitor.Analyze(
                expressionTree,
                preTransformationParameters.EvaluatableExpressionFilter);
            var visitor = new NhPartialEvaluatingExpressionVisitor(partialEvaluationInfo, preTransformationParameters);

            return(visitor.Visit(expressionTree));
        }