forked from SarthakShah001/Compiler2K23
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser.h
More file actions
38 lines (32 loc) · 1.19 KB
/
parser.h
File metadata and controls
38 lines (32 loc) · 1.19 KB
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
/*
***** Group No. - 9 *****
Name : Sarthak Shah ID : 2020A7PS0092P
Name : Siddharth Khandelwal ID : 2020A7PS0098P
Name : Archaj Jain ID : 2020A7PS0072P
Name : BhanuPratap Singh Rathore ID : 2020A7PS1675P
Name : Rishi Rakesh Shrivastava ID : 2020A7PS0108P
*/
#ifndef _parser_
#define _parser_
#include "parserDef.h"
#include "doublyLinkedList.h"
#include "stackADT.h"
// starts parsing
parseTreeNode startParser(FILE *fp,int size);
// creates hashtable for terminals and fill terminals in it
void fill_terminals(hashtable terminals);
// same as terminals
void fill_nonterminals(hashtable nonterminals);
// fills grammer in the matrix of doubly linked list
void fill_grammer();
// fills both terminals and non terminals function
void fill_hash_tables();
// populates the first set from grammer
void populateFirstSet(nonterminal nt1);
// populates follow set from grammar
void populateFollowSet(nonterminal nt1);
// extern as used in parsetree.c
extern dlinkedlist parse_table[num_nonterminals][num_terminals];
// fills parse table from first and follow sets and grammar
void fill_parse_table();
#endif