public void Run() { Console.WriteLine("Hello World!Matrix allowed. type: help() to know how to use"); while (InputData != "exit") { GetDataToInput(); // PushToShow("进入run程序"); funstring.SetString(InputData); int Extype = funstring.AnalyseEquation(); if (Extype == 1 || Extype == 4) //没有等号 判断为命令或求值之类 // PushToShow("不是存值"); { AnalyseInputG(Extype); continue; } //保存起来 string funs = funstring.GetFuncName(); if (!CheckNameAcceptable(funs)) { continue; } CalData caldata = null; switch (Extype) { case 2: DealAssignment da = new DealAssignment(funstring.GetFuncExpress()); if (tdc.CheckName(funs)) { DataType getdt = new DataType(); try { getdt = da.GetDataType(); } catch (ExpError e) { PushToShow(e.Message); continue; } if (getdt == DataType.EXP) { try { ((UExpData)(da.GetCalData())).GetValueFinal(); //防止循环调用SimpleCal--> ReplaceParamers--> GetValueEx-->SimpleCal } catch (AssignedError e) { PushToShow(e.Message); continue; } } } try { caldata = da.GetCalData(); } catch (AssignedError e) { PushToShow(e.Message); continue; } break; case 3: caldata = new FuncData(funstring.GetFuncExpress(), funstring.GetParamers()); break; default: break; } if (CheckDuplicationName(funs)) { tdc.Remove(tdc.FindPosition(funs)); } if (funstring.CheckFunName(funs)) { PushToShow("Variable Name not acceptable!"); continue; } if (tdc.CreateData(funstring.GetFuncName(), caldata)) { PushToShow("数据已保存"); } else { PushToShow("Not accept input!"); } } }