22#include "../../kernel.hpp"
40 static string sOperators =
"+-*/&|?!^<>=";
42 for (
size_t i = 0; i < sString.length(); i++)
44 if (sString[i] ==
'"' && (!i || sString[i-1] !=
'\\'))
50 if (sString[i] ==
'(' || sString[i] ==
'[' || sString[i] ==
'{')
57 else if (sOperators.find(sString[i]) != string::npos)
172 delete iter.second.second;
226 if (iter->second == sTableName)
272 for (
size_t i = 0; i < sProcedureName.length(); i++)
274 if (sProcedureName[i] ==
':' || sProcedureName[i] ==
'\\' || sProcedureName[i] ==
'/' || sProcedureName[i] ==
' ')
275 sProcedureName[i] =
'_';
278 return sProcedureName;
321 int nParenthesis = 0;
322 unsigned int nElements = 1;
326 for (
unsigned int i = 0; i < sVarList.length(); i++)
328 if ((sVarList[i] ==
'(' || sVarList[i] ==
'{') && !
isInQuotes(sVarList, i))
331 if ((sVarList[i] ==
')' || sVarList[i] ==
'}') && !
isInQuotes(sVarList, i))
334 if (sVarList[i] ==
',' && !nParenthesis && !
isInQuotes(sVarList, i))
360 if (sCommand ==
"var" || sCommand ==
"tab" || sCommand ==
"str" || sCommand ==
"cst")
373 sCommand = sArgument.substr(0, sArgument.find(
'='));
407 if (sCommand ==
"var" || sCommand ==
"tab" || sCommand ==
"str")
431 return sSymbolName.length() && !isdigit(sSymbolName[0]) &&
toLowerCase(sSymbolName).find_first_not_of(
" abcdefghijklmnopqrstuvwxyz1234567890_(){}&") == std::string::npos;
456 sTempCluster.erase(sTempCluster.length()-2);
462 for (
unsigned int i = 0; i < nLocalVarMapSize; i++)
468 if (currentDef.find(
'=') != string::npos)
470 string sVarValue = currentDef.substr(currentDef.find(
'=')+1);
473 if (sVarValue.find(
'$') != string::npos && sVarValue.find(
'(') != string::npos)
495 currentDef.erase(currentDef.find(
'='));
501 _debugger.
showError(current_exception());
512 std::string currentVar = sTempCluster +
"{" +
toString(i+1) +
"}";
514 mLocalVars[currentDef] = std::make_pair(currentVar,
nullptr);
542 sTempCluster.erase(sTempCluster.length()-2);
548 for (
unsigned int i = 0; i < nLocalStrMapSize; i++)
551 std::string sVarValue;
555 if (currentDef.find(
'=') != string::npos)
557 sVarValue = currentDef.substr(currentDef.find(
'=')+1);
560 if (sVarValue.find(
'$') != string::npos && sVarValue.find(
'(') != string::npos)
565 nLocalStrMapSize = 0;
580 currentDef.erase(currentDef.find(
'='));
588 nLocalStrMapSize = 0;
590 _debugger.
showError(current_exception());
619 map<string,string> mVarMap;
622 if (!sArgumentList.length() && sArgumentValues.length())
629 else if (!sArgumentList.length())
641 std::string sArgListBack = sArgumentList;
644 for (
unsigned int i = 0; i < nArgumentMapSize; i++)
658 if (currentValue.length() && currentArg.find(
'=') != string::npos)
660 currentArg.erase(currentArg.find(
'='));
663 else if (!currentValue.length() && currentArg.find(
'=') != string::npos)
665 currentValue = currentArg.substr(currentArg.find(
'=')+1);
666 currentArg.erase(currentArg.find(
'='));
670 else if (!currentValue.length() && currentArg.find(
'=') == string::npos)
673 nArgumentMapSize = 0;
682 currentValue =
"(" + currentValue +
")";
707 size_t pos = sArgumentValue.
find(
'{');
709 return _dataRef->
isCluster(sArgumentValue) && (sArgumentValue.
subview(pos, 2) ==
"{}" || sArgumentValue.
subview(pos, 3) ==
"{:}");
725 size_t pos = sArgumentValue.
find(
'(');
728 || sArgumentValue.
subview(pos, 3) ==
"(:)"
729 || sArgumentValue.
subview(pos, 5) ==
"(:,:)");
752 if (currentValue.find(
'$') != string::npos
753 && currentValue.find(
'(') != string::npos
754 && currentArg.substr(currentArg.length()-2) !=
"()")
770 currentValue =
"false";
773 bool isRef = currentArg.front() ==
'&' || currentArg.back() ==
'&';
779 currentArg.erase(currentArg.find(
'&'), 1);
783 if (currentArg.length() > 2 && currentArg.substr(currentArg.length()-2) ==
"()")
785 currentArg.pop_back();
787#warning TODO (numere#1#02/27/22): This behavior will be deprecated with v1.1.5
792 +
": " +
_lang.
get(
"PROCEDURE_WARN_TABLE_REFERENCE"));
803 if (currentValue.find(
'(') != string::npos)
804 currentValue.erase(currentValue.find(
'('));
806 else if (!isRef && !isMacro)
808#warning TODO (numere#1#02/27/22): This behavior will be deprecated with v1.1.5
817 if (currentValue.find(
'$') != string::npos
818 && currentValue.find(
'(') != string::npos)
826 currentValue.insert(0, sNewArgName +
"() = ");
835 currentValue =
"false";
838 if (currentValue.substr(0, sNewArgName.length()+5) != sNewArgName+
"() = ")
840 currentValue = sNewArgName;
846 currentValue.erase(0, sNewArgName.length()+5);
851 _dataRef->
copyTable(currentValue.substr(0, currentValue.find(
'(')), sNewArgName);
858 std::string sCurrentValue = currentValue;
866 std::string sTable = sNewArgName +
"(:,1)";
884 _debugger.
showError(current_exception());
895 currentValue = sNewArgName;
900 #warning TODO (numere#1#02/27/22): This behavior will be deprecated with v1.1.5
905 else if (currentArg.length() > 2 && currentArg.substr(currentArg.length()-2) ==
"{}")
907 currentArg.pop_back();
914 else if (!isRef && !isMacro)
929 std::string sCurrentValue = currentValue;
936 std::string sCluster = sNewArgName +
"{}";
951 _debugger.
showError(current_exception());
959 currentValue = sNewArgName;
962 else if (
inliningMode && (currentValue.length() < 3 || currentValue.substr(currentValue.length()-2) !=
"{}"))
965 vInlineArgDef.push_back(sTempCluster +
" = " + currentValue +
";");
966 currentValue = sTempCluster;
969 if (currentValue.find(
'{') != string::npos)
970 currentValue.erase(currentValue.find(
'{'));
980 if (varMap.find(currentValue) == varMap.end()
981 && stringMap.find(currentValue) == stringMap.end()
983 && !(isTemplate && currentValue.substr(0, 7) ==
"string(")
1008 if (currentValue.find(
"()") != std::string::npos &&
_dataRef->
isTable(currentValue))
1013 else if (currentValue.find(
"{}") != std::string::npos &&
_dataRef->
isCluster(currentValue))
1019 currentValue = sNewArgName +
"{}";
1033 std::string sCluster = sNewArgName +
"{}";
1038 if (newCluster.
size() == 1)
1042 currentValue = sNewArgName;
1047 currentValue = sNewArgName +
"{}";
1065 currentValue = sNewArgName +
"{}";
1074 currentValue = sNewArgName;
1096 currentValue = sNewArgName;
1111 _debugger.
showError(current_exception());
1115 currentValue = sNewArgName;
1150 for (
unsigned int i = 0; i < nLocalVarMapSize; i++)
1155 std::string sSymbol = currentDef.substr(0, currentDef.find(
'='));
1165 if (currentDef.find(
'=') != string::npos)
1167 std::string sVarValue = currentDef.substr(currentDef.find(
'=')+1);
1169 if (sVarValue.find(
'$') != string::npos && sVarValue.find(
'(') != string::npos)
1184 sVarValue =
"false";
1189 _debugger.
showError(current_exception());
1210 currentDef.erase(currentDef.find(
'='));
1216 _debugger.
showError(current_exception());
1258 for (
unsigned int i = 0; i < nLocalStrMapSize; i++)
1261 std::string sVarValue;
1263 std::string sSymbol = currentDef.substr(0, currentDef.find(
'='));
1272 if (currentDef.find(
'=') != string::npos)
1274 sVarValue = currentDef.substr(currentDef.find(
'=')+1);
1276 if (sVarValue.find(
'$') != string::npos && sVarValue.find(
'(') != string::npos)
1291 sVarValue =
"false";
1296 _debugger.
showError(current_exception());
1312 currentDef.erase(currentDef.find(
'='));
1325 _debugger.
showError(current_exception());
1329 mLocalStrings[currentDef] = std::make_pair(currentVar, sVarValue);
1354 for (
unsigned int i = 0; i < nLocalTableSize; i++)
1357 std::string sCurrentValue;
1358 std::string sSymbol = currentDef.substr(0, currentDef.find(
'='));
1366 if (currentDef.find(
'=') != string::npos)
1367 sCurrentValue = currentDef.substr(currentDef.find(
'=')+1);
1369 if (currentDef.find(
'(') != string::npos)
1370 currentDef.erase(currentDef.find(
'('));
1380 if (sCurrentValue.length())
1384 if (sCurrentValue.find(
'$') != string::npos && sCurrentValue.find(
'(', sCurrentValue.find(
'$')+1))
1391 sCurrentValue.insert(0, currentVar +
"() = ");
1398 sCurrentValue =
"false";
1401 if (sCurrentValue.substr(0, currentVar.length()+5) == currentVar +
"() = ")
1402 currentVar.erase(0, currentVar.length()+5);
1412 _dataRef->
copyTable(sCurrentValue.substr(0, sCurrentValue.find(
'(')), currentVar);
1420 std::string sTable = currentVar +
"(:,1)";
1473 for (
unsigned int i = 0; i < nLocalClusterSize; i++)
1476 std::string sCurrentValue;
1477 std::string sSymbol = currentDef.substr(0, currentDef.find(
'='));
1485 if (currentDef.find(
'=') != string::npos)
1486 sCurrentValue = currentDef.substr(currentDef.find(
'=')+1);
1488 if (currentDef.find(
'{') != string::npos)
1489 currentDef.erase(currentDef.find(
'{'));
1499 if (sCurrentValue.length())
1503 if (sCurrentValue.find(
'$') != string::npos && sCurrentValue.find(
'(', sCurrentValue.find(
'$')+1))
1515 sCurrentValue =
"false";
1527 string sCluster = currentVar +
"{}";
1566 const std::string currentDef =
"TESTINFO";
1596 return sProcedureCommandLine;
1600 unsigned int nPos = 0;
1601 size_t nArgumentBaseLength = iter.first.length();
1603 if (iter.first.back() ==
'(' || iter.first.back() ==
'{')
1604 nArgumentBaseLength--;
1606 while ((nPos = sProcedureCommandLine.find(iter.first.substr(0, nArgumentBaseLength), nPos)) != string::npos)
1608 if ((sProcedureCommandLine[nPos-1] ==
'~' && sProcedureCommandLine[sProcedureCommandLine.find_last_not_of(
'~',nPos-1)] !=
'#')
1609 || (iter.first.back() !=
'(' && sProcedureCommandLine[nPos+nArgumentBaseLength] ==
'(')
1610 || (iter.first.back() !=
'{' && sProcedureCommandLine[nPos+nArgumentBaseLength] ==
'{'))
1612 nPos += iter.first.length();
1616 if (
checkDelimiter(sProcedureCommandLine.substr(nPos-1, nArgumentBaseLength+2),
true)
1617 && (!
isInQuotes(sProcedureCommandLine, nPos,
true)
1618 ||
isToCmd(sProcedureCommandLine, nPos)))
1620 if ((iter.second.front() ==
'{' || iter.second.back() ==
')') && iter.first.back() ==
'{')
1621 sProcedureCommandLine.replace(nPos,
getMatchingParenthesis(sProcedureCommandLine.substr(nPos))+1, iter.second);
1623 sProcedureCommandLine.replace(nPos, nArgumentBaseLength, iter.second);
1625 nPos += iter.second.length();
1628 nPos += nArgumentBaseLength;
1632 return sProcedureCommandLine;
1649 return sProcedureCommandLine;
1654 size_t nDelimCheck = 0;
1656 while ((nPos = sProcedureCommandLine.find(iter.first, nPos)) != string::npos)
1658 if ((sProcedureCommandLine[nPos-1] ==
'~' && sProcedureCommandLine[sProcedureCommandLine.find_last_not_of(
'~', nPos-1)] !=
'#')
1659 || sProcedureCommandLine[nPos+iter.first.length()] ==
'(')
1661 nPos += iter.first.length();
1665 nDelimCheck = nPos-1;
1667 if ((sProcedureCommandLine[nDelimCheck] ==
'~' && sProcedureCommandLine[sProcedureCommandLine.find_last_not_of(
'~', nDelimCheck)] ==
'#'))
1668 nDelimCheck = sProcedureCommandLine.find_last_not_of(
'~', nDelimCheck);
1670 if (
checkDelimiter(sProcedureCommandLine.substr(nDelimCheck, iter.first.length() + 1 + nPos - nDelimCheck))
1671 && (!
isInQuotes(sProcedureCommandLine, nPos,
true)
1672 ||
isToCmd(sProcedureCommandLine, nPos)))
1674 sProcedureCommandLine.replace(nPos, iter.first.length(), iter.second.first);
1675 nPos += iter.second.first.length();
1678 nPos += iter.first.length();
1682 return sProcedureCommandLine;
1699 return sProcedureCommandLine;
1704 size_t nDelimCheck = 0;
1706 while ((nPos = sProcedureCommandLine.find(iter.first, nPos)) != string::npos)
1708 if ((sProcedureCommandLine[nPos-1] ==
'~' && sProcedureCommandLine[sProcedureCommandLine.find_last_not_of(
'~', nPos-1)] !=
'#')
1709 || sProcedureCommandLine[nPos+iter.first.length()] ==
'(')
1711 nPos += iter.first.length();
1715 nDelimCheck = nPos-1;
1717 if ((sProcedureCommandLine[nDelimCheck] ==
'~' && sProcedureCommandLine[sProcedureCommandLine.find_last_not_of(
'~', nDelimCheck)] ==
'#'))
1718 nDelimCheck = sProcedureCommandLine.find_last_not_of(
'~', nDelimCheck);
1720 if (
checkDelimiter(sProcedureCommandLine.substr(nDelimCheck, iter.first.length() + 1 + nPos - nDelimCheck),
true)
1721 && (!
isInQuotes(sProcedureCommandLine, nPos,
true) ||
isToCmd(sProcedureCommandLine, nPos)))
1726 sProcedureCommandLine.replace(nPos, iter.first.length(), iter.second.first);
1728 nPos += iter.second.first.length();
1731 nPos += iter.first.length();
1735 return sProcedureCommandLine;
1752 return sProcedureCommandLine;
1757 size_t nDelimCheck = 0;
1759 while ((nPos = sProcedureCommandLine.find(iter.first +
"(", nPos)) != string::npos)
1761 if ((sProcedureCommandLine[nPos-1] ==
'~' && sProcedureCommandLine[sProcedureCommandLine.find_last_not_of(
'~', nPos-1)] !=
'#')
1762 || sProcedureCommandLine[nPos-1] ==
'$')
1764 nPos += iter.first.length();
1768 nDelimCheck = nPos-1;
1770 if ((sProcedureCommandLine[nDelimCheck] ==
'~' && sProcedureCommandLine[sProcedureCommandLine.find_last_not_of(
'~', nDelimCheck)] ==
'#'))
1771 nDelimCheck = sProcedureCommandLine.find_last_not_of(
'~', nDelimCheck);
1773 if (
checkDelimiter(sProcedureCommandLine.substr(nDelimCheck, iter.first.length() + 1 + nPos - nDelimCheck),
true)
1774 && (!
isInQuotes(sProcedureCommandLine, nPos,
true) ||
isToCmd(sProcedureCommandLine, nPos)))
1776 sProcedureCommandLine.replace(nPos, iter.first.length(), iter.second);
1777 nPos += iter.second.length();
1780 nPos += iter.first.length();
1784 return sProcedureCommandLine;
1801 return sProcedureCommandLine;
1806 size_t nDelimCheck = 0;
1808 while ((nPos = sProcedureCommandLine.find(iter.first +
"{", nPos)) != string::npos)
1810 if ((sProcedureCommandLine[nPos-1] ==
'~' && sProcedureCommandLine[sProcedureCommandLine.find_last_not_of(
'~', nPos-1)] !=
'#'))
1812 nPos += iter.first.length();
1816 nDelimCheck = nPos-1;
1818 if ((sProcedureCommandLine[nDelimCheck] ==
'~' && sProcedureCommandLine[sProcedureCommandLine.find_last_not_of(
'~', nDelimCheck)] ==
'#'))
1819 nDelimCheck = sProcedureCommandLine.find_last_not_of(
'~', nDelimCheck);
1821 if (
checkDelimiter(sProcedureCommandLine.substr(nDelimCheck, iter.first.length() + 1 + nPos - nDelimCheck),
true)
1822 && (!
isInQuotes(sProcedureCommandLine, nPos,
true) ||
isToCmd(sProcedureCommandLine, nPos)))
1824 sProcedureCommandLine.replace(nPos, iter.first.length(), iter.second);
1825 nPos += iter.second.length();
1828 nPos += iter.first.length();
1832 return sProcedureCommandLine;
std::string toLowerCase(const std::string &)
Converts uppercase to lowercase letters.
bool call(std::string &sExpr, int nRecursion=0)
This function searches for known custom definitions in the passed expression and replaces them with t...
std::string get(const std::string &sMessage, const std::vector< std::string > &vTokens) const
This member function returns the language string for the passed language identifier and replaces all ...
This class represents the central memory managing instance. It will handle all tables and clusters,...
void copyTable(const std::string &source, const std::string &target)
Copy one table to another one (and create the missing table automatically, if needed).
bool isTable(const std::string &sTable) const
This member function returns, whether the passed table name corresponds to a known table.
bool deleteTable(const std::string &sCache)
This member function removes the selected table.
bool addTable(const std::string &sCache, const Settings &_option)
This member function creates a new table. It is checked, whether its name is valid and not already us...
bool containsTablesOrClusters(const std::string &sCmdLine)
This member function evaluates, whether the passed command line contains tables or clusters.
void writeToTable(int _nLine, int _nCol, const std::string &_sCache, const mu::value_type &_dData)
This class represents a whole cluster. The single items are stored as pointers to the abstract cluste...
size_t size() const
This member function returns the size of the internal memory buffer as items.
std::string getParserString(size_t i) const
This member function returns the data of the i-th cluster item in memory as a parser string.
void setDouble(size_t i, const mu::value_type &value)
This member function assigns a value as data for the i-th cluster item in memory. The type of the i-t...
void setString(size_t i, const std::string &strval)
This member function assigns a string as data for the i-th cluster item in memory....
void setDoubleArray(const std::vector< mu::value_type > &vVals)
This member function assigns values as data for the all cluster items in memory. The type of the clus...
void removeCluster(const std::string &sCluster)
This member function removes the cluster from memory, which corresponds to the passed cluster identif...
Cluster & getCluster(StringView sCluster)
This member function returns a reference to the cluster indicated by the passed cluster identifier.
Cluster & newCluster(const std::string &sCluster)
This member function creates a new cluster from the passed cluster identifier and returns a reference...
bool isCluster(StringView sCluster) const
This member function returns true, if the passed cluster identifier can be found in the internal map.
std::string createTemporaryCluster(const std::string &suffix="")
This member function creates a temporary cluster with a unique name and returns this name to the call...
This class is the central string expression parser. It is designed as being a singleton with a persis...
virtual bool isStringExpression(const std::string &sExpression) override
Returns true, if the passed expression is an expression containing strings, string variables or strin...
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...
void setStringValue(const std::string &sVar, const std::string &sValue)
This public member function creates or updates a string variable and fills it with the passed value.
const std::map< std::string, std::string > & getStringVars() const
void removeStringVar(const std::string &sVar)
This public member function removes the selected string variable from memory.
void throwException(SyntaxError error)
This member function shows the debugger with the corresponding error message obtained by the passed S...
void gatherInformations(ProcedureVarFactory *_varFactory, const std::string &_sErraticCommand, const std::string &_sErraticModule, unsigned int _nLineNumber)
This member function gathers all information from the current workspace and stores them internally to...
void popStackItem()
This member function removes the last item from the stack.
void showError(const std::string &sTitle)
This member function shows the debugger with the passed error message.
static NumeReKernel * getInstance()
This static member function returns a a pointer to the singleton instance of the kernel.
NumeRe::StringParser & getStringParser()
PlotData & getPlottingData()
NumeReDebugger & getDebugger()
MemoryManager & getMemoryManager()
FunctionDefinitionManager & getDefinitions()
static void issueWarning(std::string sWarningMessage)
This static function may be used to issue a warning to the user. The warning will be printed by the t...
This class implements the logic to evaluate complex procedures, which may be called recursively.
virtual FlowCtrl::ProcedureInterfaceRetVal procedureInterface(std::string &sLine, mu::Parser &_parser, FunctionDefinitionManager &_functions, MemoryManager &_data, Output &_out, PlotData &_pData, Script &_script, Settings &_option, int nth_command=0) override
This member function handles the calls for procedures and plugins, resolves them and executes the cal...
int getProcedureFlags() const
unsigned int GetCurrentLine() const
This member function will return the current line number depending on whether a flow control statemen...
std::string getCurrentProcedureName() const
std::string resolveLocalStrings(std::string sProcedureCommandLine, size_t nMapSize=std::string::npos)
This private member function will resolve the calls to string variables in the passed procedure comma...
std::map< std::string, std::string > createProcedureArguments(std::string sArgumentList, std::string sArgumentValues)
This member function will create the procedure arguments for the current procedure.
std::string resolveLocalTables(std::string sProcedureCommandLine, size_t nMapSize=std::string::npos)
This private member function will resolve the calls to local tables in the passed procedure command l...
std::string sInlineVarDef
std::map< std::string, VarType > mLocalArgs
std::map< std::string, std::string > mLocalClusters
void createLocalTables(std::string sTableList)
This member function will create the local tables for the current procedure.
std::string sInlineStringDef
void evaluateProcedureArguments(std::string ¤tArg, std::string ¤tValue, const std::string &sArgumentList)
This memberfunction will evaluate the passed procedure arguments and convert them to local variables ...
std::string resolveLocalVars(std::string sProcedureCommandLine, size_t nMapSize=std::string::npos)
This private member function will resolve the calls to numerical variables in the passed procedure co...
void createLocalStrings(std::string sStringList)
This member function will create the local string variables for the current procedure.
std::string replaceProcedureName(std::string sProcedureName) const
Replaces path characters and whitespaces to create variable names fitting for an non- relative proced...
void reset()
Resets the object.
void checkArgument(const std::string &sArgument, const std::string &sArgumentList, unsigned int nCurrentIndex)
This private member function checks, whether the keywords "var", "str" or "tab" are used in the curre...
std::map< std::string, std::string > mArguments
void createLocalInlineStrings(std::string sVarList)
This private member function creates the local string variables for inlined procedures.
FunctionDefinitionManager * _functionRef
std::map< std::string, std::pair< std::string, std::string > > mLocalStrings
std::string resolveLocalClusters(std::string sProcedureCommandLine, size_t nMapSize=std::string::npos)
This private member function will resolve the calls to local clusters in the passed procedure command...
ProcedureVarFactory()
Constructor.
std::string createMangledArgName(const std::string &sDefinedName) const
Creates a mangled name for an argument.
~ProcedureVarFactory()
Destructor.
bool checkSymbolName(const std::string &sSymbolName) const
Checks for invalid characters or similar.
unsigned int countVarListElements(const std::string &sVarList)
This private memebr function counts the number of elements in the passed string list.
std::string resolveArguments(std::string sProcedureCommandLine, size_t nMapSize=std::string::npos)
This private member function will resolve the calls to arguments in the passed procedure command line...
Procedure * _currentProcedure
bool delayDeletionOfReturnedTable(const std::string &sTableName)
Searches for a local table or a local table in the arguments with the corresponding identifier,...
std::vector< std::string > vInlineArgDef
void createLocalClusters(std::string sClusterList)
This member function will create the local clusters for the current procedure.
void checkArgumentValue(const std::string &sArgument, const std::string &sArgumentList, unsigned int nCurrentIndex)
This private member function checks, whether the keywords "var", "str" or "tab" are used in the curre...
unsigned int nth_procedure
void createLocalInlineVars(std::string sVarList)
This private member function creates the local variables for inlined procedures.
std::map< std::string, std::string > mLocalTables
std::string createMangledVarName(const std::string &sDefinedName) const
Creates a mangled name for a variable.
std::string createTestStatsCluster()
Creates a special cluster containing the test statistics.
bool isReference(const std::string &sArgName) const
Returns whether the passed argument representation (i.e. local variable name) is actually a reference...
void init()
This member function is the initializer function.
void createLocalVars(std::string sVarList)
This member function will create the local numerical variables for the current procedure.
std::map< std::string, std::pair< std::string, mu::value_type * > > mLocalVars
SettingsValue & getSetting(const std::string &value)
Returns a reference to the setting value, which corresponds to the passed string. Throws an exception...
bool useDebugger() const
Returns, whether the debugger is currently active.
bool & active()
Returns a reference to a boolean value type setting.
std::string to_string() const
This member function returns a copy of the viewed section of the string (via std::string::substr)....
size_t find(const std::string &findstr, size_t pos=0) const
Wrapper member function for std::string::find()
This class is the immutable (const) version of a string view. It can be constructed from a MutableStr...
StringView subview(size_t pos=0, size_t len=std::string::npos) const
This member function creates a new StringView class instance using the selected position and length a...
Common exception class for all exceptions thrown in NumeRe.
@ INLINE_PROCEDURE_IS_NOT_INLINE
@ INLINE_PROCEDURE_NEEDS_TABLE_REFERENCES
@ CANNOT_PASS_LITERAL_PER_REFERENCE
static size_t invalid_position
This class abstracts all the index logics, i.e. the logical differences between single indices and in...
void SetExpr(StringView a_sExpr)
Set the expression. Triggers first time calculation thus the creation of the bytecode and scanning of...
value_type Eval()
Single-value wrapper around the vectorized overload of this member function.
const varmap_type & GetVar() const
Return a map containing the used variables only.
void DefineVar(const string_type &a_sName, value_type *a_fVar)
Add a user defined variable.
void RemoveVar(const string_type &a_strVarName)
Remove a variable from internal storage.
std::list< mu::value_type * > m_lDataStorage
string getDataElements(string &sLine, Parser &_parser, MemoryManager &_data, const Settings &_option, int options)
Searches the passed string for calls to any table or cluster and replaces them with internal vectors ...
unsigned int getMatchingParenthesis(const StringView &)
Returns the position of the closing parenthesis.
MUP_BASETYPE value_type
The numeric datatype used by the parser.
static bool isCompleteCluster(StringView sArgumentValue, MemoryManager *_dataRef)
Determines, whether the user has passed a complete cluster or a cluster with some indices.
static bool isCompleteTable(StringView sArgumentValue, MemoryManager *_dataRef)
Determines, whether the user has passed a complete table or a table with some indices.
static bool containsFreeOperators(const string &sString)
Static helper function to detect free operators in a procedure argument. Those arguments need to be s...
void StripSpaces(std::string &)
Removes leading and trailing white spaces and tabulator characters.
#define SETTING_B_TABLEREFS
This structure is central for managing the indices of a table or cluster read or write data access....
std::string toString(int)
Converts an integer to a string without the Settings bloat.