1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
14 #include <vpu/utils/containers.hpp>
17 // Simple integer arithmetics to be used for the work sizes calculation.
18 // Supported operations : +,-,*,/,%,(,)
20 // Variables defined as single chars and should not include one of the ops, whitespaces or 0-9
25 class SimpleMathExpression final {
27 void setVariables(const std::map<char, int>& vars) { _vars = vars; }
29 void parse(const std::string& expression);
44 explicit Token(TokenType t = Value, int v = 0, char o = 0) : type(t), value(v), op(o) {}
48 std::map<char, int> _vars;
49 SmallVector<Token> _parsedTokens;