-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtypeExpressionTable.h
76 lines (63 loc) · 1.43 KB
/
typeExpressionTable.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
/**
SHUBHAM AGARWAL -- 2018A7PS0301P
YASH RAJ SINGH -- 2018A7PS0214P
SAHIL KATTNA -- 2018A7PS0154P
AGRAWAL RAJAT RAMESH -- 2018A7PS0182P
**/
#ifndef _TYPEEXPRESSION_
#define _TYPEEXPRESSION_
int CAPACITY = 0;
int curr_table_entry = 0;
typedef enum
{
Static,
Dynamic,
N_A
} bind_info;
char string_bind[3][25] =
{
"Static",
"Dynamic",
"NotApplicable"};
typedef union
{
int *_line;
int **jag_line; //jagged
} jagged_type;
typedef struct
{
int dim; //--4
int **dim_bound; //(7,4),(3,4),(),() 4X2
char **l_indexes;
char **u_indexes;
} array_record;
typedef struct
{
int dim; //2d or 3d ke liye tagg--
int r1_low;
int r1_high;
jagged_type dim_bound;
} jagged_array_record;
typedef union type_Expression_record
{
Terminal primitive_type; //INT<BOOL<REAL
array_record arr_record;
jagged_array_record j_arr_record;
} type_Expression_record;
typedef struct TypeExpression
{
NonTerminal tag; ///primitive,array,jagged
bind_info info; //static dyanmic
type_Expression_record record;
} TypeExpression;
typedef struct TypeExpressionTable
{
char var_name[200]; //extra
NonTerminal tag;
bind_info info;
type_Expression_record record;
} TypeExpressionTable;
TypeExpressionTable *table = NULL;
//********************FUNCTION DECLARATIONS*******************************//
void printTypeExpressionsTable(TypeExpressionTable *, char *);
#endif