31#include "../ui/error.hpp"
32#include "../ParserLib/muParser.h"
33#include "../datamanagement/memorymanager.hpp"
34#include "../settings.hpp"
35#include "../utils/tools.hpp"
36#include "../built-in.hpp"
37#include "../maths/parser_functions.hpp"
38#include "../plotting/plotdata.hpp"
41#include "../maths/define.hpp"
42#include "../io/filesystem.hpp"
43#include "../io/output.hpp"
44#include "../script.hpp"
81 bool setProcName(
const std::string& sProc,
bool bInstallFileName =
false);
90 int isInlineable(
const std::string& sProc,
const std::string& sFileName,
int* nInlineFlag =
nullptr);
93 std::vector<std::string>
getInlined(
const std::string& sProc,
const std::string& sArgumentList,
const std::string& sFileName,
size_t nProcedures);
101 static std::string
mangleName(std::string sProcedureName);
104 virtual int isInline(
const std::string& sProc)
override;
107 virtual int catchExceptionForTest(std::exception_ptr e_ptr,
bool bSupressAnswer_back,
int nLine)
override;
This class implements the function definition managing instance.
void setPredefinedFuncs(const std::string &sPredefined)
This member function updates the internal list of predefined functions. If the list is whitespace-sep...
This class represents the central memory managing instance. It will handle all tables and clusters,...
This class implements the procedure plugin system. It will be a parent class of the procedure class.
This class contains all the plot settings usable by the plotting algorithm.
This class implements the logic to evaluate complex procedures, which may be called recursively.
~Procedure()
Destructor ensuring that the procedure output file stream will be closed, if it is still open.
virtual int catchExceptionForTest(std::exception_ptr e_ptr, bool bSupressAnswer_back, int nLine) override
This virtual member function is inserted in some automatically catchable locations to convert an erro...
FunctionDefinitionManager _localDef
std::string sLastWrittenProcedureFile
Returnvalue execute(std::string sProc, std::string sVarList, mu::Parser &_parser, FunctionDefinitionManager &_functions, MemoryManager &_data, Settings &_option, Output &_out, PlotData &_pData, Script &_script, unsigned int nth_procedure=0)
This member function is central in the execution of the currently selected procedure as it handles al...
std::string sCallingNameSpace
virtual int evalDebuggerBreakPoint(mu::Parser &_parser, Settings &_option) override
This virtual member function handles the gathering of all relevant information for the debugger for t...
int applyInliningRuleset(const std::string &sCommandLine, const std::string &sArgumentList)
This private member function applies the internal inlining rule set for a single procedure command li...
std::vector< std::string > getInlined(const std::string &sProc, const std::string &sArgumentList, const std::string &sFileName, size_t nProcedures)
This virtual private member function returns the inlined representation of the selected procedure as ...
ProcedureVarFactory * _varFactory
int isInlineable(const std::string &sProc, const std::string &sFileName, int *nInlineFlag=nullptr)
This private member function evaluates, whether the current procedure is inlineable,...
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...
std::string sProcCommandLine
void init()
Private initializing member function. Sets all variables to a reasonable default value.
virtual int isInline(const std::string &sProc) override
This virtual member function checks, whether the procedures in the current line are declared as inlin...
int handleIncludeSyntax(std::string &sProcCommandLine, std::ifstream &fInclude, bool bReadingFromInclude)
This member function handles the script include syntax, which one may use in other procedures.
void extractProcedureInformation(const std::string &sCmdLine, size_t nPos, std::string &sProcName, std::string &sArgList, std::string &sFileName)
This private member function extracts procedure name, argument list and the corresponding file name f...
Returnvalue ProcCalc(std::string sLine, std::string sCurrentCommand, int &nByteCode, mu::Parser &_parser, FunctionDefinitionManager &_functions, MemoryManager &_data, Settings &_option, Output &_out, PlotData &_pData, Script &_script)
This member function does the evaluation stuff regarding strings and numerical expressions for the cu...
size_t replaceReturnVal(std::string &sLine, mu::Parser &_parser, const Returnvalue &_return, unsigned int nPos, unsigned int nPos2, const std::string &sReplaceName)
This member function replaces the procedure occurence between the both passed positions using akronym...
bool setProcName(const std::string &sProc, bool bInstallFileName=false)
This member function is used to obtain the procedure file name from the selected procedure....
void setPredefinedFuncs(const std::string &sPredefined)
int getProcedureFlags() const
virtual int getErrorInformationForDebugger() override
This virtual member function handles the gathering of all relevant information for the debugger for t...
int getReturnType() const
void resetProcedure(mu::Parser &_parser, bool bSupressAnswer)
This member function sets the current procedure object to its original state. It will be called at th...
unsigned int GetCurrentLine() const
This member function will return the current line number depending on whether a flow control statemen...
std::string sCurrentProcedureName
size_t countProceduresInLine(const std::string &sCommandLine)
This private member function simply counts the number of procedures, which may be found in the curren...
virtual int procedureCmdInterface(std::string &sLine) override
Virtual member function allowing to identify and evaluate some special procedure commands....
bool handleVariableDefinitions(std::string &sProcCommandLine, const std::string &sCommand)
This method handles the definitions of local variables.
void extractCurrentNamespace(const std::string &sProc)
This member function extracts the namespace of the currently executed procedure.
std::string getCurrentProcedureName() const
bool writeProcedure(std::string sProcedureLine)
This member function handles the procedure installation process by governing the file stream and pass...
static std::string mangleName(std::string sProcedureName)
Mangles a procedure name to be used as a usual variable.
virtual std::vector< std::string > expandInlineProcedures(std::string &sLine) override
This virtual private member function expands all procedures in the current command line,...
std::string sThisNameSpace
Procedure()
Default constructor.
This class is the variable factory used by procedure instances to create their local variables and re...
unsigned int nth_procedure
This class manages the setting values of the internal (kernel) settings of this application.
Mathematical expressions parser.
Structure as wrapper for the return value of procedures (which may be numerical or string values or a...