Exemplo n.º 1
0
 public void AddNum(string n)
 {
     var tmp = new Num(Convert.ToDouble(n));
     this.AddNum(tmp);
 }
Exemplo n.º 2
0
 //得到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;
     }
 }
Exemplo n.º 3
0
        public void AddNum(string n)
        {
            var tmp = new Num(Convert.ToDouble(n));

            this.AddNum(tmp);
        }