-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparserDef.h
57 lines (48 loc) · 989 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
// GROUP 39
// AKANKSHYA MISHRA 2016A7PS0026P
// NARAPAREDDY BHAVANA 2016A7PS0034P
// KARABEE BATTA 2016A7PS0052P
// AASTHA KATARIA 2016A7PS0062P
#include <stdbool.h>
#ifndef LEX_DEF_INCLUDED
#include "lexerDef.h"
#define LEX_DEF_INCLUDED
#endif
#ifndef GRAM_INCLUDED
#include "grammarDef.h"
#define GRAM_INCLUDED
#endif
extern int parse_correct;
extern int ParseNodes;
typedef struct f_node{
int is_error;
int rule_no_index;
}parse_table_elem;
typedef parse_table_elem **parse_table;
parse_table T;
typedef struct{
tokenInfo *leaf_symbol;
int rule_no;
}leafNode;
struct treeNodeIt;
typedef struct treeNodeIt treeNodeIt;
typedef struct{
NON_TERMINAL nonterminal;
int rule_no;
treeNodeIt *children;
}nonLeafNode;
typedef struct{
bool is_leaf;
union{
leafNode *l;
nonLeafNode *n;
}treeNode_type;
treeNodeIt *parent;
int line_no;
}treeNode;
typedef struct ASTNodeIt ASTNodeIt;
typedef struct treeNodeIt{
treeNode *t;
treeNodeIt *next;
ASTNodeIt *node;
}treeNodeIt;