Changeset 1353 for trunk/MagicSoft/Mars/mdata
- Timestamp:
- 06/10/02 09:01:08 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/mdata
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mdata/MDataChain.cc
r1348 r1353 163 163 int l = txt.Length(); 164 164 for (int i = 0; i<l; i++) 165 if (!isalnum(txt[i]) && txt[i]!='.' )165 if (!isalnum(txt[i]) && txt[i]!='.' && txt[i]!='-') 166 166 return i; 167 167 … … 208 208 if (txt=="exp") return kEExp; 209 209 if (txt=="pow10") return kEPow10; 210 if (txt=="sgn") return kESgn; 211 if (txt[0]=='-') return kENegative; 210 212 211 213 return kENoop; … … 276 278 { 277 279 // 278 // Check for the type of the conditional280 // Check for the type of the symbol 279 281 // 280 282 char is = txt[0]; … … 283 285 // 284 286 // If no filter is available or the available filter 285 // is of a different conditionalwe have to create a new286 // filter list with the new conditional287 // is of a different symbols we have to create a new 288 // data list with the new symbol 287 289 // 288 290 if (/*!member0->InheritsFrom(MDataMember::Class()) ||*/ type!=is) … … 301 303 } 302 304 303 *fLog << err << dbginf << "Syntax Error: First argument of condition missing." << endl; 304 if (member0) 305 delete member0; 306 return NULL; 305 if (txt[0]!='-' && txt[0]!='+') 306 { 307 *fLog << err << dbginf << "Syntax Error: First argument of symbol '"; 308 *fLog << txt[0] << "' missing." << endl; 309 if (member0) 310 delete member0; 311 return NULL; 312 } 313 314 // FALLTHROU 307 315 308 316 case '0': … … 316 324 case '8': 317 325 case '9': 326 if (txt[0]!='-' || isdigit(txt[1]) || txt[1]=='.') 318 327 { 319 328 char *end; … … 330 339 331 340 newmember = new MDataValue(num); 332 } 333 break; 341 break; 342 } 343 344 // FALLTHROUH 334 345 335 346 default: … … 365 376 366 377 Int_t first = GetBracket(txt); 367 TString sub = txt(1, first-1);378 TString sub = op==kENegative ? text.Remove(0,1) + txt : txt(1, first-1); 368 379 txt.Remove(0, first+1); 369 380 … … 407 418 switch (fOperatorType) 408 419 { 409 case kEAbs: return fabs(val); 410 case kELog: return log(val); 411 case kELog10: return log10(val); 412 case kESin: return sin(val); 413 case kECos: return cos(val); 414 case kETan: return tan(val); 415 case kESinH: return sinh(val); 416 case kECosH: return cosh(val); 417 case kETanH: return tanh(val); 418 case kEASin: return asin(val); 419 case kEACos: return acos(val); 420 case kEATan: return atan(val); 421 case kESqrt: return sqrt(val); 422 case kEExp: return exp(val); 423 case kEPow10: return pow(10, val); 424 case kENoop: return val; 420 case kEAbs: return fabs(val); 421 case kELog: return log(val); 422 case kELog10: return log10(val); 423 case kESin: return sin(val); 424 case kECos: return cos(val); 425 case kETan: return tan(val); 426 case kESinH: return sinh(val); 427 case kECosH: return cosh(val); 428 case kETanH: return tanh(val); 429 case kEASin: return asin(val); 430 case kEACos: return acos(val); 431 case kEATan: return atan(val); 432 case kESqrt: return sqrt(val); 433 case kEExp: return exp(val); 434 case kEPow10: return pow(10, val); 435 case kESgn: return val<0 ? -1 : 1; 436 case kENegative: return -val; 437 case kENoop: return val; 425 438 } 426 439 … … 436 449 switch (fOperatorType) 437 450 { 438 case kEAbs: *fLog << "abs" << flush; break; 439 case kELog: *fLog << "log" << flush; break; 440 case kELog10: *fLog << "log10" << flush; break; 441 case kESin: *fLog << "sin" << flush; break; 442 case kECos: *fLog << "cos" << flush; break; 443 case kETan: *fLog << "tan" << flush; break; 444 case kESinH: *fLog << "sinh" << flush; break; 445 case kECosH: *fLog << "cosh" << flush; break; 446 case kETanH: *fLog << "tanh" << flush; break; 447 case kEASin: *fLog << "asin" << flush; break; 448 case kEACos: *fLog << "acos" << flush; break; 449 case kEATan: *fLog << "atan" << flush; break; 450 case kESqrt: *fLog << "sqrt" << flush; break; 451 case kEExp: *fLog << "exp" << flush; break; 452 case kEPow10: *fLog << "pow10" << flush; break; 451 case kEAbs: *fLog << "abs" << flush; break; 452 case kELog: *fLog << "log" << flush; break; 453 case kELog10: *fLog << "log10" << flush; break; 454 case kESin: *fLog << "sin" << flush; break; 455 case kECos: *fLog << "cos" << flush; break; 456 case kETan: *fLog << "tan" << flush; break; 457 case kESinH: *fLog << "sinh" << flush; break; 458 case kECosH: *fLog << "cosh" << flush; break; 459 case kETanH: *fLog << "tanh" << flush; break; 460 case kEASin: *fLog << "asin" << flush; break; 461 case kEACos: *fLog << "acos" << flush; break; 462 case kEATan: *fLog << "atan" << flush; break; 463 case kESqrt: *fLog << "sqrt" << flush; break; 464 case kEExp: *fLog << "exp" << flush; break; 465 case kEPow10: *fLog << "pow10" << flush; break; 466 case kESgn: *fLog << "sgn" << flush; break; 467 case kENegative: *fLog << "-" << flush; break; 453 468 case kENoop: 454 469 break; -
trunk/MagicSoft/Mars/mdata/MDataChain.h
r1348 r1353 35 35 kESqrt, 36 36 kEPow10, 37 kEExp 37 kEExp, 38 kESgn, 39 kENegative 38 40 } OperatorType_t; 39 41
Note:
See TracChangeset
for help on using the changeset viewer.