-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser.h
More file actions
36 lines (24 loc) · 904 Bytes
/
parser.h
File metadata and controls
36 lines (24 loc) · 904 Bytes
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
/*
*Batch Number 6
*Abhinav Bhatia (2011A7PS371P)
*Mukul Bhutani (2011A7PS343P)
*/
#ifndef _PARSER_
#define _PARSER_
#include "parserDef.h"
#include "lexer.h"
Parser parser_initialise(FILE* grammarInputFile, FILE* astRulesFile);
Grammar populateRules(FILE *fp);
//Call this function after memory for parseTable has been allocated
void createParseTable(Grammar grammar, ParseTable parseTable);
int compareRulesByReference(Rule* r1, Rule* r2);
Symbol* findSymbolByName(char* symbolString, Grammar g);
//Returns success of parsing attempt.
int parseInputSourceCode(Parser* p, Lexer l);
void printParseTable(Parser p);
void printParseTree(Tree PT, char *outfile);
void printParseTreeNatural(TreeLink subtreeRoot);
ParseTreeNodeData* parseTree_createNodeValue(Symbol* symbol, TokenInfo info);
ParseTreeNodeData* parseTree_createNodeNTValue(Symbol* symbol);
void initUsefulArray(FILE* fin);
#endif