Yate
ScriptCode Class Referenceabstract

Script parsed code. More...

#include <yatescript.h>

Inheritance diagram for ScriptCode:
RefObject GenObject

Public Member Functions

virtual bool initialize (ScriptContext *context) const =0
 
virtual bool evaluate (ScriptRun &runner, ObjList &results) const =0
 
virtual ScriptRuncreateRunner (ScriptContext *context, const char *title=0)
 
virtual void getFileLine (unsigned int line, String &fileName, unsigned int &fileLine, bool wholePath=true)
 
- Public Member Functions inherited from RefObject
 RefObject ()
 
virtual ~RefObject ()
 
virtual void * getObject (const String &name) const
 
virtual bool alive () const
 
bool ref ()
 
bool deref ()
 
int refcount () const
 
virtual void destruct ()
 
- Public Member Functions inherited from GenObject
 GenObject ()
 
virtual ~GenObject ()
 
virtual const StringtoString () const
 
virtual const StringtraceId () const
 
NamedCountergetObjCounter () const
 
NamedCountersetObjCounter (NamedCounter *counter)
 

Additional Inherited Members

- Static Public Member Functions inherited from RefObject
static bool alive (const RefObject *obj)
 
static bool efficientIncDec ()
 
- Static Public Member Functions inherited from GenObject
static void * getObject (const String &name, const GenObject *obj)
 
static bool getObjCounting ()
 
static void setObjCounting (bool enable)
 
static NamedCountergetObjCounter (const String &name, bool create=true)
 
static ObjListgetObjCounters ()
 
- Protected Member Functions inherited from RefObject
virtual void zeroRefs ()
 
bool resurrect ()
 
virtual void destroyed ()
 

Detailed Description

Script parsed code.

Preparsed script code fragment ready to be executed

Member Function Documentation

◆ createRunner()

virtual ScriptRun * createRunner ( ScriptContext * context,
const char * title = 0 )
inlinevirtual

Create a runner adequate for this block of parsed code

Parameters
contextScript context, must not be NULL
titleAn optional name for the runner
Returns
A new script runner, NULL if context is NULL or feature is not supported

◆ evaluate()

virtual bool evaluate ( ScriptRun & runner,
ObjList & results ) const
pure virtual

Evaluation of a single code expression

Parameters
runnerReference to the runtime to use in evaluation
resultsList to fill with expression results

◆ getFileLine()

virtual void getFileLine ( unsigned int line,
String & fileName,
unsigned int & fileLine,
bool wholePath = true )
inlinevirtual

Get the file name and the file line from which this code line was interpreted

Parameters
lineCode line
fileNameOn output, it contains the file name associated with code line
fileLineOn output, it contains the file line associated with code line
wholePathIf true, file name contains the whole file path, otherwise just the filename

◆ initialize()

virtual bool initialize ( ScriptContext * context) const
pure virtual

Context initializer for language specific globals

Parameters
contextPointer to the context to initialize
Returns
True if context was properly populated with globals

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