-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopcode.h
157 lines (148 loc) · 4.92 KB
/
opcode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
// opcode.h
// FireFly server runtime op-codes
#ifndef FIREFLY_OPCODE_H
#define FIREFLY_OPCODE_H
// Basic opcodes
#define OP_NULL 0
#define OP_ASSIGN 1
#define OP_ADD 2
#define OP_SUB 3
#define OP_MUL 4
#define OP_DIV 5
#define OP_MOD 6
#define OP_AND 7
#define OP_OR 8
#define OP_XOR 9
#define OP_SHR 10
#define OP_SHL 11
#define OP_POW 12
#define OP_EQ 13
#define OP_NEQ 14
#define OP_GT 15
#define OP_LT 16
#define OP_GE 17
#define OP_LE 18
#define OP_IF 19
#define OP_IFZ 20
#define OP_GOTO 21
#define OP_RETURN 22
#define OP_EXIT 23
#define OP_DELETE 24
#define OP_INVOKE 25
#define OP_THREAD 26
#define OP_RANGE 27
#define OP_ARRAY 30
#define OP_MAPPING 31
#define OP_INDEX 32
#define OP_CATCH 33
#define OP_FOREACH 37
#define OP_THIS 38
#define OP_ACCESS 39
#define OP_LOOKUP 40
#define OP_NOT 41
#define OP_BITNOT 42
#define OP_NEG 43
#define OP_CONST 44
#define OP_SETNULL 45
#define OP_NEXTEACH 46
#define OP_SWITCH 47
#define OP_NEW_OBJECT 48
#define OP_NEW_ARRAY 49
#define OP_NEW_MAPPING 50
#define OP_COPY 51
// Predefined functions
#define PF_VERSION 52
#define PF_SLEEP 53
#define PF_SIZEOF 54
#define PF_TRIM 55
#define PF_LTRIM 56
#define PF_RTRIM 57
#define PF_LOWER 58
#define PF_UPPER 59
#define PF_CAPITALISE 60
#define PF_TO_STR 61
#define PF_TO_INT 62
#define PF_TO_FLOAT 63
#define PF_SEARCH 64
#define PF_REVERSE 65
#define PF_KEYS 66
#define PF_VALUES 67
#define PF_OWNER 68
#define PF_ACCESS 69
#define PF_DEF_ACCESS 70
#define PF_SET_OWNER 71
#define PF_SET_ACCESS 72
#define PF_SET_DEF_ACCESS 73
#define PF_PARSE 74
#define PF_ENCODE 75
#define PF_FUNCTION_NAME 76
#define PF_LISTEN 77
#define PF_ACCEPT 78
#define PF_WRITE 79
#define PF_READ 80
#define PF_READLN 81
#define PF_CLOSE 82
#define PF_CONNECT 83
#define PF_PORT_OPEN 84
#define PF_ADD_INHERIT 85
#define PF_REMOVE_INHERIT 86
#define PF_INHERITS 87
#define PF_INHERIT_LIST 88
#define PF_KILL_THREAD 89
#define PF_EXIT_VALUE 90
#define PF_THREAD_STOPPED 91
#define PF_THREAD_BLOCKED 92
#define PF_UNDEFINEDP 93
#define PF_NULLP 94
#define PF_INTEGERP 95
#define PF_REALP 96
#define PF_NUMBERP 97
#define PF_RANGEP 98
#define PF_STRINGP 99
#define PF_ARRAYP 100
#define PF_MAPPINGP 101
#define PF_OBJECTP 102
#define PF_FUNCTIONP 103
#define PF_PORTP 104
#define PF_THREADP 105
#define PF_COPY 106
#define PF_DEEP_COPY 107
#define PF_PARENT 108
#define PF_REMOVE 109
#define PF_SHUTDOWN 110
#define PF_RANDOM 111
#define PF_FUNCTION_CONTEXT 112
#define PF_REPLACE 113
#define PF_EXISTS 114
#define PF_CONSOLE 115
#define PF_WRITE_TEXT 116
#define PF_SPLIT 117
#define PF_JOIN 118
#define PF_OBJECT_PATH 119
#define PF_FIND_OBJECT 120
#define PF_UNIQUE_NAME 121
#define PF_TOKEN 122
#define PF_SKIP 123
#define PF_RSEARCH 124
#define OP_SETROOT 125
#define PF_CRYPT 126
#define PF_DELETEDP 128
#define PF_CLONEP 129
#define PF_CHILDP 130
#define PF_TIME 131
#define PF_CTIME 132
#define PF_STRFTIME 133
#define PF_LOCALTIME 134
#define PF_UTCTIME 135
#define PF_THREAD_LIST 136
#define PF_THREAD_STACK 137
#define PF_THREAD_FUNCTION 138
#define PF_THREAD_STATE 139
#define PF_YIELD 140
#define PF_MOVE_OBJECT 141
#define PF_OBJECT_NAME 142
#define PF_SKIPTO 143
#define PF_APPEND 144
#define PF_SLICE 145
#define NUM_OPCODES 146
#endif // FIREFLY_OPCODE_H