potion
0.2
Main Page
Related Pages
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
opcodes.h
Go to the documentation of this file.
1
6
#ifndef POTION_OPCODES_H
7
#define POTION_OPCODES_H
8
9
enum
PN_OPCODE
{
10
OP_NONE
,
11
OP_MOVE
,
12
OP_LOADK
,
13
OP_LOADPN
,
14
OP_SELF
,
15
OP_NEWTUPLE
,
16
OP_GETTUPLE
,
17
OP_SETTUPLE
,
18
OP_GETLOCAL
,
19
OP_SETLOCAL
,
20
OP_GETUPVAL
,
21
OP_SETUPVAL
,
22
OP_GLOBAL
,
23
OP_GETTABLE
,
24
OP_SETTABLE
,
25
OP_NEWLICK
,
26
OP_GETPATH
,
27
OP_SETPATH
,
28
OP_ADD
,
29
OP_SUB
,
30
OP_MULT
,
31
OP_DIV
,
32
OP_REM
,
33
OP_POW
,
34
OP_NOT
,
35
OP_CMP
,
36
OP_EQ
,
37
OP_NEQ
,
38
OP_LT
,
39
OP_LTE
,
40
OP_GT
,
41
OP_GTE
,
42
OP_BITN
,
43
OP_BITL
,
44
OP_BITR
,
45
OP_DEF
,
46
OP_BIND
,
47
OP_MSG
,
48
OP_JMP
,
49
OP_TEST
,
50
OP_TESTJMP
,
51
OP_NOTJMP
,
52
OP_NAMED
,
53
OP_CALL
,
54
OP_CALLSET
,
55
OP_TAILCALL
,
/* TODO */
56
OP_RETURN
,
57
OP_PROTO
,
/* define a method */
58
OP_CLASS
,
59
OP_DEBUG
60
};
61
62
#if defined(__GNUC__)
63
#pragma pack(1)
64
#else
65
#pragma pack(push, 1)
66
#endif
67
70
typedef
struct
{
71
enum
PN_OPCODE
code:8;
72
int
a:12;
73
int
b:12;
74
}
PN_OP
;
75
76
#if defined(__GNUC__)
77
#pragma pack()
78
#else
79
#pragma pack(pop)
80
#endif
81
82
#define PN_OP_AT(asmb, n) ((PN_OP *)((PNFlex *)asmb)->ptr)[n]
83
#define PN_OP_LEN(asmb) (PN_FLEX_SIZE(asmb) / sizeof(PN_OP))
84
85
#endif
OP_TEST
Definition:
opcodes.h:49
OP_LOADK
Definition:
opcodes.h:12
OP_TAILCALL
Definition:
opcodes.h:55
OP_REM
Definition:
opcodes.h:32
OP_BITR
Definition:
opcodes.h:44
OP_EQ
Definition:
opcodes.h:36
OP_CLASS
Definition:
opcodes.h:58
OP_GETPATH
Definition:
opcodes.h:26
OP_NOT
Definition:
opcodes.h:34
OP_BITL
Definition:
opcodes.h:43
OP_JMP
Definition:
opcodes.h:48
OP_NEQ
Definition:
opcodes.h:37
OP_SETUPVAL
Definition:
opcodes.h:21
OP_SETTABLE
Definition:
opcodes.h:24
OP_DIV
Definition:
opcodes.h:31
OP_MULT
Definition:
opcodes.h:30
PN_OP
#define PN_OP(T, A, B)
Warning: This might conflict with the typedef struct PN_OP.
Definition:
ast.h:28
OP_GETTABLE
Definition:
opcodes.h:23
OP_NEWTUPLE
Definition:
opcodes.h:15
OP_BIND
Definition:
opcodes.h:46
OP_LT
Definition:
opcodes.h:38
OP_LOADPN
Definition:
opcodes.h:13
OP_DEBUG
Definition:
opcodes.h:59
OP_NONE
Definition:
opcodes.h:10
OP_GETUPVAL
Definition:
opcodes.h:20
OP_MOVE
Definition:
opcodes.h:11
OP_NEWLICK
Definition:
opcodes.h:25
OP_NOTJMP
Definition:
opcodes.h:51
OP_GLOBAL
Definition:
opcodes.h:22
OP_SETLOCAL
Definition:
opcodes.h:19
OP_GTE
Definition:
opcodes.h:41
OP_DEF
Definition:
opcodes.h:45
PN_OPCODE
PN_OPCODE
Definition:
opcodes.h:9
OP_BITN
Definition:
opcodes.h:42
OP_ADD
Definition:
opcodes.h:28
OP_SELF
Definition:
opcodes.h:14
OP_GETTUPLE
Definition:
opcodes.h:16
OP_CALLSET
Definition:
opcodes.h:54
OP_SUB
Definition:
opcodes.h:29
OP_NAMED
Definition:
opcodes.h:52
OP_GT
Definition:
opcodes.h:40
OP_CMP
Definition:
opcodes.h:35
OP_RETURN
Definition:
opcodes.h:56
OP_SETPATH
Definition:
opcodes.h:27
OP_MSG
Definition:
opcodes.h:47
OP_CALL
Definition:
opcodes.h:53
OP_GETLOCAL
Definition:
opcodes.h:18
OP_SETTUPLE
Definition:
opcodes.h:17
OP_TESTJMP
Definition:
opcodes.h:50
OP_PROTO
Definition:
opcodes.h:57
OP_POW
Definition:
opcodes.h:33
OP_LTE
Definition:
opcodes.h:39
Generated on Wed Mar 04 2015 for potion .1247 (date="2015-02-24") ) by
doxygen
1.8.7