Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::GiiScriptInterpreter Class Reference

Script extending and linking the script to the generic information interface elements. More...

#include <GiiScriptInterpreter.h>

Inheritance diagram for sf::GiiScriptInterpreter:
Collaboration diagram for sf::GiiScriptInterpreter:

Public Member Functions

 GiiScriptInterpreter ()=default
 Default constructor.
 
strings getInfoNames () const override
 Overloaded from base class.
 
const IdInfogetInfo (const std::string &name) const override
 Overloaded from base class.
 
- Public Member Functions inherited from sf::ScriptInterpreter
 ScriptInterpreter ()
 Default constructor.
 
 ~ScriptInterpreter () override
 Virtual destructor.
 
ChangeListener::emitter_typegetChangeEmitter ()
 Gets the emitter for change events.
 
std::string getScriptName () const
 Returns the name given by the user.
 
void setScriptName (const std::string &name)
 Sets the name given by the user.
 
void setOutputStream (std::ostream *os)
 Sets and enables debugging output stream.
 
EState Execute (EExecMode exec_mode=emRun)
 Executes a macro depending on the execution mode.
 
bool compile (const char *cmd)
 Compiles the passed script text and outputs debug info to the stream.
 
const char * getStateName (EState exec_state=esCurrent) const
 Gets the execution state name from the passed state or the current one on state 'esCurrent'.
 
EState getState () const
 
std::string getDebugText () const
 
CodePos getErrorPos () const
 
ip_type getInstructionPtr () const
 
ip_type getErrorInstructionPtr () const
 Gets the error instruction pointer in case of an error.
 
std::string getInstructionText (ip_type ip) const
 Gets the instruction text at pointer IP.
 
void flush ()
 Calls the protected virtual clear function.
 
bool callFunction (const std::string &name, bool step_mode)
 
void callFunction (ip_type ip, bool step_mode)
 Makes it possible to execute function/gosub.
 
void setMaxLoopTime (unsigned long usec)
 Sets the maximum loop time for this instance.
 
strings getInfoNames () const override
 Gets names of info structures in lines.
 
const IdInfogetInfo (const std::string &name) const override
 
const TVector< Instruction > & getInstructions () const
 Gets the instruction text at pointer IP.
 
const TVector< VariableInfo * > & getVariables () const
 Gets the current variables declared in the script.
 
strings getIdentifiers (EIdentifier id) const override
 Gets a list of available identifiers.
 
bool isStepMode () const
 Get the step mode of the script.
 
- Public Member Functions inherited from sf::ScriptEngine
 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.
 
- 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.
 
ScriptObjectgetParent ()
 Gets the script object owner.
 
const ScriptObjectgetParent () const
 Gets the script object owner.
 
ScriptObjectcastToObject (const Value &value)
 Casts a sf::Value::vitCustom typed sf::Value to a ScriptObject typed pointer.
 

Protected Member Functions

bool getSetValue (const IdInfo *, Value *value, Value::vector_type *params, bool flag_set) override
 Gets and sets a value using a returned TInfo structure.
 
- Protected Member Functions inherited from sf::ScriptInterpreter
bool getSetValue (const IdInfo *info, Value *value, Value::vector_type *params, bool flag_set) override
 Overridden from ScriptEngine class.
 
virtual bool compileAdditionalStatement (const IdInfo *info, const std::string &source)
 Compile external supplied keyword.
 
virtual void exitFunction (EExitCode exitcode, const Value &value)
 Function is called at the exit of the script.
 
virtual void clear ()
 Clears compiled data can be overloaded by derived classes.
 
virtual void linkInstruction ()
 Links the labels of the calls in the script.
 
void setState (EState exec_state)
 Sets the execution state.
 
ip_type getLabelIp (const std::string &name)
 Gets the ip from the label name.
 
- Protected Member Functions inherited from sf::ScriptEngine
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

- Public Types inherited from sf::ScriptInterpreter
enum  EState {
  esError = 0 , esEmpty , esCompiled , esRunning ,
  esReady , esCurrent
}
 State of the running script. More...
 
enum  EExecMode {
  emInit , emRun , emStart , emStep ,
  emAbort
}
 Enumerate for indicating the mode of execution. More...
 
typedef TListener< const ScriptInterpreter * > ChangeListener
 Declare type for listening and at teh sme time a type for emitting the changes of the script like State and Error and execution pointer.
 
- Public Types inherited from sf::ScriptEngine
enum  EArithError {
  aeCurrent = -1 , aeSuccess = 0 , aeStringTooLong , aeUnexpectedEnd ,
  aeUnexpectedCharacter , aeUnexpectedIdentifier , aeExpectedRightParenthesis , aeExpectedLeftParenthesis ,
  aeExpectedDelimiter , aeExpectedFunction , aeExpectedIdentifier , aeUnknownFunction ,
  aeUnknownConstant , aeUnknownVariable , aeUnknownSymbol , aeUnknownIdentifier ,
  aeUnknownObjectMember , aeAssignConstant , aeMaxIdentifierLength , aeTooManyParameters ,
  aeTooFewParameters , aeMultipleDeclaration , aeUnexpectedKeyword , aeDivisionByZero ,
  aeLabelNotFound , aeIpStack , aeExternalKeyword , aeScriptTimeout ,
  aeFunctionError , aeNotLValue , aeNotObject , aeCompilerImplementationError
}
 Errors when compiling a script. More...
 
- Public Types inherited from sf::ScriptObject
enum  EIdentifier {
  idUnknown = 0 , idConstant , idVariable , idFunction ,
  idTypedef , idKeyword
}
 Keyword identifiers. More...
 
typedef std::string::size_type pos_type
 Source position type.
 
typedef ssize_t ip_type
 Instruction pointer type.
 
- Static Public Member Functions inherited from sf::ScriptObject
static const IdInfogetInfoUnknown ()
 Returns the static Info structure for unknowns.
 
- Protected Types inherited from sf::ScriptInterpreter
enum  EExitCode { ecNormal = 0 , ecError , ecScript , ecApplication }
 Possible exit codes. More...
 
enum  EKeyWord {
  kwNone = 0 , kwIf , kwWhile , kwElse ,
  kwGoto , kwBreak , kwContinue , kwSubroutine ,
  kwReturn , kwExternal , kwExtern
}
 Keywords available for the script. More...
 
- Protected Attributes inherited from sf::ScriptInterpreter
ElapseTimer _loopTimer
 Timer to prevent endless loops.
 
std::ostream * _outputStream {nullptr}
 Output stream to write debug information to.
 

Detailed Description

Script extending and linking the script to the generic information interface elements.

Constructor & Destructor Documentation

◆ GiiScriptInterpreter()

sf::GiiScriptInterpreter::GiiScriptInterpreter ( )
default

Default constructor.

Member Function Documentation

◆ getInfo()

const IdInfo * sf::GiiScriptInterpreter::getInfo ( const std::string &  name) const
overridevirtual

Overloaded from base class.

Implements sf::ScriptObject.

◆ getInfoNames()

strings sf::GiiScriptInterpreter::getInfoNames ( ) const
overridevirtual

Overloaded from base class.

Reimplemented from sf::ScriptEngine.

◆ getSetValue()

bool sf::GiiScriptInterpreter::getSetValue ( const IdInfo ,
Value value,
Value::vector_type params,
bool  flag_set 
)
overrideprotectedvirtual

Gets and sets a value using a returned TInfo structure.

Returns
True if request was answered.

Implements sf::ScriptObject.


The documentation for this class was generated from the following file: