-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparserDef.h
94 lines (84 loc) · 1.28 KB
/
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
GROUP NUMBER: 45
GROUP MEMBERS:
1. SHAH NEEL KAUSHIK
2. MEHTA AASHAY PINKESH
3. RANADE SHUBHANKAR PRASAD
*/
#ifndef _PARSEDEF_
#define _PARSEDEF_
#include "lexerDef.h"
#define TOTAL_NUM_NT 51
#define RULE_COUNT 92
typedef enum{
program,
mainFunction,
otherFunctions,
function,
input_par,
output_par,
parameter_list,
dataType,
remaining_list,
primitiveDatatype,
constructedDatatype,
stmts,
typeDefinitions,
typeDefinition,
fieldDefinitions,
fieldDefinition,
moreFields,
declarations,
declaration,
global_or_not,
otherStmts,
stmt,
assignmentStmt,
singleOrRecId,
new24,
funCallStmt,
outputParameters,
inputParameters,
iterativeStmt,
conditionalStmt,
elsePart,
ioStmt,
allVar,
newVar,
arithmeticExpression,
expPrime,
term,
termPrime,
factor,
highPrecedenceOperators,
lowPrecedenceOperators,
all,
temp,
booleanExpression,
var,
logicalOp,
relationalOp,
returnStmt,
optionalReturn,
idList,
more_ids
}TK_NTTYPES;
typedef union
{
TK_TYPES term_type;
TK_NTTYPES nonterm_type;
}grSymbol;
typedef enum{TERM, NON_TERM} tnt_tag;
typedef struct grNode{
tnt_tag t;
grSymbol s;
struct grNode* next;
struct grNode* prev;
}* GrNode;
typedef struct grHead{
TK_NTTYPES nonterm_head;
GrNode first;
GrNode last;
}* GrHead;
typedef GrHead Grammar;
#endif