-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathparserDef.h
67 lines (50 loc) · 920 Bytes
/
parserDef.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 NUMBER: 11
NIKKI GUPTA 2016A7PS0057P
SAHIL RANADIVE 2016A7PS0097P
ADITI AGARWAL 2016A7PS0095P
ADITYA LADDHA 2016A7PS0038P
*/
#ifndef HASH
#define HASH
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lexer.h"
typedef struct Node* node;
typedef struct Helement* helement;
typedef helement* hashtable;
typedef int** parseTable; //-2 entry denotes syn -1:error else ruleno
// typedef struct LinkedList* ll;
struct Node
{
char* string;
int flag;//terminal 1 nonterminal-1 eps 0
node next;
};
struct Helement{
node first;
node follow;
int* rules;
int nrules;
char* value;
int flag;
};
typedef struct Stack* stack;
struct Stack{
int *arr;
int top;
};
typedef struct TreeNode* treenode;
struct TreeNode{
//struct nonLeafNode N;
//struct leafNode L;
treenode next;
treenode children;
treenode parent;
treenode prev;
int line;
char* lexeme;
int id;
};
#endif