Mercurial > hg > Members > nobuyasu > SampleSource
comparison boost-spirit/Compiler-boost-spirit/EUC/vm_code.h @ 0:db40c85cad7a default tip
upload sample source
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 09 May 2011 03:11:59 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:db40c85cad7a |
---|---|
1 #ifdef VM_ENUMDEF | |
2 #define VMCODE0(code_, name_) code_, | |
3 #define VMCODE1(code_, name_) code_, | |
4 #endif | |
5 #ifdef VM_CREATE | |
6 #define VMCODE0(code_, name_) void name_() { statement.push_back(CVMCode(code_)); } | |
7 #define VMCODE1(code_, name_) void name_(int arg1) { statement.push_back(CVMCode(code_, arg1)); } | |
8 #endif | |
9 #ifdef VM_SWITCHTABLE | |
10 #define VMCODE0(code_, name_) case code_: name_(); break; | |
11 #define VMCODE1(code_, name_) case code_: name_(value()); break; | |
12 #endif | |
13 #ifdef VM_NAMETABLE | |
14 #define VMCODE0(code_, name_) #name_, | |
15 #define VMCODE1(code_, name_) #name_, | |
16 #endif | |
17 | |
18 VMCODE1(VM_PUSHCONST, PushConst) | |
19 VMCODE1(VM_PUSHSTRING, PushString) | |
20 VMCODE1(VM_PUSHVALUE, PushValue) | |
21 VMCODE1(VM_PUSHLOCAL, PushLocal) | |
22 VMCODE1(VM_PUSHARRAY, PushArray) | |
23 VMCODE1(VM_PUSHLOCALARRAY, PushLocalArray) | |
24 VMCODE1(VM_PUSHLOCALREF, PushLocalRef) | |
25 VMCODE1(VM_PUSHLOCALARRAYREF, PushLocalArrayRef) | |
26 VMCODE1(VM_PUSHADDR, PushAddr) | |
27 VMCODE1(VM_PUSHARRAYADDR, PushArrayAddr) | |
28 VMCODE1(VM_POPVALUE, PopValue) | |
29 VMCODE1(VM_POPLOCAL, PopLocal) | |
30 VMCODE1(VM_POPARRAY, PopArray) | |
31 VMCODE1(VM_POPLOCALARRAY, PopLocalArray) | |
32 VMCODE1(VM_POPLOCALREF, PopLocalRef) | |
33 VMCODE1(VM_POPLOCALARRAYREF, PopLocalArrayRef) | |
34 VMCODE1(VM_ALLOCSTACK, OpAllocStack) | |
35 VMCODE0(VM_POP, OpPop) | |
36 VMCODE0(VM_NEG, OpNeg) | |
37 VMCODE0(VM_EQ, OpEq) | |
38 VMCODE0(VM_NE, OpNe) | |
39 VMCODE0(VM_GT, OpGt) | |
40 VMCODE0(VM_GE, OpGe) | |
41 VMCODE0(VM_LT, OpLt) | |
42 VMCODE0(VM_LE, OpLe) | |
43 VMCODE0(VM_LOGAND, OpLogAnd) | |
44 VMCODE0(VM_LOGOR, OpLogOr) | |
45 VMCODE0(VM_AND, OpAnd) | |
46 VMCODE0(VM_OR, OpOr) | |
47 VMCODE0(VM_LSHIFT, OpLeftShift) | |
48 VMCODE0(VM_RSHIFT, OpRightShift) | |
49 VMCODE0(VM_ADD, OpAdd) | |
50 VMCODE0(VM_SUB, OpSub) | |
51 VMCODE0(VM_MUL, OpMul) | |
52 VMCODE0(VM_DIV, OpDiv) | |
53 VMCODE0(VM_MOD, OpMod) | |
54 VMCODE0(VM_STREQ, OpStrEq) | |
55 VMCODE0(VM_STRNE, OpStrNe) | |
56 VMCODE0(VM_STRGT, OpStrGt) | |
57 VMCODE0(VM_STRGE, OpStrGe) | |
58 VMCODE0(VM_STRLT, OpStrLt) | |
59 VMCODE0(VM_STRLE, OpStrLe) | |
60 VMCODE0(VM_STRADD, OpStrAdd) | |
61 VMCODE1(VM_JMP, OpJmp) | |
62 VMCODE1(VM_JMPC, OpJmpC) | |
63 VMCODE1(VM_JMPNC, OpJmpNC) | |
64 VMCODE1(VM_TEST, OpTest) | |
65 VMCODE1(VM_CALL, OpCall) | |
66 VMCODE1(VM_SYSCALL, OpSysCall) | |
67 VMCODE0(VM_RETURN, OpReturn) | |
68 VMCODE0(VM_RETURNV, OpReturnV) | |
69 VMCODE0(VM_HALT, OpHalt) | |
70 | |
71 #undef VMCODE0 | |
72 #undef VMCODE1 |