forked from coolsidd/Compiler-design
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rect_array_type.h
56 lines (39 loc) · 1.36 KB
/
rect_array_type.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
/*
Group 36
2017B4A70495P Manan Soni
2017B4A70549P Siddharth Singh
2017B4A70636P Nayan Khanna
2017B4A70740P Aditya Tulsyan
*/
#ifndef RECT_ARRAY_TYPE_H
#define RECT_ARRAY_TYPE_H
#include "linked_list.h"
#include "parse_tree.h"
typedef struct ____RECT_ARRAY_RANGE____ rect_array_range;
struct ____RECT_ARRAY_RANGE____{
int lower_bound;
int upper_bound;
};
typedef struct ____RECT_ARRAY_TYPE____ rect_array_type;
struct ____RECT_ARRAY_TYPE____{
int dimensions; // to keep or not? We can keep this in array_ranges.num_nodes
linked_list* array_ranges;
};
/* Function Prototypes */
// initialise rect array range node
rect_array_range* create_rect_array_node();
void get_type_from_rangelist(Parse_tree_node *p, linked_list *ll);
// initialise rect_array_type
rect_array_type* create_rect_array_type(Parse_tree_node* p);
// get number of dimensions of rect array
int get_dimension(rect_array_type* r_type);
#endif
// not required for now
// add range at index 'idx' of rect array
// void add_range_at(rect_array_type *r_type, void *data, int idx);
// // append range of rect array
// void append_range(rect_array_type* r_type, rect_array_range* r);
// // remove range of rect array
// void remove_range_at(rect_array_type* r_type, rect_array_range* r, int idx);
// // get range at an index
// rect_array_range* get_range_by_index(rect_array_range* r, int idx);