-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathParser.h
41 lines (34 loc) · 1.06 KB
/
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
32
33
34
35
36
37
38
39
40
41
#ifndef INTERPRETER_PARSER_H
#define INTERPRETER_PARSER_H
#include "Token.h"
#include "DatalogProgram.h"
#include <vector>
class Parser {
private:
DatalogProgram* ParseDatalogProgram();
void ParseSchemeList();
void ParseFactList();
void ParseRuleList();
void ParseQueryList();
Predicate* ParseScheme();
Predicate* ParseFact();
Rule* ParseRule();
Predicate* ParseQuery();
Predicate* ParseHeadPredicate();
Predicate* ParsePredicate();
void ParsePredicateList(Rule*& rule);
void ParseParameterList(Predicate*& predicate);
void ParseStringList(Predicate*& predicate);
void ParseIdList(Predicate*& predicate);
Parameter* ParseParameter();
void MatchTerminal(TokenType typeToMatch);
DatalogProgram* datalogProgram;
std::vector<Token*> tokens;
unsigned int index;
public:
Parser() {}
~Parser() {} // TODO: Define the destructor for Parser
DatalogProgram* Parse(std::vector<Token*> tokens);
void PrintStructs();
};
#endif //INTERPRETER_PARSER_H