-
Notifications
You must be signed in to change notification settings - Fork 1
/
symbolTableDef.h
69 lines (58 loc) · 988 Bytes
/
symbolTableDef.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
/*
* Group 08
* Shubham Lather 2016A7PS0006P
* Devyash Parihar 2016A7PS0066P
* Rahul Khandelwal 2016A7PS0128P
* Aniruddha Karve 2016A7PS0042P
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "AST.h"
#include"parser.h"
typedef struct paramInfo
{
bool isInputPar;
bool isOutputPar;
int parIndex;
}paramInfo;
typedef struct record
{
char* rname;
char* type;
int lineNo;
struct record* next;
}record;
typedef struct TableLoc
{
char* type;
char* varname;
int size;
int offset;
record* ptr;
paramInfo* param;
struct TableLoc *next;
}TableLoc;
typedef struct hashtable
{
TableLoc* entry;
}hashtable;
typedef struct tablePointer
{
TableLoc** localTable;
char* fname;
int numVar;
int fSize;
int numInpPar;
int numOutPar;
record* inParList;
record* outParList;
record* variables;
}tablePointer;
typedef struct symboltable
{
tablePointer** fTable;
int numFunc;
record* functions;
}symboltable;
typedef symboltable* symbolTable;