-
Notifications
You must be signed in to change notification settings - Fork 0
/
pichuLexer.h
65 lines (61 loc) · 1005 Bytes
/
pichuLexer.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
#ifndef LEXER_H
#define LEXER_H
typedef enum{
TYPE_NONE = -1,
TYPE_NOP = 0,
TYPE_PUSH,
TYPE_POP,
TYPE_POP2,
TYPE_PUSH_NULL,
TYPE_ADD,
TYPE_SUB,
TYPE_MUL,
TYPE_DIV,
TYPE_INC,
TYPE_INC_ALL,
TYPE_DEC,
TYPE_DEC_ALL,
TYPE_PRINT,
TYPE_DUP,
TYPE_SWAP,
TYPE_NEG,
TYPE_READ,
TYPE_STOP,
TYPE_CLEAR,
TYPE_FLIP,
TYPE_INDEX_SWAP,
TYPE_INDEX_DUP,
TYPE_CHANGE_TO,
TYPE_MOD,
TYPE_MOD_ALL,
TYPE_COMPE,
TYPE_COMPNE,
TYPE_COMPG,
TYPE_COMPGE,
TYPE_COMPL,
TYPE_COMPLE,
TYPE_COMPE_NULL,
TYPE_COMPNE_NULL,
TYPE_CONST_M1,
TYPE_CONST_0,
TYPE_CONST_1,
TYPE_CONST_2,
TYPE_CONST_3,
TYPE_CONST_4,
TYPE_CONST_5,
TYPE_GOTO,
TYPE_GOTO_Z,
TYPE_GOTO_NZ,
TYPE_GOTO_NULL,
TYPE_GOTO_C,
TYPE_GOTO_NC,
TYPE_CONDITION,
} TokenType;
typedef struct{
TokenType type;
char *text;
int line;
int character;
} Token;
int lexer();
#endif