-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstruction.h
More file actions
61 lines (51 loc) · 959 Bytes
/
instruction.h
File metadata and controls
61 lines (51 loc) · 959 Bytes
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
#ifndef INSTRUCTION_H
#define INSTRUCTION_H
#include <QString>
enum OpCode{
lbl,
jmp,
push_int,
push_null,
push_string,
push_local,
pop_local,
new_obj,
set_field,
get_field,
add,
sub,
mul,
divide,
lAnd,
lOr ,
lNot,
eql ,
neq ,
less,
greater,
geq,
leq,
jz,
jnz,
call,
ret,
call_external
};
class Instruction
{
public:
//Declarations
OpCode m_opCode;
int m_intVal;
QString m_symbol;
//Methods
Instruction();
Instruction(OpCode p_opCode);
Instruction(OpCode p_opCode, int p_intVal);
Instruction(OpCode p_opCode,QString p_strSymbol);
void Set_IntVal(int p_intVal);
int Get_IntVal();
void Set_StrSymbol(QString p_StrSymbol);
QString Get_StrSymbol();
};
#endif // INSTRUCTION_H