-
Notifications
You must be signed in to change notification settings - Fork 0
/
structures.h
89 lines (70 loc) · 1.3 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#ifndef ParseFunc
#define ParseFunc
#define DOUBLE 1
#define INT 2
#define INTEGER 2
#define NAME 3
#define STRING 4
#define LESS_THAN 5
#define GREATER_THAN 6
#define EQUALS 7
#define GREATER_THAN_EQ 8
#define LESS_THAN_EQ 9
#define NOTEQUAL 10
typedef enum ntype {
selec, insert, create, del, drop, comparision, operand, orlist, andlist
} nodeType;
struct node {
nodeType type;
int code;
char *value;
struct node* left;
struct node* right;
};
struct Gtable {
char *tablename;
struct listAttr *attrlist;
struct Gtable *next;
};
struct f_oper {
int type; //type such as FLOAT, INT, STRING: has values 1, 2, 3....
char *actualOperand; // variable name
};
struct f_opr {
int operatorUsed; //operator used +, -, * using numeric values
struct f_opr *left;
struct f_oper *operand;
struct f_opr *right;
};
struct tbl_list {
char *tableName;
char *aliasAs;
struct tbl_list *next;
};
struct n_list {
char *name;
struct n_list *next;
};
struct Operand {
int code;
char *value;
};
struct cmp_opr {
int code;
struct Operand *left;
struct Operand *right;
};
struct or_list {
struct cmp_opr *left;
struct or_list *rightOr;
};
struct and_list {
struct or_list *left;
struct and_list *rightAnd;
};
struct listAttr{
char *name;
int type;
struct listAttr *next;
};
#endif