-
Notifications
You must be signed in to change notification settings - Fork 0
/
typeExpression.h
75 lines (60 loc) · 1.53 KB
/
typeExpression.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
/*
=======================================================================================================
PPL ASSIGNMENT 1 2020
GROUP NUMBER 14
RUSHIKESH ZAWAR 2017B1A70977P
SHREY SHAH 2017B2A71038P
ABHIMANYU SETHI 2017B3A70637P
PRANALI SANCHETI 2017B3A70736P
=======================================================================================================
*/
#ifndef TE_H
#define TE_H
#include<stdio.h>
#include<stdbool.h>
//#include "treenode.h"
typedef enum ArrayType{prim, rect, jag} arrayType;
typedef enum BindType{static_bind, dynamic_bind, not_applicable} bindType;
typedef struct Range{
int start;
int end;
}range;
typedef struct JaggedTE{
char* type;
int dim;
//struct Range* r;
int* range;
char** range3d;
int bound;
int index;
int lowerRange;
int upperRange;
char* elem;
} jaggedTE;
typedef struct RectTE{
char* type;
int dim;
//struct Range* r;
char* elem;
char** range_rt;
int bound; //Utility
} rectTE;
typedef struct PrimTE{
char* type;
} primTE;
union TypeExpression{
primTE pt;
rectTE rt;
jaggedTE jt;
};
typedef struct TypeExpressionCell{
char name[21]; //FIELD-1
arrayType at; //FIELD-2 0-prim 1- rect 2- jag}
bindType bt; //FIELD-3 0- static_bind 1- dynamic_bind 2- not_applicable}
int tag; //0 - primtTE, 1- rectTE, 2-jaggedTE
union TypeExpression te; //FIELD-4
} typeExpressionCell;
typeExpressionCell typeExpressionTable[100];
void init_global_var();
void printTypeexpressiontable();
#endif