The structure for the program code as array of instructions. More...
#include <programCode.hpp>
Public Types | |
typedef InstructionSet::Instruction | Instruction |
typedef InstructionSet::CondCode | CondCode |
typedef InstructionSet::OpCode | OpCode |
typedef InstructionSet::Address | Address |
typedef std::vector < Instruction > ::const_iterator | const_iterator |
typedef std::vector < Instruction >::iterator | iterator |
Public Member Functions | |
ProgramCode () | |
Default constructor. More... | |
ProgramCode (const ProgramCode &o) | |
Copy constructor. More... | |
void | add (const Instruction &instr) |
Add one instruction. More... | |
Instruction & | operator[] (const Address &adr) |
Get an instruction reference by address (instruction index starting with 0) More... | |
const Instruction & | operator[] (const Address &adr) const |
Get an instruction const reference by address (instruction index starting with 0) More... | |
Address | size () const |
Get size of the program code in instructions. More... | |
ProgramCode & | operator() (CondCode cond, OpCode opcode, unsigned int arg=0) |
More readable program instruction definition operator. More... | |
ProgramCode & | operator() (OpCode opcode, unsigned int arg=0) |
More readable program instruction definition operator (no condition -> always executed) More... | |
void | append (const ProgramCode &prg) |
Append the code of another program without joining argument sets. More... | |
Instruction | get (Address &ip) const |
Get the Instruction by address (instruction pointer) More... | |
const_iterator | begin () const |
Get the program start iterator. More... | |
const_iterator | end () const |
Get the program end iterator. More... | |
iterator | begin () |
Get the program start iterator. More... | |
iterator | end () |
Get the program end iterator. More... | |
const_iterator | at (const Address &adr) const |
Get an iterator by address (instruction pointer) More... | |
iterator | at (const Address &adr) |
Get an iterator by address (instruction pointer) More... | |
void | printRaw (std::ostream &out) const |
Print the program code without any symbolic information that is not available here. More... | |
Private Attributes | |
std::vector< Instruction > | m_ar |
The structure for the program code as array of instructions.
typedef std::vector<Instruction>::const_iterator _Wolframe::db::vm::ProgramCode::const_iterator |
typedef std::vector<Instruction>::iterator _Wolframe::db::vm::ProgramCode::iterator |
|
inline |
Default constructor.
|
inline |
Copy constructor.
|
inline |
Add one instruction.
param[in] instr instruction to add
|
inline |
Append the code of another program without joining argument sets.
param[in] prg program code to append
|
inline |
Get an iterator by address (instruction pointer)
Get an iterator by address (instruction pointer)
|
inline |
Get the program start iterator.
|
inline |
Get the program start iterator.
|
inline |
Get the program end iterator.
|
inline |
Get the program end iterator.
|
inline |
Get the Instruction by address (instruction pointer)
param[in] ip instruction pointer
|
inline |
More readable program instruction definition operator.
param[in] cond conditional code (condition for execution) param[in] opcode instruction operation code param[in] arg operation argument
|
inline |
More readable program instruction definition operator (no condition -> always executed)
param[in] opcode instruction operation code param[in] arg operation argument
|
inline |
Get an instruction reference by address (instruction index starting with 0)
param[in] adr instruction address
|
inline |
Get an instruction const reference by address (instruction index starting with 0)
param[in] adr instruction address
|
inline |
Print the program code without any symbolic information that is not available here.
|
inline |
Get size of the program code in instructions.
|
private |
Copyright © 2014 - Project Wolframe - All Rights Reserved