96 aeCompilerImplementationError
148 [[nodiscard]]
const IdInfo*
getInfo(
const std::string& name)
const override;
174 void destroyObject(
bool& should_delete)
override
176 should_delete =
false;
189 void Clear(ScriptObject*
object)
195 explicit operator bool()
const
197 return _info && _object;
200 const IdInfo* _info{
nullptr};
202 ScriptObject* _object{
nullptr};
213 void getNumber(Value& d);
218 bool getName(std::string& name);
223 bool getParameter(Value& result);
228 bool arith(Value& result, DataCode& left);
233 bool partial(Value& result);
239 bool operator_(Value& result, DataCode& left);
252 EArithError _errorValue{aeSuccess};
256 std::string _errorReason;
260 static IdInfo _idInfo[];
Simple script engine able.
Definition ScriptEngine.h:14
virtual strings getInfoNames() const
Gets names of info structures in lines.
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
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.
virtual strings getIdentifiers(EIdentifier id) const
Gets a list of available identifiers.
EArithError getError() const
Gets the error value of this instance.
Definition ScriptEngine.h:107
EArithError
Errors when compiling a script.
Definition ScriptEngine.h:25
@ aeNotObject
Definition ScriptEngine.h:93
@ aeUnexpectedEnd
Definition ScriptEngine.h:34
@ aeExpectedRightParenthesis
Definition ScriptEngine.h:41
@ aeScriptTimeout
Definition ScriptEngine.h:87
@ aeExpectedIdentifier
Definition ScriptEngine.h:49
@ aeExpectedDelimiter
Definition ScriptEngine.h:45
@ aeMaxIdentifierLength
Definition ScriptEngine.h:67
@ aeNotLValue
Definition ScriptEngine.h:91
@ aeUnknownObjectMember
Definition ScriptEngine.h:62
@ aeLabelNotFound
Definition ScriptEngine.h:81
@ aeExpectedLeftParenthesis
Definition ScriptEngine.h:43
@ aeExpectedFunction
Definition ScriptEngine.h:47
@ aeIpStack
Definition ScriptEngine.h:83
@ aeTooManyParameters
Definition ScriptEngine.h:70
@ aeUnknownConstant
Definition ScriptEngine.h:54
@ aeUnknownSymbol
Definition ScriptEngine.h:58
@ aeTooFewParameters
Definition ScriptEngine.h:72
@ aeAssignConstant
Definition ScriptEngine.h:65
@ aeUnknownVariable
Definition ScriptEngine.h:56
@ aeDivisionByZero
Definition ScriptEngine.h:79
@ aeFunctionError
Definition ScriptEngine.h:89
@ aeStringTooLong
Definition ScriptEngine.h:31
@ aeUnknownFunction
Definition ScriptEngine.h:52
@ aeMultipleDeclaration
Definition ScriptEngine.h:75
@ aeUnexpectedIdentifier
Definition ScriptEngine.h:38
@ aeUnknownIdentifier
Definition ScriptEngine.h:60
@ aeUnexpectedKeyword
Definition ScriptEngine.h:77
@ aeExternalKeyword
Definition ScriptEngine.h:85
@ aeUnexpectedCharacter
Definition ScriptEngine.h:36
std::string getErrorReason() const
Gets the associated error reason string.
const IdInfo * getInfo(const std::string &name) const override
Functions to be overloaded in derived classes to add functions, parameters, constants and keywords.
pos_type getPos() const
Gets the current position.
Definition ScriptEngine.h:132
ScriptEngine()
Default constructor.
bool calculate(const std::string &script, Value &result)
Calculates the passed script.
Info structure for objects used in scripts.
Definition ScriptObject.h:15
EIdentifier
Keyword identifiers.
Definition ScriptObject.h:42
std::string::size_type pos_type
Source position type.
Definition ScriptObject.h:33
Counted vector of strings.
Definition TStrings.h:13
Counted vector having additional methods and operators for ease of usage.
Definition TVector.h:28
Value container class able to performing arithmetic functions.
Definition Value.h:19
double flt_type
Type used internally for storing floating point value.
Definition Value.h:28
#define _MISC_FUNC
Definition misc/global.h:34
#define _MISC_CLASS
Definition misc/global.h:35
Definition CodeEditor.h:8
Value calculator(const std::string &script, const Value &def)
Calculator function that converts a formula of the passed string to a #sf::Value.
Used to create static lookup lists.
Definition ScriptObject.h:61