forked from coolsidd/Compiler-design
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjagged_array_type.h
55 lines (43 loc) · 1.03 KB
/
jagged_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
/*
Group 36
2017B4A70495P Manan Soni
2017B4A70549P Siddharth Singh
2017B4A70636P Nayan Khanna
2017B4A70740P Aditya Tulsyan
*/
#ifndef JAGGED_ARRAY_TYPE_H
#define JAGGED_ARRAY_TYPE_H
#include "linked_list.h"
#include "parse_tree.h"
typedef struct ____R2_DIMENSION____ r2_dimension;
struct ____R2_DIMENSION____{
linked_list* sizes;
};
typedef struct ____JAGGED_2D____ jagged_2d;
struct ____JAGGED_2D____
{
int lower_bound;
int upper_bound;
r2_dimension row_sizes;
};
typedef struct ____JAGGED_3D____ jagged_3d;
struct ____JAGGED_3D____
{
int lower_bound;
int upper_bound;
linked_list* row_sizes;
};
typedef struct ____JAGGED_ARRAY_TYPE____ jagged_array_type;
struct ____JAGGED_ARRAY_TYPE____{
int dimensions;
union array_type{
jagged_2d j2d;
jagged_3d j3d;
}array_type;
};
jagged_2d* create_jagged_2d();
jagged_3d* create_jagged_3d();
r2_dimension* create_r2_dimension();
void append_size(linked_list *ll, int size);
jagged_array_type* create_jagged_array_type(Parse_tree_node *p);
#endif