school/cs236/parser/parser.h

50 lines
1.2 KiB
C
Raw Normal View History

2016-04-06 20:46:32 -07:00
#ifndef __PARSER_H__
#define __PARSER_H__
#include <iostream>
#include <sstream>
#include <vector>
#include <set>
#include "../lexer/token.h"
#include "scheme.h"
#include "fact.h"
#include "rule.h"
#include "query.h"
#include "predicate.h"
#include "parameter.h"
using namespace std;
class parser {
public:
parser() {}
vector<token> tokens;
set<string> domain;
vector<predicate> schemelist;
vector<predicate> factlist;
vector<predicate> querylist;
vector<predicate> predlist;
vector<rule> rulelist;
string get_token();
void check_datalog();
void check_schemelist(string);
void check_scheme(string);
void check_factlist(string);
void check_fact(string);
void check_rulelist(string);
void check_rule(string);
void check_querylist(string);
void check_query(string);
void check_predicate_list(string, rule&);
predicate check_predicate(string);
void check_parameterlist(string type, predicate&);
void check_parameter(string, predicate&);
void match(string);
void error();
string out();
};
#endif