Scanframe Modular Application 0.1.0
|
Simple script engine able. More...
#include <ScriptEngine.h>
Public Member Functions | |
ScriptEngine () | |
Default constructor. | |
bool | calculate (const std::string &script, Value &result) |
Calculates the passed script. | |
EArithError | getError () const |
Gets the error value of this instance. | |
std::string | getErrorReason () const |
Gets the associated error reason string. | |
bool | setError (EArithError error_value, const std::string &reason=std::string()) |
Sets the error value for this instance. | |
const char * | getErrorText (EArithError error_value=EArithError::aeCurrent) const |
pos_type | getPos () const |
Gets the current position. | |
virtual strings | getInfoNames () const |
Gets names of info structures in lines. | |
const IdInfo * | getInfo (const std::string &name) const override |
Functions to be overloaded in derived classes to add functions, parameters, constants and keywords. | |
virtual strings | getIdentifiers (EIdentifier id) const |
Gets a list of available identifiers. | |
Public Member Functions inherited from sf::ScriptObject | |
ScriptObject (const char *type_name, ScriptObject *parent=nullptr) | |
virtual | ~ScriptObject ()=default |
Virtual destructor which can be overloaded to clean up objects. | |
virtual std::string | getStatusText () |
Gets the status text of this object for debugging purposes. | |
int | getRefCount () const |
Gets the reference count. | |
operator Value () const | |
Cast operator to be able to return this instance as a Value. | |
std::string | getTypeName () const |
Returns the type name Set at the constructor. | |
ScriptObject * | getParent () |
Gets the script object owner. | |
const ScriptObject * | getParent () const |
Gets the script object owner. | |
ScriptObject * | castToObject (const Value &value) |
Casts a sf::Value::vitCustom typed sf::Value to a ScriptObject typed pointer. | |
Protected Member Functions | |
bool | getSetValue (const IdInfo *info, Value *value, Value::vector_type *params, bool flag_set) override |
Gets and sets a value using a returned Info structure. | |
bool | isAlpha (char ch) |
Determines if the passed character is an alpha one. | |
Protected Member Functions inherited from sf::ScriptObject | |
void | makeParent (ScriptObject *so) |
Makes this object the owner of the other object. | |
void | setParent (ScriptObject *parent) |
Sets the owner to the pass script object. | |
Additional Inherited Members | |
Static Public Member Functions inherited from sf::ScriptObject | |
static const IdInfo * | getInfoUnknown () |
Returns the static Info structure for unknowns. | |
static sf::TClassRegistration< ScriptObject, ScriptObject::Parameters > | Interface () |
Simple script engine able.
Errors when compiling a script.
sf::ScriptEngine::ScriptEngine | ( | ) |
Default constructor.
bool sf::ScriptEngine::calculate | ( | const std::string & | script, |
Value & | result | ||
) |
Calculates the passed script.
|
inline |
Gets the error value of this instance.
std::string sf::ScriptEngine::getErrorReason | ( | ) | const |
Gets the associated error reason string.
const char * sf::ScriptEngine::getErrorText | ( | EArithError | error_value = EArithError::aeCurrent | ) | const |
Returns the arithmetic error.
error_value |
|
virtual |
Gets a list of available identifiers.
Used for syntax high lighting for example or code completion.
Reimplemented in sf::ScriptInterpreter.
|
overridevirtual |
Functions to be overloaded in derived classes to add functions, parameters, constants and keywords.
Gets identifier information Can be virtual overloaded in derived class to add function names
Implements sf::ScriptObject.
Reimplemented in sf::ScriptInterpreter.
|
virtual |
Gets names of info structures in lines.
Reimplemented in sf::GiiScriptInterpreter, and sf::ScriptInterpreter.
|
inline |
Gets the current position.
|
overrideprotectedvirtual |
Gets and sets a value using a returned Info structure.
Implements sf::ScriptObject.
Reimplemented in sf::ScriptInterpreter.
|
protected |
Determines if the passed character is an alpha one.
bool sf::ScriptEngine::setError | ( | EArithError | error_value, |
const std::string & | reason = std::string() |
||
) |
Sets the error value for this instance.