Changeset 2550 in Sophya for trunk/SophyaLib/SysTools
- Timestamp:
- Jun 8, 2004, 1:46:25 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SysTools/cexpre.cc
r2520 r2550 65 65 } 66 66 67 //--------------------------------------------------------- 68 //----------- Expression changement de signe ------------- 69 class CE_ChsExp : public CExprBase { 70 public: 71 explicit CE_ChsExp(CExprBase * e) { _e = e; } 72 virtual ~CE_ChsExp() { if (_e) delete _e; } 73 virtual double Evaluate() const { return -_e->Evaluate(); } 74 virtual bool CheckE(string& errmsg) const { if (_e) return true; else return false; } 75 virtual void Print(ostream& os) const { os << "-( "; _e->Print(os); os << " )"; } 76 protected: 77 CExprBase * _e; 78 }; 67 79 68 80 //--------------------------------------------------------- … … 334 346 if (!cx) { checkok = false; p = stop+1; } 335 347 else { 336 if (rx) { 348 if (osn == 1) { 349 if (sex[p-osn] == '-') cx = new CE_ChsExp(cx); 350 } 351 if (osn > 1) { 352 checkok = false; p = stop+1; fgcont = false; 353 delete cx; 354 errmsg = "CExpressionEvaluator::ParseString()/ Syntax Error - multiple chs (+/-) (AA)"; 355 } 356 else if (rx) { 337 357 checkok = false; p = stop+1; fgcont = false; 338 358 delete cx;
Note:
See TracChangeset
for help on using the changeset viewer.