Since I didn't want to *modify* Expression class (I avoid doing that in third party components - unless my change is likely to get propagated in the original source), instead I derived from it. Here is what I did:
class MyExression : Expression
public object Evaluate(string expression)
string oldExpresion = this.expression;
this.expression = expression; this.Evaluate ();
this.expression = oldExpression;
Unfortunately this did not work, as Evaluate() method has following code:
throw new EvaluationException(Error);
if (ParsedExpression == null)
ParsedExpression = Compile(expression, (Options & EvaluateOptions.NoCache) == EvaluateOptions.NoCache);
ParseExpression setter is private, so I cannot clear it.
So, as I don't want to modify Expression class, this now leaves me with the option of factory as you suggested - my only concern is that I need to evaluate hundreds of expressions on same parameter value set, so I will needs as many instances of Expression
Anyways, thanks for your suggestion.