22#include "../ui/error.hpp"
23#include "../../kernel.hpp"
24#include "../maths/parser_functions.hpp"
25#include "../built-in.hpp"
26#include "../utils/tools.hpp"
29#define FLOWCTRL_ERROR -1
30#define FLOWCTRL_RETURN -2
31#define FLOWCTRL_BREAK -3
32#define FLOWCTRL_CONTINUE -4
33#define FLOWCTRL_NO_CMD -5
37#define NO_FLOW_COMMAND -1
40#define PROCEDURE_INTERFACE 2
41#define JUMP_TABLE_ELEMENTS 3
58 size_t p = sExpr.find(
'(');
59 return sExpr.substr(p + 1, sExpr.rfind(
')') - p - 1);
78 for (
size_t i = 0; i <
FC_COUNT; i++)
123 for (
size_t i = 0; i <
FC_COUNT; i++)
155 if (!
vCmdArray[nth_Cmd].sFlowCtrlHeader.length())
158 std::string sVar =
vCmdArray[nth_Cmd].sCommand.substr(
vCmdArray[nth_Cmd].sCommand.find(
' ') + 1);
159 sVar = sVar.substr(0, sVar.find(
'='));
162 if (sVar.substr(0, 2) ==
"|>")
164 vCmdArray[nth_Cmd].sFlowCtrlHeader.insert(0,
"|>");
172 for (
size_t i = 0; i <
sVarArray.size(); i++)
182 std::string sHead =
vCmdArray[nth_Cmd].sFlowCtrlHeader;
183 nVarAdress =
vCmdArray[nth_Cmd].nVarIndex;
186 v =
evalHeader(nNum, sHead,
true, nth_Cmd,
"for");
195 if (nLastVal < nFirstVal)
208 for (
int __i = nFirstVal; (nInc)*__i <= nInc * nLastVal; __i += nInc)
233 int nReturn = (this->*
vCmdArray[__j].fcFn)(__j, nth_loop+1);
254 else if (__i == nFirstVal && !
nCalcType[__j])
259 if (sCommand ==
"continue")
267 if (sCommand ==
"break")
326 if (
abs(nLastVal - nFirstVal) < 99999
327 &&
abs(
intCast((__i - nFirstVal) /
double(nLastVal - nFirstVal) * 20.0))
328 >
abs(
intCast((__i - 1.0 - nFirstVal) /
double(nLastVal - nFirstVal) * 20.0)))
335 else if (
abs(nLastVal - nFirstVal) >= 99999
336 &&
abs(
intCast((__i - nFirstVal) /
double(nLastVal - nFirstVal) * 100.0))
337 >
abs(
intCast((__i - 1.0 - nFirstVal) /
double(nLastVal - nFirstVal) * 100.0)))
384 if (!
vCmdArray[nth_Cmd].sFlowCtrlHeader.length())
387 std::string sVar =
vCmdArray[nth_Cmd].sCommand.substr(
vCmdArray[nth_Cmd].sCommand.find(
' ') + 1);
388 sVar.erase(sVar.find(
"->")+2);
391 if (sVar.substr(0, 2) ==
"|>")
393 vCmdArray[nth_Cmd].sFlowCtrlHeader.insert(0,
"|>");
401 for (
size_t i = 0; i <
sVarArray.size(); i++)
416 std::string sHead =
vCmdArray[nth_Cmd].sFlowCtrlHeader;
417 nVarAdress =
vCmdArray[nth_Cmd].nVarIndex;
432 if (
sVarArray[nVarAdress].front() ==
'{')
440 sTempCluster.pop_back();
443 for (
size_t i = 0; i < vIters.size(); i++)
456 vCmdArray[nth_Cmd].nRFStepping = vIters.size()-1;
490 if (
sVarArray[nVarAdress].find(
'{') != std::string::npos)
508 for (
size_t i = 0; i < range.
size(); i++)
523 for (
size_t n = 0; n <=
vCmdArray[nth_Cmd].nRFStepping; n++)
556 int nReturn = (this->*
vCmdArray[__j].fcFn)(__j, nth_loop+1);
582 if (sCommand ==
"continue")
590 if (sCommand ==
"break")
645 if (range.
size() < 99999
653 else if (range.
size() >= 99999
681 if (!
vCmdArray[nth_Cmd].sFlowCtrlHeader.length())
684 std::string sWhile_Condition =
vCmdArray[nth_Cmd].sFlowCtrlHeader;
685 std::string sWhile_Condition_Back = sWhile_Condition;
706 v =
evalHeader(nNum, sWhile_Condition,
false, nth_Cmd,
"while");
735 int nReturn = (this->*
vCmdArray[__j].fcFn)(__j, nth_loop+1);
761 if (sCommand ==
"continue")
769 if (sCommand ==
"break")
825 sWhile_Condition = sWhile_Condition_Back;
850 std::string sHeadCommand =
"if";
859 if (!
vCmdArray[nth_Cmd].sFlowCtrlHeader.length())
865 std::string sHead =
vCmdArray[nth_Cmd].sFlowCtrlHeader;
868 v =
evalHeader(nNum, sHead,
false, nth_Cmd, sHeadCommand);
875 for (
int __i = nth_Cmd+1; __i < (int)
vCmdArray.size(); __i++)
883 if (__i == nElse || __i >= nEndif)
917 if (sCommand ==
"continue")
923 if (sCommand ==
"break")
981 sHeadCommand =
"elseif";
983 }
while (
vCmdArray[nth_Cmd].sCommand.find(
">>elseif") != std::string::npos);
987 for (
int __i = nth_Cmd+1; __i < (int)
vCmdArray.size(); __i++)
1026 if (sCommand ==
"continue")
1032 if (sCommand ==
"break")
1094 if (!
vCmdArray[nth_Cmd].sFlowCtrlHeader.length())
1097 std::string sSwitch_Condition =
vCmdArray[nth_Cmd].sFlowCtrlHeader;
1105 v =
evalHeader(nNum, sSwitch_Condition,
false, nth_Cmd,
"switch");
1108 for (
int i = 0; i < nNum; i++)
1120 if (nNextCase == -1)
1123 nth_Cmd = nNextCase;
1127 for (
int __i = nth_Cmd+1; __i < (int)
vCmdArray.size(); __i++)
1133 if (__i >= nSwitchEnd)
1174 if (sCommand ==
"continue")
1180 if (sCommand ==
"break")
1248 for (
int __i = nth_Cmd+1; __i < (int)
vCmdArray.size(); __i++)
1254 if (__i >= nTryEnd || (nNextCatch >= 0 && __i >= nNextCatch))
1290 if (sCommand ==
"continue")
1296 if (sCommand ==
"break")
1346 while (nNextCatch >= 0)
1348 std::string sCatchExpression =
vCmdArray[nNextCatch].sCommand;
1349 sCatchExpression.erase(0, sCatchExpression.find(
">>catch")+7);
1351 if (sCatchExpression.find_first_not_of(
" :") == std::string::npos
1362 nth_Cmd = nNextCatch;
1369 for (
int __i = nth_Cmd+1; __i < (int)
vCmdArray.size(); __i++)
1375 if (__i >= nTryEnd || (nNextCatch >= 0 && __i >= nNextCatch))
1412 if (sCommand ==
"continue")
1418 if (sCommand ==
"break")
1434 rethrow_exception(current_exception());
1492 int nCurrentCalcType =
nCalcType[nth_Cmd];
1498 || sHeadExpression.substr(sHeadExpression.find_first_not_of(
' '), 2) ==
"|>"
1501 if (sHeadExpression.substr(sHeadExpression.find_first_not_of(
' '), 2) ==
"|>")
1504 if (sHeadExpression.substr(sHeadExpression.find_first_not_of(
' '), 2) ==
"|>")
1506 sHeadExpression.erase(sHeadExpression.find_first_not_of(
' '), 2);
1579 sHeadExpression =
"false";
1600 if (!nCurrentCalcType)
1626 if (!nCurrentCalcType)
1655 if (sHeadExpression !=
"\"\"")
1656 sHeadExpression =
"true";
1658 sHeadExpression =
"false";
1701 int nCurrentCalcType =
nCalcType[nth_Cmd];
1707 || sHeadExpression.substr(sHeadExpression.find_first_not_of(
' '), 2) ==
"|>"
1710 if (sHeadExpression.substr(sHeadExpression.find_first_not_of(
' '), 2) ==
"|>")
1713 if (sHeadExpression.substr(sHeadExpression.find_first_not_of(
' '), 2) ==
"|>")
1715 sHeadExpression.erase(sHeadExpression.find_first_not_of(
' '), 2);
1787 sHeadExpression =
"false";
1808 if (!nCurrentCalcType)
1834 if (!nCurrentCalcType)
1899 if (
vCmdArray[__i].sCommand.substr(0, 3) ==
"for")
1902 __i = (this->*
vCmdArray[__i].fcFn)(__i, nth_loop+1);
1908 +
_lang.
get(
"COMMON_SUCCESS") +
".\n");
1915 else if (
vCmdArray[__i].sCommand.substr(0, 5) ==
"while")
1918 __i = (this->*
vCmdArray[__i].fcFn)(__i, nth_loop+1);
1924 +
_lang.
get(
"COMMON_SUCCESS") +
".\n");
1933 return (this->*
vCmdArray[__i].fcFn)(__i, nth_loop+1);
1950 bool bDebuggingBreakPoint = (__sCmd.substr(__sCmd.find_first_not_of(
' '), 2) ==
"|>");
1951 std::string sAppendedExpression =
"";
1954 if (bDebuggingBreakPoint)
1956 __sCmd.erase(__sCmd.find_first_not_of(
' '), 2);
1968 if (__sCmd ==
"abort")
1994 if (command ==
"for")
1999 bool isRangeBased = __sCmd.find(
"->") != std::string::npos;
2011 size_t nPos = std::string::npos;
2015 if (__sCmd[i] ==
'"' && __sCmd[i-1] !=
'\\')
2020 if (__sCmd[i] ==
'(' || __sCmd[i] ==
'{' || __sCmd[i] ==
'[')
2023 if (__sCmd[i] ==
':')
2031 if (nPos == std::string::npos && isRangeBased)
2035 if (nPos != std::string::npos)
2042 else if (command ==
"while")
2056 else if (command ==
"if")
2071 else if (command ==
"else" || command ==
"elseif")
2075 if (command ==
"elseif")
2096 else if (command ==
"endif")
2107 else if (command ==
"switch")
2122 else if (command ==
"case" || command ==
"default")
2134 if (command ==
"default")
2148 else if (command ==
"endswitch")
2159 else if (command ==
"try")
2167 else if (command ==
"catch")
2186 else if (command ==
"endtry")
2197 else if (command ==
"endfor")
2207 else if (command ==
"endwhile")
2223 if (__sCmd.find(
'(') != std::string::npos
2224 && (command ==
"for"
2226 || command ==
"elseif"
2227 || command ==
"switch"
2228 || command ==
"while"))
2233 if (bDebuggingBreakPoint)
2234 __sCmd.insert(__sCmd.find(
'(')+1,
"|>");
2236 else if (command ==
"case" || command ==
"default" || command ==
"catch")
2238 if (__sCmd.find(
':', 4) != std::string::npos
2239 && __sCmd.find_first_not_of(
": ", __sCmd.find(
':', 4)) != std::string::npos)
2241 sAppendedExpression = __sCmd.substr(__sCmd.find(
':', 4)+1);
2242 __sCmd.erase(__sCmd.find(
':', 4)+1);
2245 else if (__sCmd.find(
' ', 4) != std::string::npos
2246 && __sCmd.find_first_not_of(
' ', __sCmd.find(
' ', 4)) != std::string::npos
2247 && __sCmd[__sCmd.find_first_not_of(
' ', __sCmd.find(
' ', 4))] !=
'-')
2249 sAppendedExpression = __sCmd.substr(__sCmd.find(
' ', 4));
2250 __sCmd.erase(__sCmd.find(
' ', 4));
2256 if (sAppendedExpression.find_first_not_of(
";") == std::string::npos)
2257 sAppendedExpression.clear();
2269 for (
size_t n = 0; n < __sCmd.length(); n++)
2271 if (__sCmd[n] ==
'"' && (!n || __sCmd[n-1] !=
'\\'))
2274 if (__sCmd[n] ==
' ' && !(nQuotes % 2))
2276 if (__sCmd.substr(n, 5) ==
" for "
2277 || __sCmd.substr(n, 5) ==
" for("
2278 || __sCmd.substr(n, 7) ==
" endfor"
2279 || __sCmd.substr(n, 4) ==
" if "
2280 || __sCmd.substr(n, 4) ==
" if("
2281 || __sCmd.substr(n, 5) ==
" else"
2282 || __sCmd.substr(n, 8) ==
" elseif "
2283 || __sCmd.substr(n, 8) ==
" elseif("
2284 || __sCmd.substr(n, 6) ==
" endif"
2285 || __sCmd.substr(n, 8) ==
" switch "
2286 || __sCmd.substr(n, 8) ==
" switch("
2287 || __sCmd.substr(n, 6) ==
" case "
2288 || __sCmd.substr(n, 9) ==
" default "
2289 || __sCmd.substr(n, 9) ==
" default:"
2290 || __sCmd.substr(n, 10) ==
" endswitch"
2291 || __sCmd.substr(n, 4) ==
" try"
2292 || __sCmd.substr(n, 7) ==
" catch "
2293 || __sCmd.substr(n, 7) ==
" catch:"
2294 || __sCmd.substr(n, 7) ==
" endtry"
2295 || __sCmd.substr(n, 7) ==
" while "
2296 || __sCmd.substr(n, 7) ==
" while("
2297 || __sCmd.substr(n, 9) ==
" endwhile")
2299 sAppendedExpression = __sCmd.substr(n + 1);
2307 if (bDebuggingBreakPoint)
2308 __sCmd.insert(0,
"|> ");
2325 if (sAppendedExpression.length())
2326 setCommand(sAppendedExpression, nCurrentLine);
2435 if (
vCmdArray[0].sCommand.substr(0, 3) ==
"for")
2452 else if (
vCmdArray[0].sCommand.substr(0, 5) ==
"while")
2469 else if (
vCmdArray[0].sCommand.find(
">>if") != std::string::npos)
2479 else if (
vCmdArray[0].sCommand.find(
">>switch") != std::string::npos)
2489 else if (
vCmdArray[0].sCommand.find(
">>try") != std::string::npos)
2538 for (
size_t i = 0; i <
sVarArray.size(); i++)
2540 if (
sVarArray[i].find(
'{') == std::string::npos &&
sVarArray[i].find(
"->") == std::string::npos)
2551 for (
size_t i = 0; i <
sVarArray.size(); i++)
2569 varmap_type::const_iterator item =
vVars.begin();
2571 for (; item !=
vVars.end(); ++item)
2575 for (
size_t i = 0; i <
sVarArray.size(); i++)
2595 for (
size_t i = 0; i <
FC_COUNT; i++)
2649 std::string sCommand;
2654 bool bCompiling =
false;
2655 bool bWriteToCache =
false;
2656 bool bWriteToCluster =
false;
2657 bool returnCommand =
false;
2662 if (
findCommand(sLine,
"assert").sString ==
"assert")
2666 sLine.erase(
findCommand(sLine,
"assert").nPos, 6);
2676 if (sLine.substr(sLine.find_first_not_of(
' '), 2) ==
"|>")
2679 sLine.erase(sLine.find(
"|>"), 2);
2693 if (sLine.find_last_not_of(
" \t") != std::string::npos && sLine[sLine.find_last_not_of(
" \t")] ==
';')
2695 sLine.erase(sLine.rfind(
';'));
2707 && sCommand !=
"define"
2708 && sCommand !=
"redef"
2709 && sCommand !=
"redefine"
2710 && sCommand !=
"undefine"
2711 && sCommand !=
"undef"
2712 && sCommand !=
"ifndef"
2713 && sCommand !=
"ifndefined")
2721 if (sCommand ==
"define"
2722 || sCommand ==
"redef"
2723 || sCommand ==
"redefine"
2724 || sCommand ==
"undefine"
2725 || sCommand ==
"undef"
2726 || sCommand ==
"ifndef"
2727 || sCommand ==
"ifndefined")
2736 if (sCommand ==
"throw" || sLine ==
"throw")
2755 if (sCommand ==
"return")
2759 std::string sReturnValue = sLine.substr(sLine.find(
"return") + 6);
2762 if (sReturnValue.back() ==
';')
2763 sReturnValue.pop_back();
2767 if (sReturnValue ==
"void")
2773 else if (sReturnValue.find(
'(') != std::string::npos
2774 && sReturnValue.substr(sReturnValue.find(
'(')) ==
"()"
2781 else if (!sReturnValue.length())
2788 sLine = sReturnValue;
2789 returnCommand =
true;
2831 if ((sCommand ==
"compose"
2832 || sCommand ==
"endcompose"
2834 && sCommand !=
"quit")
2843 else if (sCommand ==
"abort")
2848 else if (sCommand !=
"endcompose")
2850 if (sCommand.substr(0, 4) ==
"plot"
2851 || sCommand.substr(0, 4) ==
"grad"
2852 || sCommand.substr(0, 4) ==
"dens"
2853 || sCommand.substr(0, 4) ==
"vect"
2854 || sCommand.substr(0, 4) ==
"cont"
2855 || sCommand.substr(0, 4) ==
"surf"
2856 || sCommand.substr(0, 4) ==
"mesh")
2869 if (sLine.find(
"to_cmd(") != std::string::npos)
2876 unsigned int nPos = 0;
2878 while (sLine.find(
"to_cmd(", nPos) != std::string::npos)
2880 nPos = sLine.find(
"to_cmd(", nPos) + 6;
2887 if (nParPos == std::string::npos)
2890 std::string sCmdString = sLine.substr(nPos + 1, nParPos - 1);
2895 sCmdString +=
" -nq";
2900 sLine = sLine.substr(0, nPos - 6) + sCmdString + sLine.substr(nPos + nParPos + 1);
2913 if (sCommand ==
"progress" && sLine.length() > 9)
2919 std::string sArgument;
2933 if (sLine.find(
"-set") != std::string::npos || sLine.find(
"--") != std::string::npos)
2935 if (sLine.find(
"-set") != std::string::npos)
2936 sArgument = sLine.substr(sLine.find(
"-set"));
2938 sArgument = sLine.substr(sLine.find(
"--"));
2940 sLine.erase(sLine.find(sArgument));
2962 if (sArgument.front() !=
'"')
2963 sArgument =
"\"" + sArgument +
"\" -nq";
2984 while (sLine.length() && (sLine[sLine.length() - 1] ==
' ' || sLine[sLine.length() - 1] ==
'-'))
2987 if (!sLine.length())
3001 if (sLine.find(
"??") != std::string::npos)
3023 sLine.insert(0,
"return ");
3040 else if (returnCommand)
3054 if (nProcedureCmd == 1)
3064 if (sCommand ==
"explicit")
3077 std::string sPreCommandLine = sLine;
3085 std::string sCurrentLine = sLine;
3088 if (sPreCommandLine != sCurrentLine)
3115 if (sLine.find(
'$') != std::string::npos)
3125 bool stringParserAdHoc =
false;
3141 if (sCache.length())
3142 bWriteToCache =
true;
3145#warning NOTE (numere#1#08/21/21): Might need some adaption, if bytecode issues are experienced
3147 stringParserAdHoc =
true;
3159 bWriteToCache =
true;
3169 if (!stringParserAdHoc)
3195#warning NOTE (erik.haenel#3#): This is changed due to double writes in combination with c{nlen+1} = VAL
3199 if (sCache.length())
3201 bWriteToCache =
false;
3220 if (sCache[(pos = sCache.find_first_of(
"({"))] ==
'{')
3221 bWriteToCluster =
true;
3232 if (!bWriteToCluster)
3245 if (sCache[(pos = sCache.find_first_of(
"({"))] ==
'{')
3246 bWriteToCluster =
true;
3298 if (bWriteToCluster)
3306 for (
int i = 0; i < nNum; i++)
3340 int nCurrentCalcType =
nCalcType[nthCmd];
3346 if (!nCurrentCalcType)
3352 std::string sBuffer;
3407 if (sReturnValue.back() ==
';')
3408 sReturnValue.pop_back();
3412 if (sReturnValue ==
"void")
3418 else if (sReturnValue.find(
'(') != std::string::npos
3419 && sReturnValue.substr(sReturnValue.find(
'(')) ==
"()"
3426 else if (!sReturnValue.length())
3433 sBuffer = sReturnValue;
3482 if (sCommand ==
"compose"
3483 || sCommand ==
"endcompose"
3491 else if (sCommand ==
"abort")
3496 else if (sCommand !=
"endcompose")
3498 if (sCommand.substr(0, 4) ==
"plot"
3499 || sCommand.substr(0, 4) ==
"grad"
3500 || sCommand.substr(0, 4) ==
"dens"
3501 || sCommand.substr(0, 4) ==
"vect"
3502 || sCommand.substr(0, 4) ==
"cont"
3503 || sCommand.substr(0, 4) ==
"surf"
3504 || sCommand.substr(0, 4) ==
"mesh")
3524 unsigned int nPos = 0;
3527 while (sBuffer.find(
"to_cmd(", nPos) != std::string::npos)
3529 nPos = sBuffer.find(
"to_cmd(", nPos) + 6;
3536 if (nParPos == std::string::npos)
3539 std::string sCmdString = sBuffer.substr(nPos + 1, nParPos - 1);
3544 sCmdString +=
" -nq";
3549 sBuffer = sBuffer.substr(0, nPos - 6) + sCmdString + sBuffer.substr(nPos + nParPos + 1);
3565 std::string sArgument;
3580 if (sBuffer.find(
"-set") != std::string::npos || sBuffer.find(
"--") != std::string::npos)
3582 if (sBuffer.find(
"-set") != std::string::npos)
3583 sArgument = sBuffer.substr(sBuffer.find(
"-set"));
3585 sArgument = sBuffer.substr(sBuffer.find(
"--"));
3587 sBuffer.erase(sBuffer.find(sArgument));
3609 if (sArgument.front() !=
'"')
3610 sArgument =
"\"" + sArgument +
"\" -nq";
3631 while (sBuffer.length() && (sBuffer[sBuffer.length() - 1] ==
' ' || sBuffer[sBuffer.length() - 1] ==
'-'))
3634 if (!sBuffer.length())
3671 sBuffer.insert(0,
"return ");
3689 sBuffer.erase(0, 7);
3707 if (nProcedureCmd == 1)
3733 std::string sPreCommandLine = sLine.
to_string();
3760 if (sBuffer.find(
'$') != std::string::npos)
3779 std::string sDataObject;
3780 bool bCompiling =
false;
3781 bool bWriteToCache =
false;
3782 bool bWriteToCluster =
false;
3801 if (sDataObject.length())
3802 bWriteToCache =
true;
3805#warning NOTE (numere#1#08/21/21): Might need some adaption, if bytecode issues are experienced
3818 bWriteToCache =
true;
3850#warning NOTE (erik.haenel#3#): This is changed due to double writes in combination with c{nlen+1} = VAL
3854 if (sDataObject.length())
3856 bWriteToCache =
false;
3857 sDataObject.clear();
3881 if (sDataObject[(pos = sDataObject.find_first_of(
"({"))] ==
'{')
3882 bWriteToCluster =
true;
3890 sDataObject.erase(pos);
3893 if (!bWriteToCluster)
3906 if (sDataObject[(pos = sDataObject.find_first_of(
"({"))] ==
'{')
3907 bWriteToCluster =
true;
3915 sDataObject.erase(pos);
3941 if (bWriteToCluster)
3949 for (
int i = 0; i < nNum; i++)
3976 for (
unsigned int i = 0; i < sLine.length(); i++)
3978 if (sLine.substr(i, (iter->first).length()) == iter->first)
3980 if ((i &&
checkDelimiter(sLine.substr(i - 1, (iter->first).length() + 2)))
3981 || (!i &&
checkDelimiter(
" " + sLine.substr(i, (iter->first).length() + 1))))
3983 sLine.replace(i, (iter->first).length(), iter->second);
4013 for (
unsigned int j = 0; j <
vCmdArray[i].sCommand.length(); j++)
4015 if (
vCmdArray[i].sCommand.substr(j, sOldVar.length()) == sOldVar)
4021 vCmdArray[i].sCommand.replace(j, sOldVar.length(), sNewVar);
4022 j += sNewVar.length() - sOldVar.length();
4046 if (sFlowControlArgument.find(
'(') == std::string::npos)
4049 std::string sArgument = sFlowControlArgument.substr(sFlowControlArgument.find(
'('));
4062 if (sArgument.find(
'=') == std::string::npos && sArgument.find(
"->") == std::string::npos)
4081 if (sCaseDefinition.find(
':') == std::string::npos)
4086 if (sCaseDefinition.substr(0, 5) ==
"case ")
4089 std::string sValue = sCaseDefinition.substr(4);
4090 sValue.erase(sValue.find(
':'));
4094 if (sValue.find_first_not_of(
' ') == std::string::npos)
4101 if (sValue.length() && sValue.find_first_not_of(
' ') != std::string::npos)
4119 std::string sVars =
";";
4123 for (
size_t i = 0; i <
vCmdArray.size(); i++)
4130 if (
vCmdArray[i].sCommand.substr(0, 3) ==
"for")
4134 if (sVar.find(
"->") != std::string::npos)
4135 sVar.erase(sVar.find(
"->")+2);
4137 sVar.erase(sVar.find(
'='));
4139 if (sVar.substr(0, 2) ==
"|>")
4144 if (sVars.find(
";" + sVar +
";") == std::string::npos)
4146 sVars += sVar +
";";
4196 for (
size_t i = 0; i <
vCmdArray.size(); i++)
4202 if (
vCmdArray[i].sCommand.substr(0, 3) ==
"for")
4206 for (
size_t j = i + 1; j <
vCmdArray.size(); j++)
4211 if (
vCmdArray[j].sCommand.length() &&
vCmdArray[j].sCommand.substr(0, 6) ==
"endfor")
4221 else if (
vCmdArray[j].sCommand.length() &&
vCmdArray[j].sCommand.substr(0, 3) ==
"for")
4225 else if (
vCmdArray[i].sCommand.substr(0, 5) ==
"while")
4227 int nWhileCount = 0;
4229 for (
size_t j = i + 1; j <
vCmdArray.size(); j++)
4234 if (
vCmdArray[j].sCommand.length() &&
vCmdArray[j].sCommand.substr(0, 8) ==
"endwhile")
4244 else if (
vCmdArray[j].sCommand.length() &&
vCmdArray[j].sCommand.substr(0, 5) ==
"while")
4248 else if (
vCmdArray[i].sCommand.find(
">>if") != std::string::npos)
4250 std::string sNth_If =
vCmdArray[i].sCommand.substr(0,
vCmdArray[i].sCommand.find(
">>"));
4252 for (
size_t j = i + 1; j <
vCmdArray.size(); j++)
4258 &&
vCmdArray[j].sCommand.substr(0, (sNth_If +
">>else").length()) == sNth_If +
">>else"
4262 &&
vCmdArray[j].sCommand.substr(0, (sNth_If +
">>elseif").length()) == sNth_If +
">>elseif"
4266 &&
vCmdArray[j].sCommand.substr(0, (sNth_If +
">>endif").length()) == sNth_If +
">>endif")
4273 else if (
vCmdArray[i].sCommand.find(
">>elseif") != std::string::npos)
4275 std::string sNth_If =
vCmdArray[i].sCommand.substr(0,
vCmdArray[i].sCommand.find(
">>"));
4277 for (
size_t j = i + 1; j <
vCmdArray.size(); j++)
4283 &&
vCmdArray[j].sCommand.substr(0, (sNth_If +
">>else").length()) == sNth_If +
">>else"
4287 &&
vCmdArray[j].sCommand.substr(0, (sNth_If +
">>elseif").length()) == sNth_If +
">>elseif"
4291 &&
vCmdArray[j].sCommand.substr(0, (sNth_If +
">>endif").length()) == sNth_If +
">>endif")
4298 else if (
vCmdArray[i].sCommand.find(
">>switch") != std::string::npos)
4300 std::string sNth_Switch =
vCmdArray[i].sCommand.substr(0,
vCmdArray[i].sCommand.find(
">>"));
4302 for (
size_t j = i + 1; j <
vCmdArray.size(); j++)
4308 &&
vCmdArray[j].sCommand.substr(0, (sNth_Switch +
">>case").length()) == sNth_Switch +
">>case"
4312 &&
vCmdArray[j].sCommand.substr(0, (sNth_Switch +
">>default").length()) == sNth_Switch +
">>default"
4316 &&
vCmdArray[j].sCommand.substr(0, (sNth_Switch +
">>endswitch").length()) == sNth_Switch +
">>endswitch")
4329 else if (
vCmdArray[i].sCommand.find(
">>case") != std::string::npos)
4331 std::string sNth_Switch =
vCmdArray[i].sCommand.substr(0,
vCmdArray[i].sCommand.find(
">>"));
4333 for (
size_t j = i + 1; j <
vCmdArray.size(); j++)
4339 &&
vCmdArray[j].sCommand.substr(0, (sNth_Switch +
">>case").length()) == sNth_Switch +
">>case"
4343 &&
vCmdArray[j].sCommand.substr(0, (sNth_Switch +
">>default").length()) == sNth_Switch +
">>default"
4347 &&
vCmdArray[j].sCommand.substr(0, (sNth_Switch +
">>endswitch").length()) == sNth_Switch +
">>endswitch")
4354 else if (
vCmdArray[i].sCommand.find(
">>try") != std::string::npos)
4356 std::string sNth_Try =
vCmdArray[i].sCommand.substr(0,
vCmdArray[i].sCommand.find(
">>"));
4358 for (
size_t j = i + 1; j <
vCmdArray.size(); j++)
4364 &&
vCmdArray[j].sCommand.substr(0, (sNth_Try +
">>catch").length()) == sNth_Try +
">>catch"
4368 &&
vCmdArray[j].sCommand.substr(0, (sNth_Try +
">>endtry").length()) == sNth_Try +
">>endtry")
4375 else if (
vCmdArray[i].sCommand.find(
">>catch") != std::string::npos)
4377 std::string sNth_Try =
vCmdArray[i].sCommand.substr(0,
vCmdArray[i].sCommand.find(
">>"));
4379 for (
size_t j = i + 1; j <
vCmdArray.size(); j++)
4385 &&
vCmdArray[j].sCommand.substr(0, (sNth_Try +
">>catch").length()) == sNth_Try +
">>catch"
4389 &&
vCmdArray[j].sCommand.substr(0, (sNth_Try +
">>endtry").length()) == sNth_Try +
">>endtry")
4409 && (
vCmdArray[i].sCommand.find(
"+=") != std::string::npos
4410 ||
vCmdArray[i].sCommand.find(
"-=") != std::string::npos
4411 ||
vCmdArray[i].sCommand.find(
"*=") != std::string::npos
4412 ||
vCmdArray[i].sCommand.find(
"/=") != std::string::npos
4413 ||
vCmdArray[i].sCommand.find(
"^=") != std::string::npos
4414 ||
vCmdArray[i].sCommand.find(
"++") != std::string::npos
4415 ||
vCmdArray[i].sCommand.find(
"--") != std::string::npos))
4420 bool bBreakPoint = (
vCmdArray[i].sCommand.substr(
vCmdArray[i].sCommand.find_first_not_of(
" \t"), 2) ==
"|>");
4451 std::string sSwitchArgument =
vCmdArray[nSwitchStart].sCommand;
4452 vCmdArray[nSwitchStart].sCommand.erase(sSwitchArgument.find(
'('));
4453 sSwitchArgument.erase(0, sSwitchArgument.find(
'(')+1);
4454 sSwitchArgument.erase(sSwitchArgument.rfind(
')'));
4456 std::string sArgument =
"";
4459 std::string sNth_Switch =
vCmdArray[nSwitchStart].sCommand.substr(0,
vCmdArray[nSwitchStart].sCommand.find(
">>"));
4463 for (
size_t j = nSwitchStart + 1; j <
vCmdArray.size(); j++)
4467 if (
vCmdArray[j].sCommand.length() &&
vCmdArray[j].sCommand.substr(0, (sNth_Switch +
">>case").length()) == sNth_Switch +
">>case")
4469 if (sArgument.length())
4473 sArgument.erase(sArgument.rfind(
':'));
4480 if (sArgument.length())
4482 std::string sExpr = sSwitchArgument;
4483 sSwitchArgument.clear();
4485 while (sArgument.length())
4487 sSwitchArgument += sExpr +
" == " +
getNextArgument(sArgument,
true) +
",";
4490 sSwitchArgument.pop_back();
4494 vCmdArray[nSwitchStart].sCommand +=
"(" + sSwitchArgument +
")";
4513 const int INLINING_GLOBALINRETURN = 2;
4515 for (
size_t i = 0; i <
vCmdArray.size(); i++)
4519 if (
vCmdArray[i].sCommand.substr(0, 3) ==
"for" ||
vCmdArray[i].sCommand.substr(0, 5) ==
"while")
4532 for (
size_t i = 0; i <
vCmdArray.size(); i++)
4534 if (
vCmdArray[i].sCommand.find(
"to_cmd(") != std::string::npos)
4537 if (
vCmdArray[i].sCommand.find(
'$') != std::string::npos)
4543 else if (!
vCmdArray[i].bFlowCtrlStatement && nInlining != INLINING_GLOBALINRETURN)
4548 for (
size_t j = 0; j < vExpandedProcedure.size(); j++)
4554 i += vExpandedProcedure.size();
4559 bool bDefineCommands =
false;
4562 for (
size_t i = 0; i <
vCmdArray.size(); i++)
4574 bDefineCommands =
true;
4582 if (!bDefineCommands)
4584 for (
size_t i = 0; i <
vCmdArray.size(); i++)
4617 sVars = sVars.substr(1, sVars.length() - 1);
4623 for (
size_t i = 0; i <
sVarArray.size(); i++)
4625 sVarArray[i] = sVars.substr(0, sVars.find(
';'));
4626 bool isRangeBased =
sVarArray[i].find(
"->") != std::string::npos;
4628 if (sVars.find(
';') != std::string::npos)
4629 sVars = sVars.substr(sVars.find(
';') + 1);
4728 return sCmd ==
"if" || sCmd ==
"for" || sCmd ==
"while" || sCmd ==
"switch" || sCmd ==
"try";
4744 return sCmd ==
"for"
4751 || sCmd ==
"endswitch"
4753 || sCmd ==
"default"
4758 || sCmd ==
"endwhile";
4845 return std::vector<std::string>();
string evaluateParameterValues(const string &sCmd)
This function evaluates a passed parameter string, so that the values of the parameters are only valu...
CommandReturnValues commandHandler(string &sCmd)
This function is the main command handling function.
@ COMMAND_HAS_RETURNVALUE
void enable(const std::string &sExpr)
Enables the assertion handler using the passed expression.
void reset()
Resets the assertion handler.
AssertionStats getStats() const
Returns the current tests stats.
void checkAssertion(mu::value_type *v, int nNum)
Checks the return value of a muParser evaluated result.
This class extends the std::vector for endlessness.
int if_fork(int nth_Cmd=0, int nth_Loop=-1)
This member function realizes the IF-ELSE control flow statement. The return value is either an error...
void replaceLocalVars(std::string &sLine)
This member function is used to replace variable occurences with their (auto-determined) internal nam...
int calc(StringView sLine, int nthCmd)
This member function does the hard work and calculates the numerical and std::string results for the ...
void eval()
This member function prepares the command array by pre-evaluating all constant stuff or function call...
void fillJumpTableAndExpandRecursives()
Go again through the whole command set and fill the jump table with the corresponding block ends and ...
std::vector< std::vector< int > > nJumpTable
int getCurrentBlockDepth() const
Returns the current block depth while reading a flow control statement to memory.
std::vector< value_type > vVarArray
virtual int procedureCmdInterface(std::string &sLine)
Dummy implementation.
bool checkCaseValue(const std::string &sCaseDefinition)
This member function checks, whether the entered case definition is valid or not.
NumeRe::Cluster evalRangeBasedHeader(std::string &sHeadExpression, int nth_Cmd, const std::string &sHeadCommand)
This member function handles the evaluation of the range-based flow control headers....
void prepareSwitchExpression(int nSwitchStart)
This member function will prepare the single logical switch expression.
std::vector< std::string > sVarArray
static bool isAnyFlowCtrlStatement(const std::string &sCmd)
This static member function returns whether the passed command is any of the known flow control state...
static bool isFlowCtrlStatement(const std::string &sCmd)
This static member function returns whether the passed command is a flow control statement.
virtual int evalDebuggerBreakPoint(Parser &_parser, Settings &_option)
Dummy implementation.
std::string sLoopPlotCompose
void checkParsingModeAndExpandDefinitions()
If the loop parsing mode is active, ensure that only inline procedures are used in this case....
int switch_fork(int nth_Cmd=0, int nth_Loop=-1)
This member function realizes the SWITCH-CASE control flow statement. The return value is either an e...
std::map< std::string, std::string > mVarMap
std::set< std::string > inlineClusters
virtual int getErrorInformationForDebugger()
Dummy implementation.
int evalForkFlowCommands(int __j, int nth_loop)
This member function handles the evaluation of flow control statements from the viewpoint of an if-el...
std::string sTestClusterName
void setCommand(std::string &__sCmd, int nCurrentLine)
This member function is used to set a command line from the outside into the flow control statement c...
void prepareLocalVarsAndReplace(std::string &sVars)
This method prepares the local variables including their names and replaces them in the command lines...
std::string getCurrentBlock() const
virtual int isInline(const std::string &sProc)
Dummy implementation.
std::vector< int > nCalcType
int while_loop(int nth_Cmd=0, int nth_Loop=0)
This member function realizes the WHILE control flow statement. The return value is either an error v...
bool checkFlowControlArgument(const std::string &sFlowControlArgument, bool isForLoop=false)
This member function checks, whether the passed flow control argument is valid or not.
void reset()
This function clears the memory of this FlowCtrl object and sets everything back to its original stat...
int range_based_for_loop(int nth_Cmd=0, int nth_Loop=0)
This member function realizes the FOR control flow statement for range based indices....
virtual std::vector< std::string > expandInlineProcedures(std::string &sLine)
Dummy implementation.
int(FlowCtrl::* FlowCtrlFunction)(int, int)
Definition of a generic FlowCtrl entry point.
virtual ~FlowCtrl()
Destructor. Cleanes the memory, if necessary.
int nFlowCtrlStatements[FC_COUNT]
int getCurrentLineNumber() const
This member function returns the current line number as enumerated during passing the commands via "s...
std::string extractFlagsAndIndexVariables()
Read the flow control statements only and extract the index variables and the flow control flags.
std::string getCurrentCommand() const
This member function returns the current command line, which will or has been evaluated in the curren...
value_type * evalHeader(int &nNum, std::string &sHeadExpression, bool bIsForHead, int nth_Cmd, const std::string &sHeadCommand)
This member function abstracts the evaluation of all flow control headers. It will return an array of...
@ CALCTYPE_RECURSIVEEXPRESSION
@ CALCTYPE_PROCEDURECMDINTERFACE
@ CALCTYPE_SUPPRESSANSWER
@ CALCTYPE_DEBUGBREAKPOINT
int compile(std::string sLine, int nthCmd)
This member function does the hard work and compiles the numerical and std::string results for the cu...
int try_catch(int nth_Cmd=0, int nth_Loop=-1)
Implements a try-catch block.
int for_loop(int nth_Cmd=0, int nth_Loop=0)
This member function realizes the FOR control flow statement. The return value is either an error val...
void updateTestStats()
Updates the test statistics with the total test statistics.
virtual int catchExceptionForTest(std::exception_ptr e_ptr, bool bSupressAnswer_back, int nLine)
Dummy implementation.
bool bEvaluatingFlowControlStatements
std::vector< FlowCtrlCommand > vCmdArray
FunctionDefinitionManager * _functionRef
virtual ProcedureInterfaceRetVal procedureInterface(std::string &sLine, Parser &_parser, FunctionDefinitionManager &_functions, MemoryManager &_data, Output &_out, PlotData &_pData, Script &_script, Settings &_option, int nth_command)
Dummy implementation.
FlowCtrl()
Default constructor.
This class implements the function definition managing instance.
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,...
bool isTable(const std::string &sTable) const
This member function returns, whether the passed table name corresponds to a known table.
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...
bool isString() const
This member function returns, whether the data in the cluster have only string as type.
size_t size() const
This member function returns the size of the internal memory buffer as items.
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 assignResults(Indices _idx, int nNum, mu::value_type *data)
This member function assigns calculation results as data for the cluster items in memory,...
std::vector< std::string > to_string() const
Converts all contents of this cluster to a vector of strings. Intended to be used for data transfer.
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...
mu::value_type getDouble(size_t i) const
This member function returns the data of the i-th cluster item in memory as a value.
std::string getInternalString(size_t i) const
This member function returns the data of the i-th cluster item in memory as a string.
bool isDouble() const
This member function returns, whether the data in the cluster have only double as type.
unsigned short getType(size_t i) const
This member function returns the type of the i-th cluster item in the internal memory buffer.
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.
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...
bool isStringVar(const std::string &sVarName) const
Determine, whether the passed string is the identifier of a string variable.
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.
void getStringValues(std::string &sLine)
This public member function resolves all string variable occurences and replaces them with their valu...
void removeTempStringVectorVars()
This member function removes all temporary string vector variables.
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 gatherLoopBasedInformations(const std::string &_sErraticCommand, unsigned int _nLineNumber, std::map< std::string, std::string > &mVarMap, const std::vector< mu::value_type > &vVarArray, const std::vector< std::string > &sVarArray)
This member funciton gathers the necessary debugging informations from the current executed control f...
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()
static bool bSupressAnswer
PlotData & getPlottingData()
static void printPreFmt(const std::string &__sLine, bool printingEnabled=true)
This member function appends the pre- formatted string to the buffer and informs the terminal that we...
NumeReDebugger & getDebugger()
MemoryManager & getMemoryManager()
static void print(const std::string &__sLine, bool printingEnabled=true)
This member function appends the passed string as a new output line to the buffer and informs the ter...
NumeRe::Cluster & getAns()
FunctionDefinitionManager & getDefinitions()
static bool GetAsyncCancelState()
This function is used by the kernel to get informed, when the user pressed ESC or used other means of...
static std::string formatResultOutput(int nNum, mu::value_type *v)
This static function is used to format the result output in the terminal for numerical-only results.
This class contains all the plot settings usable by the plotting algorithm.
This class manages the setting values of the internal (kernel) settings of this application.
bool systemPrints() const
Returns, whether system messages shall be printed to the terminal.
bool useMaskDefault() const
Returns, whether loop flow control statements shall use the mask option automatically.
bool useDebugger() const
Returns, whether the debugger is currently active.
void strip()
This member function shrinks the viewed section to remove all leading or trailing whitespace characte...
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()
size_t length() const
This member function simply returns the length of the viewed section.
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.
@ INVALID_FLOWCTRL_STATEMENT
@ PROCESS_ABORTED_BY_USER
static size_t invalid_position
bool isOpenEnd() const
This member function determines, whether the internal index set has an open end.
std::string to_string() const
This member function converts the vector indexes contents into a human-readable string representation...
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.
void CacheCurrentTarget(const std::string &sEquation)
Caches the passed target equation for this position.
int IsValidByteCode(unsigned int _nthLoopElement=-1, unsigned int _nthPartEquation=0)
This member function returns, whether the current equation is already parsed and there's a valid byte...
const std::string & GetCachedEquation() const
Returns the stored equation for this position.
void SetIndex(unsigned int _nLoopElement)
Activates the selected position in the internally stored bytecode.
void PauseLoopMode(bool _bPause=true)
This member function pauses the loop mode, so that the new assigned equation does not invalidate alre...
bool IsLockedPause() const
Check, whether the pause mode is locked.
void DeactivateLoopMode()
Deactivates the loop mode and resets the internal arrays.
void ClearVectorVars(bool bIgnoreProcedureVects=false)
This member function cleares the internal vector storage.
bool ActiveLoopMode() const
Check, whether the loop mode is active. This function returns true even if the loop mode is paused.
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.
bool CanCacheAccess()
Check, whether the current position can cache any data accesses.
bool IsAlreadyParsed(StringView sNewEquation)
This member function checks, whether the passed expression is already parsed, so that the parsing ste...
bool IsCompiling()
Returns true, if the parser is currently in compiling step.
bool IsNotLastStackItem() const
Check, whether there are more elements on the parsing stack remaining.
void LockPause(bool _bLock=true)
This member function locks the pause mode so that it cannot be accidentally activated.
void ActivateLoopMode(unsigned int _nLoopLength)
Activates the loop mode and prepares the internal arrays for storing the necessary data.
void CacheCurrentEquation(const std::string &sEquation)
Caches the passed equation for this position.
size_t HasCachedAccess()
Evaluate, whether there are any cached data accesses for this position.
std::map< std::string, std::string > * mVarMapPntr
void SetCompiling(bool _bCompiling=true)
Activate the compiling step for the parser.
Mathematical expressions parser.
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 ...
bool isNotEmptyExpression(const string &sExpr)
This function checks, whether the passed expression is non-empty (i.e. it contains more than white sp...
bool isClusterCandidate(string &sLine, string &sCluster, bool doCut)
This function checks, whether the passed command line contains the syntax for a cluster candidate,...
Indices getIndices(StringView sCmd, mu::Parser &_parser, MemoryManager &_data, const Settings &_option)
Wrapper for the new getIndices function interface.
bool isValidIndexSet(const Indices &_idx)
ErrorType getErrorType(std::exception_ptr e_ptr)
This function obtains the error type of a catched exception and sets the last error message.
std::string errorTypeToString(ErrorType e)
Return the error type converted to a human readable string.
Assertion _assertionHandler
ErrorType
Defines the possible error types, which can be thrown in this application.
RangeForVarType
Simple enum to make the variable types of the range based for loop more readable.
#define JUMP_TABLE_ELEMENTS
#define PROCEDURE_INTERFACE
static std::string extractHeaderExpression(const std::string &sExpr)
A simple helper function to extract the header expression of control flow statements.
#define FLOWCTRL_CONTINUE
unsigned int getMatchingParenthesis(const StringView &)
Returns the position of the closing parenthesis.
CONSTCD11 std::chrono::duration< Rep, Period > abs(std::chrono::duration< Rep, Period > d)
MUP_BASETYPE value_type
The numeric datatype used by the parser.
bool isnan(const value_type &v)
string promptForUserInput(const string &__sCommand)
This function is invoked, if a prompt operator ("??") was found in a string.
mu::value_type * getPointerToVariable(const string &sVarName, Parser &_parser)
This function returns the pointer to the passed variable.
void StripSpaces(std::string &)
Removes leading and trailing white spaces and tabulator characters.
int findParameter(const std::string &sCmd, const std::string &sParam, const char cFollowing)
This function searches the passed parameter in the passed command string. If something is found,...
This structure accumulates the statistics for the assertion handler.
size_t nCheckedAssertions
This structure is central for managing the indices of a table or cluster read or write data access....
std::string sCompiledAccessEquation
std::vector< std::string > vStringVal
std::string sReturnedTable
std::vector< mu::value_type > vNumVal
long long int intCast(const std::complex< double > &)
Casts the real part of the complex number to an integer and avoids rounding errors.
std::string toString(int)
Converts an integer to a string without the Settings bloat.