| 19 | } |
| 20 | |
| 21 | int MathExp::getPrecedence(const char c) |
| 22 | { |
| 23 | if(c == *"(") |
| 24 | return -5; |
| 25 | |
| 26 | if(c == *"+" || c == *"-") |
| 27 | return 0; |
| 28 | |
| 29 | if(c == *"*" || c == *"/") |
| 30 | return 1; |
| 31 | |
| 32 | std::cout << "Error - getPrecedence(): unknown character '" << c << "'\n"; |
| 33 | return -1; |
| 34 | } |
| 35 | |
| 36 | float MathExp::eval() |
| 37 | { |
nothing calls this directly
no outgoing calls
no test coverage detected