13 std::wstring expression;
14 std::unordered_map<std::wstring, double> variables;
17 std::wstring lastError;
18 enum class TokenType { NONE, NUMBER, VARIABLE, OPERATOR, LPAREN, RPAREN, END } tokenType;
23 bool evaluate(
const std::unordered_map<std::wstring, double>& vars,
double& result);
28 void skipWhitespace();
30 std::wstring toLowerCase(
const std::wstring& input);
33 bool expect(TokenType expectedType,
const std::wstring& expectedToken = L
"");
34 bool parseExpression(
double& result);
35 bool parseTerm(
double& result);
36 bool parseFactor(
double& result);
37 bool parsePrimary(
double& result);