Ejemplo n.º 1
0
            internal static HashSet <Expression> Nominate(Expression expression)
            {
                var nominator = new Nominator();

                nominator.Visit(expression);
                return(nominator._candidates);
            }
Ejemplo n.º 2
0
 /// <summary>
 /// Performs evaluation and replacement of independent sub-trees
 /// </summary>
 /// <param name="expression">The root of the expression tree.</param>
 /// <returns>A new tree with sub-trees evaluated and replaced.</returns>
 public static Expression Rewrite(Expression expression) =>
 Evaluator.Evaluate(Nominator.Nominate(expression), expression);