-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparser.h
31 lines (24 loc) · 851 Bytes
/
parser.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
/*
BATCH NUMBER: 23
PRABODH AGARWAL 2012B1A7801P
DEEPANSHU SINGH 2012B3A7593P
parser.h: function prototypes for the functions used in parser.c
*/
#ifndef PARSER
#define PARSER
#define tt (*t)
typedef int grammar[MAX_RULES+1][MAX_RULE_SIZE+2];
typedef int table[MAX_NON_TERMINALS][MAX_TERMINALS];
extern struct y *ptr[26][10][3];
extern hashtable *h;
char * getFirstSet(char *, char *, char *);
char * getFollowSet(char *);
void printParseTree(parseTree *p, FILE *outfile);
void printParseTable(table t);
int parseInputSourceCode(FILE *sourceCodeFile, table tb, grammar g, parseTree *root, tokenInfo *t);
char* getFirstSet(char *lhs, char *rhs, char *set);
void createParseTable(grammar g, table *t);
void getGrammar(grammar *g);
void printExpectedTokens(nontermid state, table tb);
void createAbstractSyntaxTree(parseTree*, parseTree*);
#endif