162 void printResult(
const std::string& sLine,
bool bScriptRunning);
168 bool uninstallPlugin(
const std::string& sLine,
const std::string& sCurrentCommand);
169 void handleToCmd(std::string& sLine, std::string& sCache, std::string& sCurrentCommand);
228 static void print(
const std::string& __sLine,
bool printingEnabled =
true);
229 static void printPreFmt(
const std::string& __sLine,
bool printingEnabled =
true);
231 static std::string
formatResultOutput(
const std::vector<std::string>& vStringResults);
235 static void progressBar(
int nStep,
int nFirstStep,
int nFinalStep,
const std::string& sType);
236 static void getline(std::string& sLine);
237 static void gotoLine(
const std::string& sFile,
unsigned int nLine = 0);
247 static void showDebugEvent(
const std::string& sTitle,
const std::vector<std::string>& vStacktrace);
355 void StartUp(
NumeReTerminal* _parent,
const std::string& __sPath,
const std::string& sPredefinedFunctions);
366 std::map<std::string, std::string>
getMenuMap()
const;
408inline std::string
strfill(
const std::string& sString,
unsigned int nWidth,
char cFill =
' ',
bool limit =
false)
413 std::string sReturn = sString;
416 if (sString.length() < nWidth)
417 sReturn.insert(0, nWidth-sReturn.length(), cFill);
420 if (limit && sString.length() > nWidth)
421 sReturn = sString.substr(0, nWidth - 3) +
"...";
438inline std::string
strlfill(
const std::string& sString,
unsigned int nWidth,
char cFill =
' ')
442 std::string sReturn = sString;
443 if (sString.length() < nWidth)
444 sReturn.append(nWidth-sReturn.length(), cFill);
458inline std::string
sectionHeadline(
const std::string& sString,
char cHeadLineSep =
'-')
460 std::string sSectionHeadline =
"|\n| " +
toUpperCase(sString);
462 if (sSectionHeadline.back() !=
':')
463 sSectionHeadline +=
": ";
465 sSectionHeadline +=
" ";
468 sSectionHeadline +=
"\n";
469 return sSectionHeadline;
484 std::string sErrorPointer =
"| ";
485 sErrorPointer +=
strfill(
"^^^", nPos+13) +
"\n";
486 return sErrorPointer;
This class implements the basic input/ output file system and provides functionalities to work with f...
This class implements the function definition managing instance.
This class represents the central memory managing instance. It will handle all tables and clusters,...
long long int getLastSaved() const
Returns the earliest time-point, when a table was saved. This value is used to determine the elapsed ...
This class represents a whole cluster. The single items are stored as pointers to the abstract cluste...
Cluster & getCluster(StringView sCluster)
This member function returns a reference to the cluster indicated by the passed cluster identifier.
This class is the central string expression parser. It is designed as being a singleton with a persis...
This data container is a copy- efficient table to interchange data between Kernel and GUI.
This class represents an abstract window handled by the window manager.
This is the window manager of the kernel. All windows opened by the kernel will be registered here.
This class provides the interface to the core of NumeRe. It provides all functionalities,...
static NumeReKernel * getInstance()
This static member function returns a a pointer to the singleton instance of the kernel.
static ProcedureLibrary ProcLibrary
static int evalDebuggerBreakPoint(const std::string &sCurrentCommand="")
This member function handles the creation of the debugger information for a script debugger breakpoin...
std::string maskProcedureSigns(std::string sLine)
This member function masks the dollar signs in the strings to avoid that the line breaking functions ...
FunctionDefinitionManager _functions
std::map< std::string, std::string > getPluginLanguageStrings()
This member function returns a map of language strings for the installed plugins, which will be used ...
void setAns(NumeRe::Cluster *ans)
NumeRe::StringParser & getStringParser()
static void getline(std::string &sLine)
This function is an implementation replacing the std::getline() function.
Settings getKernelSettings()
Get the settings available in the Settings class.
static bool bSupressAnswer
bool handleCommandLineSource(std::string &sLine, std::string &sKeep)
This private member function will handle the command line input source and validate it,...
std::string ReadAnswer()
This member function is a simple wrapper to read the kernel answer and reset it automatically.
bool handleProcedureWrite(const std::string &sLine, const std::string &sCurrentCommand, KernelStatus &nReturnVal)
This private member function will handle the writing of procedure lines to the corresponding file.
static NumeReKernel * kernelInstance
void closeWindows(int type)
This member function informs the GUI to close all windows of the selected type. Use 0 or WT_ALL to cl...
bool evaluateStrings(std::string &sLine, std::string &sCache, bool &bWriteToCache, KernelStatus &nReturnVal)
This private member function redirects the processing of strings to the string parser.
std::vector< std::string > getDocIndex()
This member function returns the documentation index as a string vector, which can be used to fill th...
static NumeRe::Table getTable()
This member function is used by the kernel to be notified when the user finished the table edit proce...
PlotData & getPlottingData()
void defineConst()
This member function declares all numerical constants.
NumeRe::WindowManager & getWindowManager()
bool uninstallPlugin(const std::string &sLine, const std::string &sCurrentCommand)
This private member function uninstalls a previously installed plugin.
void updateLineLenght(int nLength)
This member function is used to update the internal terminal line length information after the termin...
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...
bool SettingsModified()
Returns true, if the user changed any internal settings using the set command.
static std::queue< NumeReTask > taskQueue
static int nLastStatusVal
std::vector< std::string > getPluginCommands()
This member function is used by the syntax highlighter to hightlight the plugin commands.
static bool bCancelSignal
void createCalculationAnswer(int nNum, mu::value_type *v)
This private member function will create the answer line for the parser which is then passed to NumeR...
NumeReDebugger & getDebugger()
static void failMessage(std::string sFailMessage)
This static function may be used to print a test failure message in the terminal.
void defineFunctions()
This member function declares all mathematical functions.
MemoryManager & getMemoryManager()
NumeRe::WindowManager _manager
int getAutosaveInterval() const
bool evaluateProcedureCalls(std::string &sLine)
This private member function will evaluate any calls to procedurs and replace their results in the cu...
static void installationDone()
Notify the GUI that the installation was processed.
bool handleComposeBlock(std::string &sLine, const std::string &sCurrentCommand, KernelStatus &nReturnVal)
This private member function will handle the compose block (i.e. store the different commands and ret...
std::string getGreeting()
Returns a random greeting string, which may be printed to the terminal later.
static int numberOfNumbersPerLine()
This member function returns the count of numbers fitting into a single terminal line depending on it...
static void showDebugEvent(const std::string &sTitle, const std::vector< std::string > &vStacktrace)
This member function passes the debugging information to the GUI to be displayed in the debugger wind...
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...
~NumeReKernel()
Destructor of the kernel.
NumeRe::Cluster & getAns()
static void clcTerminal()
Clear the terminal.
static void showTable(NumeRe::Table _table, std::string __name, bool openeditable=false)
This member function passes a table to the GUI to be displayed in the table viewer....
std::map< std::string, std::string > getMenuMap() const
Returns the menu map used to construct the package menu.
KernelStatus MainLoop(const std::string &sCommand)
This is the main loop for the core of NumeRe.
void checkInternalStates()
Evaluates the internal states, performs necessary actions and resets them.
static void progressBar(int nStep, int nFirstStep, int nFinalStep, const std::string &sType)
This function displays a progress bar constructed from characters in the terminal.
static bool bErrorNotification
std::queue< std::string > commandQueue
void StartUp(NumeReTerminal *_parent, const std::string &__sPath, const std::string &sPredefinedFunctions)
This is the kernel "booting" function.
MemoryManager _memoryManager
ProcedureLibrary & getProcedureLibrary()
void displaySplash()
This function displays the intro text.
std::string getDocumentation(const std::string &sCommand)
This member function returns the documentation for the passed command string as HTML string prepared ...
void handleToCmd(std::string &sLine, std::string &sCache, std::string &sCurrentCommand)
This private member function handles the "to_cmd()" function, if it is part of the current command li...
@ NUMERE_INSTALLATION_DONE
@ NUMERE_PRINTLINE_PREFMT
@ NUMERE_STATUSBAR_UPDATE
@ NUMERE_REFRESH_FUNCTIONTREE
@ NUMERE_SHOW_STRING_TABLE
void saveData()
This member function performs the autosaving of tables at application shutdown.
static NumeRe::Table table
void refreshFunctionTree()
This member function informs the GUI to reload the contents of the function tree as soon as possible.
std::map< std::string, std::string > getFunctionLanguageStrings()
This member function returns a map of language strings for the declared functions,...
void sendErrorNotification()
This member function is used to toggle the error notification status. The error notification is used ...
static void flush()
Inform the terminal to write the current output buffer as soon as possible.
void CloseSession()
This member function shuts the kernel down and terminates the kernel instance. Every call to NumeReKe...
void printResult(const std::string &sLine, bool bScriptRunning)
This member function appends the formatted string to the buffer and informs the terminal that we have...
FileSystem & getFileSystem()
void resetAfterError()
This private member function will reset the kernel variables after an error had been handled.
static NumeReTerminal * m_parent
NumeRe::Container< std::string > getStringTable(const std::string &sStringTableName)
This member function creates the table container for the string table or the clusters.
const std::vector< Package > & getInstalledPackages() const
Returns a vector containing the names and the version info of each installed plugin.
bool handleFlowControls(std::string &sLine, const std::string &sCurrentCommand, KernelStatus &nReturnVal)
This private member function will handle used flow controls.
void printVersionInfo()
This member function prints the version headline and the version information to the console.
NumeReKernel()
Constructor of the kernel.
NumeReVariables getVariableList()
This member function returns a structure containing all currently declared variables,...
int ReadOpenFileFlag()
This member function returns the mode, how a file shall be opened in the editor, when called by the k...
static void showStringTable(NumeRe::Container< std::string > _stringtable, std::string __name, bool openeditable=false)
This member function passes a string table to the GUI to be displayed in the table viewer.
NumeRe::StringParser _stringParser
void setKernelSettings(const Settings &_settings)
Update the internal settings.
static unsigned int nLastLineLength
static bool bWritingTable
FunctionDefinitionManager & getDefinitions()
bool getLineFromCommandCache(std::string &sLine, const std::string &sCurrentCommand)
This private member function returns the current command line from the command cache (i....
long long int getLastSavedTime() const
Procedure & getProcedureInterpreter()
static void gotoLine(const std::string &sFile, unsigned int nLine=0)
This member function handles opening files and jumping to lines as requested by the kernel.
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...
void initializeStackTracker()
Starts the stack tracker, which will prevent stack overflows.
void defineOperators()
This member function declares all numerical operators.
static bool GetAsyncCancelState()
This function is used by the kernel to get informed, when the user pressed ESC or used other means of...
static void setDocumentation(const std::string &_sDocumentation)
This member function handles the display of a documentation window as requested by the kernel.
std::vector< std::string > getPathSettings() const
This member function returns a vector containing all currently declared paths in a distinct order.
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.
static void toggleTableStatus()
Toggles the table writing status, which will reduce the number or events send to the terminal.
void Autosave()
Saves the allocated memories by the tables automatically.
static int * baseStackPosition
static bool modifiedSettings
static int waitForContinue()
This static function waits until the user sends a continuation command via the debugger and returns t...
void showWindow(const NumeRe::Window &window)
This member function passes a window object to the user interface, which will then converted into a r...
bool executePlugins(std::string &sLine)
This private member function will execute any call to a plugin.
The terminal class for the GUI. It's a specialisation of the GenericTerminal.
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.
This class manages all already read and possibly pre-parsed procedure files for easier and faster acc...
This class manages the setting values of the internal (kernel) settings of this application.
size_t getAutoSaveInterval() const
Returns the timespan for the autosave interval in seconds.
Mathematical expressions parser.
std::string sectionHeadline(const std::string &sString, char cHeadLineSep='-')
This function provides a headline for the "windows" in the console.
std::string pointToError(unsigned int nPos)
This function points to the error indicated by nPos. It draws three circumflexes below the error loca...
std::string strfill(const std::string &sString, unsigned int nWidth, char cFill=' ', bool limit=false)
This function fills the passed string up to the width nWidth with the characters cFill....
std::string strlfill(const std::string &sString, unsigned int nWidth, char cFill=' ')
This function fills the passed string up to the width nWidth with the characters cFill....
Definition of the standard floating point parser.
MUP_BASETYPE value_type
The numeric datatype used by the parser.
This structure abstracts the necessary information for a task to be done by the graphical user interf...
NumeRe::Container< std::string > stringTable
std::vector< std::string > vDebugEvent
This structure combines a vector of declared variables including their values and respective sizes wi...
std::vector< std::string > vVariables