35 #ifndef _DATABASE_VIRTUAL_MACHINE_INSTRUCTION_SET_HPP_INCLUDED
36 #define _DATABASE_VIRTUAL_MACHINE_INSTRUCTION_SET_HPP_INCLUDED
42 #include <boost/cstdint.hpp>
129 static const char* ar[] = {
145 "OUTPUT_CLOSE_ARRAY",
152 "SELECT_LAST_RESULT",
153 "SELECT_KEPT_RESULT",
155 "OPEN_ITER_LAST_RESULT",
156 "OPEN_ITER_KEPT_RESULT",
158 "OPEN_ITER_TUPLESET",
177 "DBSTM_BIND_LOOPCNT",
178 "DBSTM_BIND_SEL_IDX",
179 "DBSTM_BIND_SEL_NAM",
180 "DBSTM_BIND_ITR_IDX",
181 "DBSTM_BIND_ITR_NAM",
186 "RESULT_CONSTRAINT_UNIQUE",
187 "RESULT_CONSTRAINT_NONEMPTY",
216 static const char* ar[] =
226 "SubroutineSignature",
315 static const char* ar[] =
338 if ((
unsigned int)cond >
Max_CondCode)
throw std::runtime_error(
"VM instruction condition code out of range");
340 if ((
unsigned int)opcode >
Max_OpCode)
throw std::runtime_error(
"VM instruction opcode out of range");
342 if (arg >
Max_ArgumentIndex)
throw std::runtime_error(
"VM instruction parameter reference out of range");
370 std::vector<Instruction>::const_iterator pi = prg.begin(), pe = prg.end();
371 unsigned int adr = 0;
372 for (; pi != pe; ++pi,++adr)
391 std::ostringstream out;
Definition: instructionSet.hpp:77
Definition: instructionSet.hpp:413
Definition: instructionSet.hpp:409
Definition: instructionSet.hpp:95
Definition: instructionSet.hpp:89
Definition: instructionSet.hpp:307
Definition: instructionSet.hpp:101
Definition: instructionSet.hpp:206
Definition: instructionSet.hpp:82
Definition: instructionSet.hpp:105
Definition: instructionSet.hpp:209
Definition: instructionSet.hpp:83
Definition: instructionSet.hpp:94
Definition: instructionSet.hpp:67
Definition: instructionSet.hpp:111
Definition: instructionSet.hpp:115
Definition: instructionSet.hpp:97
Definition: instructionSet.hpp:407
Definition: instructionSet.hpp:112
Definition: instructionSet.hpp:308
Definition: instructionSet.hpp:58
Definition: instructionSet.hpp:80
Definition: instructionSet.hpp:108
Definition: instructionSet.hpp:60
static Instruction instruction(OpCode opcode, unsigned int arg=0)
Build an instruction from its parts (no condition -> always executed)
Definition: instructionSet.hpp:350
Definition: instructionSet.hpp:415
static void printProgramRaw(std::ostream &out, const std::vector< Instruction > &prg)
Print the program code without any symbolic information that is not available here.
Definition: instructionSet.hpp:368
CondCode
Enumeration of conditional codes.
Definition: instructionSet.hpp:305
Definition: instructionSet.hpp:88
boost::uint32_t Address
Address in program code.
Definition: instructionSet.hpp:326
boost::uint32_t Instruction
Instruction.
Definition: instructionSet.hpp:328
Definition: instructionSet.hpp:200
Definition: instructionSet.hpp:421
Definition: instructionSet.hpp:69
Definition: instructionSet.hpp:110
Definition: instructionSet.hpp:208
Definition: instructionSet.hpp:203
boost::uint32_t ArgumentIndex
Index of an argument.
Definition: instructionSet.hpp:324
static std::string instructionstr(const Instruction &instr)
Get the instruction as string.
Definition: instructionSet.hpp:389
Definition: instructionSet.hpp:59
ArgumentType
Enumeration of argument types.
Definition: instructionSet.hpp:196
static Instruction instruction(CondCode cond, OpCode opcode, unsigned int arg=0)
Build an instruction from its parts.
Definition: instructionSet.hpp:335
Definition: instructionSet.hpp:93
Definition: instructionSet.hpp:100
Definition: instructionSet.hpp:409
Definition: instructionSet.hpp:198
Definition: instructionSet.hpp:205
Definition: instructionSet.hpp:70
Definition: instructionSet.hpp:71
static const char * opCodeName(OpCode i)
Definition: instructionSet.hpp:127
Definition: instructionSet.hpp:309
Definition: instructionSet.hpp:113
Definition: instructionSet.hpp:201
Definition: instructionSet.hpp:125
Definition: instructionSet.hpp:75
Definition: instructionSet.hpp:104
Definition: instructionSet.hpp:414
Definition: instructionSet.hpp:65
Definition: instructionSet.hpp:419
Definition: instructionSet.hpp:407
Definition: instructionSet.hpp:87
Definition: instructionSet.hpp:202
Definition: instructionSet.hpp:408
Definition: instructionSet.hpp:64
static CondCode condCode(const Instruction &instr)
Get the condition code of an instruction (defining on which condition the instruction is executed) ...
Definition: instructionSet.hpp:357
static ArgumentIndex argumentIndex(const Instruction &instr)
Get the argument index of the instruction (addressing the argument depending on the argument type of ...
Definition: instructionSet.hpp:363
Definition: instructionSet.hpp:116
Definition: instructionSet.hpp:98
Definition: instructionSet.hpp:81
Definition: instructionSet.hpp:96
Enumeration of instructions for the transaction VM with some static functions on them.
Definition: instructionSet.hpp:50
Definition: instructionSet.hpp:120
Definition: instructionSet.hpp:68
Definition: instructionSet.hpp:66
Definition: instructionSet.hpp:63
Definition: instructionSet.hpp:72
static ArgumentType argumentType(OpCode i)
get the argument type of an operation
Definition: instructionSet.hpp:235
Definition: instructionSet.hpp:90
Definition: instructionSet.hpp:76
static const char * condCodeName(CondCode i)
Get the name of a conditional code.
Definition: instructionSet.hpp:313
static OpCode opCode(const Instruction &instr)
Get the operation code of an instruction (defining what is done on execution)
Definition: instructionSet.hpp:360
Definition: instructionSet.hpp:210
Definition: instructionSet.hpp:204
Definition: instructionSet.hpp:114
OpCode
Implemented operation codes of the VM.
Definition: instructionSet.hpp:55
Definition: instructionSet.hpp:86
Definition: instructionSet.hpp:99
Definition: instructionSet.hpp:117
Definition: instructionSet.hpp:420
Definition: instructionSet.hpp:121
Definition: instructionSet.hpp:74
Definition: instructionSet.hpp:109
Definition: instructionSet.hpp:122
Definition: instructionSet.hpp:199
static const char * argumentTypeName(ArgumentType i)
Get the name of an argument type.
Definition: instructionSet.hpp:214
Definition: instructionSet.hpp:207
Definition: instructionSet.hpp:408
Definition: instructionSet.hpp:73