forked from HuoLanguage/huo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
structures.h
68 lines (56 loc) · 1.09 KB
/
structures.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
#ifndef _STRUCTURES_H
#define _STRUCTURES_H
struct String {
int length;
char *body;
};
struct Token {
char type;
struct String data;
};
struct Tokens {
struct Token tokens[10000];
int length;
int counter;
};
union Data {
char bl;
long ln;
float fl;
struct String str;
struct Value_array * array;
};
struct Value {
char type; // [f]loat [b]ool [l]ong [s]tring [a]rray [u]ndefined
union Data data;
};
struct Value_array {
int size;
struct Value * values[1000];
};
struct Keyval {
struct Value * key;
struct Value * val;
};
struct Tree_map {
struct String * names [250];
struct Tree * trees [250];
int size;
};
struct Map {
int size;
struct Keyval * members[200];
};
struct Tree {
char type; // [o]pen, [f]unction [k]eyword [c]lose [s]tring [n]umber [b]racket [e]nd bracket
int size;
struct Value content;
struct Tree * children[200];
struct Tree * parent;
};
struct Execution_bundle {
struct Tree * ast;
struct Tree_map * defined;
struct Map * let_map;
};
#endif /* _STRUCTURES_H */