public void AddNum(string n) { var tmp = new Num(Convert.ToDouble(n)); this.AddNum(tmp); }
//得到Op对象 private INode GetOp(string op, INode a, INode b) { if (b == null) b = new Num(0); switch (op) { case Arithmetic.PLUS: return new Plus_Op(a, b); case Arithmetic.SUB: return new Sub_Op(a, b); case Arithmetic.MULTI: return new Multi_Op(a, b); case Arithmetic.DIV: return new Div_Op(a, b); default: return null; } }