MCPcopy Create free account
hub / github.com/GothenburgBitFactory/taskwarrior / evaluateInfixExpression

Method evaluateInfixExpression

src/Eval.cpp:123–142  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

121
122////////////////////////////////////////////////////////////////////////////////
123void Eval::evaluateInfixExpression(const std::string& e, Variant& v) const {
124 // Reduce e to a vector of tokens.
125 Lexer l(e);
126 std::vector<std::pair<std::string, Lexer::Type>> tokens;
127 std::string token;
128 Lexer::Type type;
129 while (l.token(token, type)) tokens.emplace_back(token, type);
130
131 // Parse for syntax checking and operator replacement.
132 if (_debug) Context::getContext().debug("FILTER Infix " + dump(tokens));
133 infixParse(tokens);
134 if (_debug) Context::getContext().debug("FILTER Infix parsed " + dump(tokens));
135
136 // Convert infix --> postfix.
137 infixToPostfix(tokens);
138 if (_debug) Context::getContext().debug("FILTER Postfix " + dump(tokens));
139
140 // Call the postfix evaluator.
141 evaluatePostfixStack(tokens, v);
142}
143
144////////////////////////////////////////////////////////////////////////////////
145void Eval::evaluatePostfixExpression(const std::string& e, Variant& v) const {

Callers 10

TEST_NAMEFunction · 0.80
mainFunction · 0.80
executeMethod · 0.80
modifyMethod · 0.80
modifyMethod · 0.80
modifyMethod · 0.80
modifyMethod · 0.80
modifyMethod · 0.80
modifyMethod · 0.80
modifyMethod · 0.80

Calls 2

tokenMethod · 0.80
debugMethod · 0.45

Tested by 1

TEST_NAMEFunction · 0.64