ExpressionParserImpl.h
Go to the documentation of this file.
1
2//
3// Copyright (C) 2017- Statoil ASA
4//
5// ResInsight is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
11// WARRANTY; without even the implied warranty of MERCHANTABILITY or
12// FITNESS FOR A PARTICULAR PURPOSE.
13//
14// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
15// for more details.
16//
18
19#pragma once
20
21#include "exprtk/exprtk.hpp"
22
23#include <QString>
24
25//==================================================================================================
27//==================================================================================================
29{
33
34public:
36
37 static std::vector<QString> detectReferencedVariables(const QString& expression);
38
39 void assignVector(const QString& variableName, std::vector<double>& vector);
40 bool evaluate(const QString& expressionText, QString* errorText = nullptr);
41
42 static QString expandIfStatements(const QString& expressionText);
43
44private:
45 QString parserErrorText(parser_t& parser);
46
47private:
48 symbol_table_t m_symbol_table;
49};
Definition: ExpressionParserImpl.h:29
void assignVector(const QString &variableName, std::vector< double > &vector)
bool evaluate(const QString &expressionText, QString *errorText=nullptr)
static std::vector< QString > detectReferencedVariables(const QString &expression)
static QString expandIfStatements(const QString &expressionText)
Definition: exprtk.hpp:18497
Definition: exprtk.hpp:19043