Public Member Functions | Static Public Attributes

el7::scripting::bytecode::Instruction Class Reference

#include <Instruction.h>

List of all members.

Public Member Functions

 Instruction (const unsigned long *base)
 Instruction (const unsigned long *base, unsigned offset)
 ~Instruction (void)
 Instruction (const Instruction &rhs)
Instructionoperator= (const Instruction &rhs)
const unsigned long * get_pointer () const
unsigned long get_opcode () const
unsigned get_offset () const
const unsigned long & get_data (unsigned i=0) const
bool is_valid () const
bool is_end () const
unsigned get_length () const
unsigned get_data_length () const
cl7::string_type get_token () const
bool next ()
bool jump (unsigned long offset)

Static Public Attributes

static const unsigned long OC_NOP = 0x00000000
static const unsigned long OC_END = 0xffffffff
static const unsigned long OC_PUSH_ENV = 0x01000002
static const unsigned long OC_POP_ENV = 0x01000004
static const unsigned long OC_PUSH_REGS = 0x02000002
static const unsigned long OC_POP_REGS = 0x02000004
static const unsigned long OC_CLEAR_REGS = 0x02000008
static const unsigned long OC_LOADV = 0x00000010
static const unsigned long OC_LOADF = 0x00000011
static const unsigned long OC_LOADI = 0x00000012
static const unsigned long OC_LOADB = 0x00000013
static const unsigned long OC_LOADC = 0x00000014
static const unsigned long OC_LOADS = 0x00000015
static const unsigned long OC_STORE = 0x00000020
static const unsigned long OC_ADR = 0x00000031
static const unsigned long OC_ADRI = 0x00000032
static const unsigned long OC_GADR = 0x00000033
static const unsigned long OC_GADRI = 0x00000034
static const unsigned long OC_DIR = 0x00000038
static const unsigned long OC_DIRI = 0x00000039
static const unsigned long OC_IND = 0x0000003a
static const unsigned long OC_INDI = 0x0000003b
static const unsigned long OC_TABLE = 0x00000040
static const unsigned long OC_FUNC = 0x00000041
static const unsigned long OC_REF = 0x00000042
static const unsigned long OC_DEREF = 0x00000043
static const unsigned long OC_ADD = 0x00000051
static const unsigned long OC_SUB = 0x00000052
static const unsigned long OC_MUL = 0x00000053
static const unsigned long OC_DIV = 0x00000054
static const unsigned long OC_MOD = 0x00000055
static const unsigned long OC_AND = 0x00000061
static const unsigned long OC_OR = 0x00000062
static const unsigned long OC_XOR = 0x00000063
static const unsigned long OC_CONCAT = 0x00000071
static const unsigned long OC_NEG = 0x00000081
static const unsigned long OC_NOT = 0x00000082
static const unsigned long OC_EQ = 0x00000091
static const unsigned long OC_NEQ = 0x00000092
static const unsigned long OC_LS = 0x00000093
static const unsigned long OC_GR = 0x00000094
static const unsigned long OC_LEQ = 0x00000095
static const unsigned long OC_GEQ = 0x00000096
static const unsigned long OC_JMP = 0x00000101
static const unsigned long OC_JZ = 0x00000102
static const unsigned long OC_JNZ = 0x00000103
static const unsigned long OC_PARAM = 0x00002002
static const unsigned long OC_CALL = 0x00002003
static const unsigned long OC_RET = 0x00002004
static const unsigned long OC_EXTRN = 0x00003001
static const unsigned long OC_TYPEOF = 0x00010001
static const unsigned long OC_CAST = 0x00010002
static const unsigned long OC_ACTYPED = 0x00010011
static const unsigned long OC_ACCONST = 0x00010012
static const unsigned long OC_WHO = 0x00020001
static const unsigned long OC_CLEAR = 0x00020002

Detailed Description

Represents a single instruction within the bytecode to interpret.


Constructor & Destructor Documentation

el7::scripting::bytecode::Instruction::Instruction ( const unsigned long *  base  ) 

Explicit constructor.

el7::scripting::bytecode::Instruction::Instruction ( const unsigned long *  base,
unsigned  offset 
)

Explicit constructor.

el7::scripting::bytecode::Instruction::~Instruction ( void   ) 

Destructor.

el7::scripting::bytecode::Instruction::Instruction ( const Instruction rhs  ) 

Copy constructor.


Member Function Documentation

const unsigned long & el7::scripting::bytecode::Instruction::get_data ( unsigned  i = 0  )  const

Returns the opcode-specific data of this instruction.

unsigned el7::scripting::bytecode::Instruction::get_data_length (  )  const

Calculates and returns the data length in 32-bit-words of the instruction.

unsigned el7::scripting::bytecode::Instruction::get_length (  )  const

Calculates and returns the bytecode length in 32-bit-words of the instruction.

unsigned el7::scripting::bytecode::Instruction::get_offset (  )  const [inline]

Returns the offset of this instruction within the bytecode.

unsigned long el7::scripting::bytecode::Instruction::get_opcode (  )  const [inline]

Returns the opcode of this instruction.

const unsigned long* el7::scripting::bytecode::Instruction::get_pointer (  )  const [inline]

Returns the instruction pointer indicating the bytecode of this instruction.

cl7::string_type el7::scripting::bytecode::Instruction::get_token (  )  const

Returns the instruction token as a string.

bool el7::scripting::bytecode::Instruction::is_end (  )  const

Returns true, if the opcode of this instruction is the "end" opcode.

bool el7::scripting::bytecode::Instruction::is_valid (  )  const

Returns true, if the instruction is ready to execute.

bool el7::scripting::bytecode::Instruction::jump ( unsigned long  offset  ) 

Jumps to the instruction at the given bytecode index position.

bool el7::scripting::bytecode::Instruction::next (  ) 

Proceeds to the next instruction and automatically fetches it.

Instruction & el7::scripting::bytecode::Instruction::operator= ( const Instruction rhs  ) 

Copy assignment operator.


Member Data Documentation

const unsigned long el7::scripting::bytecode::Instruction::OC_ACCONST = 0x00010012 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_ACTYPED = 0x00010011 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_ADD = 0x00000051 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_ADR = 0x00000031 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_ADRI = 0x00000032 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_AND = 0x00000061 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_CALL = 0x00002003 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_CAST = 0x00010002 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_CLEAR = 0x00020002 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_CLEAR_REGS = 0x02000008 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_CONCAT = 0x00000071 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_DEREF = 0x00000043 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_DIR = 0x00000038 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_DIRI = 0x00000039 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_DIV = 0x00000054 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_END = 0xffffffff [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_EQ = 0x00000091 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_EXTRN = 0x00003001 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_FUNC = 0x00000041 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_GADR = 0x00000033 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_GADRI = 0x00000034 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_GEQ = 0x00000096 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_GR = 0x00000094 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_IND = 0x0000003a [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_INDI = 0x0000003b [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_JMP = 0x00000101 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_JNZ = 0x00000103 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_JZ = 0x00000102 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_LEQ = 0x00000095 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_LOADB = 0x00000013 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_LOADC = 0x00000014 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_LOADF = 0x00000011 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_LOADI = 0x00000012 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_LOADS = 0x00000015 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_LOADV = 0x00000010 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_LS = 0x00000093 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_MOD = 0x00000055 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_MUL = 0x00000053 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_NEG = 0x00000081 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_NEQ = 0x00000092 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_NOP = 0x00000000 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_NOT = 0x00000082 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_OR = 0x00000062 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_PARAM = 0x00002002 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_POP_ENV = 0x01000004 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_POP_REGS = 0x02000004 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_PUSH_ENV = 0x01000002 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_PUSH_REGS = 0x02000002 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_REF = 0x00000042 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_RET = 0x00002004 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_STORE = 0x00000020 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_SUB = 0x00000052 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_TABLE = 0x00000040 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_TYPEOF = 0x00010001 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_WHO = 0x00020001 [static]
const unsigned long el7::scripting::bytecode::Instruction::OC_XOR = 0x00000063 [static]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines