-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathparams.h
More file actions
110 lines (87 loc) · 1.2 KB
/
params.h
File metadata and controls
110 lines (87 loc) · 1.2 KB
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
#ifndef PARAMS_H
#define PARAMS_H
enum Sizes
{
MAX_IMG_SRC_LEN = 100,
STACK_INIT_CAP = 5,
MAX_NAME_LEN = 200,
MAX_SRC_LEN = 20000,
MAX_VAR_LEN = 20,
MAX_VARIABLES = 20,
MAX_TOKEN_LEN = 400,
MAX_TOKENS = 500,
MAX_NAMESPACES = 20,
};
enum Types
{
NUM_T,
VAR_T,
OP_T,
SPEC_T,
NAME_T,
NAME_SHORT_T,
};
enum Options
{
UNKNOWN,
ADD,
SUB,
DIV,
MUL,
POW,
AND,
OR,
EQ,
SQRT,
SIN,
COS,
// Comparison
IS_EE,
IS_GE,
IS_BE,
IS_GT,
IS_BT,
IS_NE,
// Special nodes
ST,
IF,
ELSE,
NIL,
VAR,
WHILE,
FUNC,
RET,
CALL,
PARAM,
OUT,
IN,
// Only for tokenizer
OPEN_BR,
CLOSE_BR,
TERMINATION_SYM,
SEMI_COL,
// Some other stuff
VOID,
TYPE,
};
const double ACCURACY = 0.000001;
//---------------------------------------------
union Values
{
double dbl_val;
Options op_val;
const char* var_name;
};
struct Token
{
Types type;
Values value;
int line_number;
};
struct Variable
{
int ram_indx;
const char* name;
};
//----------------------------------------------------------
#endif