static void Main(string[] args) { // sort out more complex examples string s = "2+2"; ExpressionTree e = ExpressionTree.Build(s); ExprVarValue[] vars = { new ExprVarValue("x", 2), new ExprVarValue("y", 3) }; Console.WriteLine(s); foreach (ExprVarValue var in vars) { Console.WriteLine(var); } Console.Write(e.ToString() + " = "); Console.WriteLine(e.getValue(vars)); Console.ReadKey(); }
public override string ToString() { return(Name.ToString() + "= " + Value.ToString()); }