public

Inheritance Graph

graph BT
	Instruction
	click Instruction "classEScript_1_1Instruction"

Description

[ Instruction ] Work in progress!

Classes

   
union EScript::Instruction::value_t

Public Types

   
   
enum type_t {I_ASSIGN_ATTRIBUTE, I_ASSIGN_LOCAL, I_ASSIGN_VARIABLE, I_CALL, I_CREATE_INSTANCE, I_DUP, I_FIND_VARIABLE, I_GET_ATTRIBUTE, I_GET_VARIABLE, I_GET_LOCAL_VARIABLE, I_INIT_CALLER, I_JMP, I_JMP_IF_SET, I_JMP_ON_TRUE, I_JMP_ON_FALSE, I_NOT, I_POP, I_PUSH_BOOL, I_PUSH_ID, I_PUSH_FUNCTION, I_PUSH_NUMBER, I_PUSH_STRING, I_PUSH_UINT, I_PUSH_UNDEFINED, I_PUSH_VOID, I_RESET_LOCAL_VARIABLE, I_SET_ATTRIBUTE, I_SET_EXCEPTION_HANDLER, I_SYS_CALL, I_YIELD, I_UNDEFINED, I_SET_MARKER}

Public Static Attributes

   
   
const uint32_t JMP_TO_MARKER_OFFSET
   
const uint32_t INVALID_JUMP_ADDRESS
if a jump target is >= JMP_TO_MARKER_OFFSET, the target is a marker and not an address.

Public Functions

   
   
std::string toString(const InstructionBlock & ctxt) const
A jump to this address always ends the current function.
   
type_t getType() const
   
uint32_t getValue_uint32() const
   
void setValue_uint32(const uint32_t v)
   
double getValue_Number() const
   
void setValue_Number(double v)
   
StringId getValue_Identifier() const
   
void setValue_Identifier( StringId v)
   
bool getValue_Bool() const
   
void setValue_Bool(bool v)
   
std::pair< uint32_t, uint32_t > getValue_uint32Pair() const
   
void setValue_uint32Pair(uint32_t v1, uint32_t v2)
   
int getLine() const
   
void setLine(const int l)

Public Static Functions

   
   
Instruction createAssignAttribute(const StringId & varName)
   
Instruction createAssignLocal(const uint32_t localVarIdx)
   
Instruction createAssignVariable(const StringId & varName)
   
Instruction createCall(const uint32_t numParams)
   
Instruction createCreateInstance(const uint32_t numParams)
   
Instruction createDup()
   
Instruction createFindVariable(const StringId & id)
   
Instruction createGetAttribute(const StringId & id)
   
Instruction createGetLocalVariable(const uint32_t localVarIdx)
   
Instruction createGetVariable(const StringId & id)
   
Instruction createInitCaller(const uint32_t numSuperParams)
   
Instruction createJmp(const uint32_t markerId)
   
Instruction createJmpIfSet(const uint32_t markerId)
   
Instruction createJmpOnTrue(const uint32_t markerId)
   
Instruction createJmpOnFalse(const uint32_t markerId)
   
Instruction createNot()
   
Instruction createPop()
   
Instruction createPushBool(const bool value)
   
Instruction createPushId(const StringId & id)
   
Instruction createPushFunction(const uint32_t functionIdx)
   
Instruction createPushNumber(const double value)
   
Instruction createPushString(const uint32_t stringIndex)
   
Instruction createPushUInt(const uint32_t value)
   
Instruction createPushUndefined()
   
Instruction createPushVoid()
   
Instruction createResetLocalVariable(const uint32_t localVarIdx)
   
Instruction createSetAttribute(const StringId & id)
   
Instruction createSetExceptionHandler(const uint32_t markerId)
   
Instruction createSetMarker(const uint32_t markerId)
   
Instruction createSysCall(const uint32_t fnIdx, const uint32_t numParams)
   
Instruction createYield()

Documentation

enum
EScript::Instruction::type_t

public
 
 
enum type_t
Enumerator   Description
Enumerator   Description
I_ASSIGN_ATTRIBUTE    
I_ASSIGN_LOCAL    
I_ASSIGN_VARIABLE    
I_CALL    
I_CREATE_INSTANCE    
I_DUP    
I_FIND_VARIABLE    
I_GET_ATTRIBUTE    
I_GET_VARIABLE    
I_GET_LOCAL_VARIABLE    
I_INIT_CALLER    
I_JMP    
I_JMP_IF_SET    
I_JMP_ON_TRUE    
I_JMP_ON_FALSE    
I_NOT    
I_POP    
I_PUSH_BOOL    
I_PUSH_ID    
I_PUSH_FUNCTION    
I_PUSH_NUMBER    
I_PUSH_STRING    
I_PUSH_UINT    
I_PUSH_UNDEFINED    
I_PUSH_VOID    
I_RESET_LOCAL_VARIABLE    
I_SET_ATTRIBUTE    
I_SET_EXCEPTION_HANDLER    
I_SYS_CALL    
I_YIELD    
I_UNDEFINED    
I_SET_MARKER    

Defined in EScript/EScript/Instructions/Instruction.h:24


variable
EScript::Instruction::JMP_TO_MARKER_OFFSET

public static
 
 
const uint32_t JMP_TO_MARKER_OFFSET

Defined in EScript/EScript/Instructions/Instruction.h:58


variable
EScript::Instruction::INVALID_JUMP_ADDRESS

public static
 
 
const uint32_t INVALID_JUMP_ADDRESS

if a jump target is >= JMP_TO_MARKER_OFFSET, the target is a marker and not an address.

Defined in EScript/EScript/Instructions/Instruction.h:59


function
EScript::Instruction::toString

public const
     
     
std::string toString( const InstructionBlock & ctxt ) const

A jump to this address always ends the current function.

Defined in EScript/EScript/Instructions/Instruction.h:61


function
EScript::Instruction::getType

public const inline
   
   
type_t getType( ) const

Defined in EScript/EScript/Instructions/Instruction.h:63


function
EScript::Instruction::getValue_uint32

public const inline
   
   
uint32_t getValue_uint32( ) const

Defined in EScript/EScript/Instructions/Instruction.h:65


function
EScript::Instruction::setValue_uint32

public inline
     
     
void setValue_uint32( const uint32_t v )

Defined in EScript/EScript/Instructions/Instruction.h:66


function
EScript::Instruction::getValue_Number

public const inline
   
   
double getValue_Number( ) const

Defined in EScript/EScript/Instructions/Instruction.h:68


function
EScript::Instruction::setValue_Number

public inline
     
     
void setValue_Number( double v )

Defined in EScript/EScript/Instructions/Instruction.h:69


function
EScript::Instruction::getValue_Identifier

public const inline
   
   
StringId getValue_Identifier( ) const

Defined in EScript/EScript/Instructions/Instruction.h:71


function
EScript::Instruction::setValue_Identifier

public inline
     
     
void setValue_Identifier( StringId v )

Defined in EScript/EScript/Instructions/Instruction.h:72


function
EScript::Instruction::getValue_Bool

public const inline
   
   
bool getValue_Bool( ) const

Defined in EScript/EScript/Instructions/Instruction.h:74


function
EScript::Instruction::setValue_Bool

public inline
     
     
void setValue_Bool( bool v )

Defined in EScript/EScript/Instructions/Instruction.h:75


function
EScript::Instruction::getValue_uint32Pair

public const inline
   
   
std::pair< uint32_t, uint32_t > getValue_uint32Pair( ) const

Defined in EScript/EScript/Instructions/Instruction.h:77


function
EScript::Instruction::setValue_uint32Pair

public inline
     
     
void setValue_uint32Pair( uint32_t v1,
  uint32_t v2
)    

Defined in EScript/EScript/Instructions/Instruction.h:78


function
EScript::Instruction::getLine

public const inline
   
   
int getLine( ) const

Defined in EScript/EScript/Instructions/Instruction.h:112


function
EScript::Instruction::setLine

public inline
     
     
void setLine( const int l )

Defined in EScript/EScript/Instructions/Instruction.h:113


function
EScript::Instruction::createAssignAttribute

public static
     
     
Instruction createAssignAttribute( const StringId & varName )

Defined in EScript/EScript/Instructions/Instruction.h:80


function
EScript::Instruction::createAssignLocal

public static
     
     
Instruction createAssignLocal( const uint32_t localVarIdx )

Defined in EScript/EScript/Instructions/Instruction.h:81


function
EScript::Instruction::createAssignVariable

public static
     
     
Instruction createAssignVariable( const StringId & varName )

Defined in EScript/EScript/Instructions/Instruction.h:82


function
EScript::Instruction::createCall

public static
     
     
Instruction createCall( const uint32_t numParams )

Defined in EScript/EScript/Instructions/Instruction.h:83


function
EScript::Instruction::createCreateInstance

public static
     
     
Instruction createCreateInstance( const uint32_t numParams )

Defined in EScript/EScript/Instructions/Instruction.h:84


function
EScript::Instruction::createDup

public static inline
   
   
Instruction createDup( )

Defined in EScript/EScript/Instructions/Instruction.h:85


function
EScript::Instruction::createFindVariable

public static
     
     
Instruction createFindVariable( const StringId & id )

Defined in EScript/EScript/Instructions/Instruction.h:86


function
EScript::Instruction::createGetAttribute

public static
     
     
Instruction createGetAttribute( const StringId & id )

Defined in EScript/EScript/Instructions/Instruction.h:87


function
EScript::Instruction::createGetLocalVariable

public static
     
     
Instruction createGetLocalVariable( const uint32_t localVarIdx )

Defined in EScript/EScript/Instructions/Instruction.h:88


function
EScript::Instruction::createGetVariable

public static
     
     
Instruction createGetVariable( const StringId & id )

Defined in EScript/EScript/Instructions/Instruction.h:89


function
EScript::Instruction::createInitCaller

public static
     
     
Instruction createInitCaller( const uint32_t numSuperParams )

Defined in EScript/EScript/Instructions/Instruction.h:90


function
EScript::Instruction::createJmp

public static
     
     
Instruction createJmp( const uint32_t markerId )

Defined in EScript/EScript/Instructions/Instruction.h:91


function
EScript::Instruction::createJmpIfSet

public static
     
     
Instruction createJmpIfSet( const uint32_t markerId )

Defined in EScript/EScript/Instructions/Instruction.h:92


function
EScript::Instruction::createJmpOnTrue

public static
     
     
Instruction createJmpOnTrue( const uint32_t markerId )

Defined in EScript/EScript/Instructions/Instruction.h:93


function
EScript::Instruction::createJmpOnFalse

public static
     
     
Instruction createJmpOnFalse( const uint32_t markerId )

Defined in EScript/EScript/Instructions/Instruction.h:94


function
EScript::Instruction::createNot

public static inline
   
   
Instruction createNot( )

Defined in EScript/EScript/Instructions/Instruction.h:95


function
EScript::Instruction::createPop

public static inline
   
   
Instruction createPop( )

Defined in EScript/EScript/Instructions/Instruction.h:96


function
EScript::Instruction::createPushBool

public static
     
     
Instruction createPushBool( const bool value )

Defined in EScript/EScript/Instructions/Instruction.h:97


function
EScript::Instruction::createPushId

public static
     
     
Instruction createPushId( const StringId & id )

Defined in EScript/EScript/Instructions/Instruction.h:98


function
EScript::Instruction::createPushFunction

public static
     
     
Instruction createPushFunction( const uint32_t functionIdx )

Defined in EScript/EScript/Instructions/Instruction.h:99


function
EScript::Instruction::createPushNumber

public static
     
     
Instruction createPushNumber( const double value )

Defined in EScript/EScript/Instructions/Instruction.h:100


function
EScript::Instruction::createPushString

public static
     
     
Instruction createPushString( const uint32_t stringIndex )

Defined in EScript/EScript/Instructions/Instruction.h:101


function
EScript::Instruction::createPushUInt

public static
     
     
Instruction createPushUInt( const uint32_t value )

Defined in EScript/EScript/Instructions/Instruction.h:102


function
EScript::Instruction::createPushUndefined

public static inline
   
   
Instruction createPushUndefined( )

Defined in EScript/EScript/Instructions/Instruction.h:103


function
EScript::Instruction::createPushVoid

public static inline
   
   
Instruction createPushVoid( )

Defined in EScript/EScript/Instructions/Instruction.h:104


function
EScript::Instruction::createResetLocalVariable

public static
     
     
Instruction createResetLocalVariable( const uint32_t localVarIdx )

Defined in EScript/EScript/Instructions/Instruction.h:105


function
EScript::Instruction::createSetAttribute

public static
     
     
Instruction createSetAttribute( const StringId & id )

Defined in EScript/EScript/Instructions/Instruction.h:106


function
EScript::Instruction::createSetExceptionHandler

public static
     
     
Instruction createSetExceptionHandler( const uint32_t markerId )

Defined in EScript/EScript/Instructions/Instruction.h:107


function
EScript::Instruction::createSetMarker

public static
     
     
Instruction createSetMarker( const uint32_t markerId )

Defined in EScript/EScript/Instructions/Instruction.h:108


function
EScript::Instruction::createSysCall

public static
     
     
Instruction createSysCall( const uint32_t fnIdx,
  const uint32_t numParams
)    

Defined in EScript/EScript/Instructions/Instruction.h:109


function
EScript::Instruction::createYield

public static inline
   
   
Instruction createYield( )

Defined in EScript/EScript/Instructions/Instruction.h:110