-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSQLParser.hpp
50 lines (39 loc) · 1.12 KB
/
SQLParser.hpp
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
42
43
44
45
46
47
48
49
50
//
// Created by JakoError on 2022/11/11.
//
#ifndef DBMS_SQLPARSER_HPP
#define DBMS_SQLPARSER_HPP
#include <boost/regex.hpp>
#include <string>
#include <vector>
using boost::regex;
using std::vector;
using std::string;
namespace cppDBMS {
class SQLParser {
public:
enum cmd_num : int {
create_db = 0, drop_db, use_db, create_tb, drop_tb, select_v, delete_v, insert_v, exit_c
};
static string seg;
static string seg_v;
static string name_regex;
static string names_regex;
static string column_regex;
static string value_regex;
static string cond_regex;
static string where_regex;
static regex re_create_db;
static regex re_drop_db;
static regex re_use_db;
static regex re_create_tb;
static regex re_drop_tb;
static regex re_select;
static regex re_delete;
static regex re_insert;
static regex re_exit;
static vector<string> split_by_space(const string &str);
static vector<string> extract_columns(string &str);
};
}
#endif //DBMS_SQLPARSER_HPP