public TagAttribute(string name, Expression exp) { this.Name = name; this.Expression = exp; }
object EvalExpression(Expression exp) { if (exp is Function) return EvalFunction(exp as Function); if (exp is IntegerExpression) return (exp as IntegerExpression).Value; else if (exp is DoubleExpression) return (exp as DoubleExpression).Value; else if (exp is StringExpression) return (exp as StringExpression).Value; else if (exp is Field) return EvalField(exp as Field); else if (exp is Variable) return GetVariableValue((exp as Variable).Name); else return new Exception("未知的表达式类型"); }
public void Add(Expression exp) { this.Expressions.Add(exp); }
object[] EvalArguments(Expression[] exps) { object[] args = new object[exps.Length]; for (int i = 0; i < exps.Length; i++) args[i] = EvalExpression(exps[i]); return args; }