-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathparserHashTable.h
More file actions
44 lines (32 loc) · 838 Bytes
/
Copy pathparserHashTable.h
File metadata and controls
44 lines (32 loc) · 838 Bytes
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
/*
* Group 08
* Shubham Lather 2016A7PS0006P
* Devyash Parihar 2016A7PS0066P
* Rahul Khandelwal 2016A7PS0128P
* Aniruddha Karve 2016A7PS0042P
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lexerDef.h"
struct element{
terminalId type;
char* lexeme;
struct element* next;
};
typedef struct element parserElement;
struct parserlist{
parserElement* head;
};
typedef struct parserlist parserList;
struct parser{
int num_pos;
parserList** positions;
};
typedef struct parser parserTable;
//Function Declarations
parserTable* createParserHashTable(int num_pos);
void insertElementPHT(parserTable* lookUpTable, char* key, terminalId tokentype);
int hashFuncPHT(char* key, int num_pos);
void fillPHT(parserTable* lookUpTable);
terminalId getTokenTypePHT(char* key, parserTable* lookUpTable);