19#ifndef STRINGPARSER_HPP
20#define STRINGPARSER_HPP
28#include "../ParserLib/muParser.h"
29#include "../settings.hpp"
30#include "../datamanagement/memorymanager.hpp"
60 void storeStringToStringObject(
const std::vector<std::string>& vFinal, std::string& sObject,
size_t& nCurrentComponent,
size_t nStrings);
63 bool isToken(
const char* sToken,
const std::string& sLine,
size_t pos);
65 virtual StringResult eval(std::string& sLine, std::string sCache,
bool bParseNumericals =
true)
override;
This class represents the central memory managing instance. It will handle all tables and clusters,...
This class provides the complete function evaluation logic to the StringParser class.
This class handles all logical operations on string expressions.
This class is the central string expression parser. It is designed as being a singleton with a persis...
StringResult createAndEvaluateStack(StringView sExpr)
Create a stack from the expression and evaluate it.
bool isToken(const char *sToken, const std::string &sLine, size_t pos)
Determines, whether the passed token can be found at the passed position.
std::string getDataForString(std::string sLine, size_t n_pos)
This member function returns the contents of the data objects and expands them as a list.
std::string maskControlCharacters(std::string sString)
This member function masks the line break and the tabulator control characters for storing the proces...
bool isSimpleString(const std::string &sLine)
This member function determines, whether the passed string is simple, i.e. it is a string literal wit...
virtual bool isStringExpression(const std::string &sExpression) override
Returns true, if the passed expression is an expression containing strings, string variables or strin...
std::vector< bool > applyElementaryStringOperations(std::vector< std::string > &vFinal, bool &bReturningLogicals)
This member function applies some elementary string operations like concatenation to the string expre...
void storeStringToStringObject(const std::vector< std::string > &vFinal, std::string &sObject, size_t &nCurrentComponent, size_t nStrings)
This member function is a helper for StringParser::storeStringResults(). It will store the strings in...
std::string numToString(const std::string &sLine)
This member function implements the so-called value-to-string parser (called via #VAR in code).
std::map< std::string, int > m_mStringParams
std::string parseStringsInIndices(std::string sIndexExpression)
Parses the string expressions in index expressions so that they may used as numerical index expressio...
std::string createTerminalOutput(StringResult &strRes, int parserFlags)
This private member function creates the output specialized for the terminal.
void replaceDataOccurence(std::string &sLine, const std::string &sOccurence)
Replaces all occurences of the passed data access occurence in the passed string.
std::vector< StringStackItem > createStack(StringView sExpr) const
This member function creates a stack from the passed expression, which may then be evaluated more eas...
virtual StringResult eval(std::string &sLine, std::string sCache, bool bParseNumericals=true) override
This public member function provides the string parser core functionality and is the function,...
StringVector evaluateStack(const std::vector< StringStackItem > &rpnStack, size_t from, size_t to)
Evaluate the created RPN stack between the selected start and end points.
int storeStringResults(StringResult &strRes, std::string sObject)
This member function stores the processed and calculated string results in their desired targets.
void storeStringToDataObjects(StringResult &strRes, std::string &sObject, size_t &nCurrentComponent, size_t nStrings)
This member function is a helper for StringParser::storeStringResults(). It will store the strings in...
StringParserRetVal evalAndFormat(std::string &sLine, std::string &sCache, bool bSilent=false, bool bCheckAssertions=false)
This public member function evaluates the passed string expression and formats the results for the co...
StringParser(mu::Parser &parser, MemoryManager &data, Settings &option)
String parser constructor.
std::string createStringOutput(StringResult &strRes, std::string &sLine, int parserFlags, bool bSilent)
This member function converts the processed string parser results into an output string,...
int decodeStringParams(std::string &sLine)
This member function finds and decodes all passed string expression parameters and removes them from ...
This class manages the setting values of the internal (kernel) settings of this application.
This class is an extension to the std::vector<std::string> to provide the vector-like functionalities...
This class is the immutable (const) version of a string view. It can be constructed from a MutableStr...
Mathematical expressions parser.
This structure contains all possible return values of the central string parser in single combined st...