30#include "../ParserLib/muParser.h"
31#include "../datamanagement/memorymanager.hpp"
32#include "../maths/define.hpp"
33#include "../settings.hpp"
34#include "../io/output.hpp"
35#include "../plotting/plotdata.hpp"
36#include "../script.hpp"
133 int for_loop(
int nth_Cmd = 0,
int nth_Loop = 0);
135 int while_loop(
int nth_Cmd = 0,
int nth_Loop = 0);
136 int if_fork(
int nth_Cmd = 0,
int nth_Loop = -1);
137 int switch_fork(
int nth_Cmd = 0,
int nth_Loop = -1);
138 int try_catch(
int nth_Cmd = 0,
int nth_Loop = -1);
142 int compile(std::string sLine,
int nthCmd);
144 value_type*
evalHeader(
int& nNum, std::string& sHeadExpression,
bool bIsForHead,
int nth_Cmd,
const std::string& sHeadCommand);
149 void replaceLocalVars(
const std::string& sOldVar,
const std::string& sNewVar,
size_t from = 0,
size_t to = std::string::npos);
164 virtual int isInline(
const std::string& sProc);
190 void setCommand(std::string& __sCmd,
int nCurrentLine);
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....
bool getReturnSignal() const
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.
Returnvalue getReturnValue() const
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.
This class represents the central memory managing instance. It will handle all tables and clusters,...
This class represents a whole cluster. The single items are stored as pointers to the abstract cluste...
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.
This class is the immutable (const) version of a string view. It can be constructed from a MutableStr...
Mathematical expressions parser.
Namespace for mathematical applications.
MUP_BASETYPE value_type
The numeric datatype used by the parser.
std::map< string_type, value_type * > varmap_type
Type used for storing variables.
This structure accumulates the statistics for the assertion handler.
std::string sFlowCtrlHeader
FlowCtrl::FlowCtrlFunction fcFn
FlowCtrlCommand(const std::string &sCmd, int nLine, bool bStatement=false, FlowCtrl::FlowCtrlFunction fn=nullptr)
Structure as wrapper for the return value of procedures (which may be numerical or string values or a...