/////////////////////////////////////////////////////////////////////////// Comparative --> Arithmetic {( "<=" | "<" | ">=" | ">" ) Arithmetic}
| 459 | //////////////////////////////////////////////////////////////////////////////// |
| 460 | // Comparative --> Arithmetic {( "<=" | "<" | ">=" | ">" ) Arithmetic} |
| 461 | bool Eval::parseComparative(std::vector<std::pair<std::string, Lexer::Type>>& infix, |
| 462 | unsigned int& i) const { |
| 463 | if (i < infix.size() && parseArithmetic(infix, i)) { |
| 464 | while (i < infix.size() && infix[i].second == Lexer::Type::op && |
| 465 | (infix[i].first == "<=" || infix[i].first == "<" || infix[i].first == ">=" || |
| 466 | infix[i].first == ">")) { |
| 467 | ++i; |
| 468 | if (!parseArithmetic(infix, i)) return false; |
| 469 | } |
| 470 | |
| 471 | return true; |
| 472 | } |
| 473 | |
| 474 | return false; |
| 475 | } |
| 476 | |
| 477 | //////////////////////////////////////////////////////////////////////////////// |
| 478 | // Arithmetic --> Geometric {( "+" | "-" ) Geometric} |
nothing calls this directly
no outgoing calls
no test coverage detected