annotate Bison-Flex/Compiler-StackBase/UTF8/vm_code.h @ 5:caede627f691

chage encoding
author nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 17 May 2011 12:45:07 +0900
parents 805d39d28230
children 86c0a38332fe
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 //
5
caede627f691 chage encoding
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
2 // 仮想CPUの命令コード割り当て
4
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 //
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 // (c)2008 Chihiro.SAKAMOTO HyperWorks
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 //
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 #ifdef VM_ENUMDEF
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 #define VMCODE0(code_, name_) code_,
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 #define VMCODE1(code_, name_) code_,
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 #endif
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 #ifdef VM_CREATE
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 #define VMCODE0(code_, name_) void name_() { statement.push_back(CVMCode(code_)); }
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 #define VMCODE1(code_, name_) void name_(int arg1) { statement.push_back(CVMCode(code_, arg1)); }
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 #endif
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 #ifdef VM_SWITCHTABLE
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 #define VMCODE0(code_, name_) case code_: name_(); break;
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 #define VMCODE1(code_, name_) case code_: name_(value()); break;
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 #endif
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 #ifdef VM_NAMETABLE
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 #define VMCODE0(code_, name_) #name_,
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 #define VMCODE1(code_, name_) #name_,
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 #endif
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 VMCODE1(VM_PUSHCONST, PushConst)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 VMCODE1(VM_PUSHSTRING, PushString)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 VMCODE1(VM_PUSHVALUE, PushValue)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 VMCODE1(VM_PUSHLOCAL, PushLocal)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 VMCODE1(VM_PUSHARRAY, PushArray)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 VMCODE1(VM_PUSHLOCALARRAY, PushLocalArray)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 VMCODE1(VM_PUSHLOCALREF, PushLocalRef)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 VMCODE1(VM_PUSHLOCALARRAYREF, PushLocalArrayRef)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 VMCODE1(VM_PUSHADDR, PushAddr)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 VMCODE1(VM_PUSHARRAYADDR, PushArrayAddr)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 VMCODE1(VM_POPVALUE, PopValue)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 VMCODE1(VM_POPLOCAL, PopLocal)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 VMCODE1(VM_POPARRAY, PopArray)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 VMCODE1(VM_POPLOCALARRAY, PopLocalArray)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 VMCODE1(VM_POPLOCALREF, PopLocalRef)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 VMCODE1(VM_POPLOCALARRAYREF, PopLocalArrayRef)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 VMCODE1(VM_ALLOCSTACK, OpAllocStack)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 VMCODE0(VM_POP, OpPop)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 VMCODE0(VM_NEG, OpNeg)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 VMCODE0(VM_EQ, OpEq)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 VMCODE0(VM_NE, OpNe)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 VMCODE0(VM_GT, OpGt)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 VMCODE0(VM_GE, OpGe)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 VMCODE0(VM_LT, OpLt)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 VMCODE0(VM_LE, OpLe)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 VMCODE0(VM_LOGAND, OpLogAnd)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 VMCODE0(VM_LOGOR, OpLogOr)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 VMCODE0(VM_AND, OpAnd)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 VMCODE0(VM_OR, OpOr)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 VMCODE0(VM_LSHIFT, OpLeftShift)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 VMCODE0(VM_RSHIFT, OpRightShift)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 VMCODE0(VM_ADD, OpAdd)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 VMCODE0(VM_SUB, OpSub)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 VMCODE0(VM_MUL, OpMul)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 VMCODE0(VM_DIV, OpDiv)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 VMCODE0(VM_MOD, OpMod)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 VMCODE0(VM_STREQ, OpStrEq)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 VMCODE0(VM_STRNE, OpStrNe)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 VMCODE0(VM_STRGT, OpStrGt)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 VMCODE0(VM_STRGE, OpStrGe)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 VMCODE0(VM_STRLT, OpStrLt)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 VMCODE0(VM_STRLE, OpStrLe)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 VMCODE0(VM_STRADD, OpStrAdd)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 VMCODE1(VM_JMP, OpJmp)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 VMCODE1(VM_JMPC, OpJmpC)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 VMCODE1(VM_JMPNC, OpJmpNC)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 VMCODE1(VM_TEST, OpTest)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 VMCODE1(VM_CALL, OpCall)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 VMCODE1(VM_SYSCALL, OpSysCall)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 VMCODE0(VM_RETURN, OpReturn)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 VMCODE0(VM_RETURNV, OpReturnV)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 VMCODE0(VM_HALT, OpHalt)
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 #undef VMCODE0
805d39d28230 add Compiler-stackbase
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 #undef VMCODE1