slight modification to Parser.cpp
This commit is contained in:
parent
47e8fd3c1e
commit
ea2b612129
4 changed files with 1 additions and 27 deletions
|
@ -1090,9 +1090,3 @@ void parse(string input, DBEngine &engine)
|
|||
vector<string> listOfTokens = tokenize(input);
|
||||
par_line(listOfTokens, engine);
|
||||
}
|
||||
|
||||
void parseList(vector<string> input, DBEngine &engine) {
|
||||
for (int i = 0; i < input.size(); ++i){
|
||||
parse(input[i], engine);
|
||||
}
|
||||
}
|
||||
|
|
1
Parser.h
1
Parser.h
|
@ -20,4 +20,3 @@ std::vector<std::string> deleteCMD(std::vector<std::string> input, DBEngine &eng
|
|||
std::vector<std::string> query(std::vector<std::string> input, DBEngine &engine);
|
||||
void par_line(std::vector<std::string> input, DBEngine &engine);
|
||||
void parse(std::string s, DBEngine &e);
|
||||
void parseList(std::vector<std::string> input, DBEngine &engine);
|
BIN
a.out
BIN
a.out
Binary file not shown.
|
@ -1,19 +0,0 @@
|
|||
#include <iostream>
|
||||
#include <vector>
|
||||
#include "Parser.h"
|
||||
#include "Condition.h"
|
||||
#include "DBEngine.h"
|
||||
//#include "user.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main () {
|
||||
DBEngine engine;
|
||||
|
||||
vector<string> s;
|
||||
s.push_back("CREATE TABLE animals ( name VARCHAR(20), kind VARCHAR(8), years INTEGER ) PRIMARY KEY ( name, kind ) ;");
|
||||
s.push_back("CREATE TABLE animals2 ( name VARCHAR(20), kind VARCHAR(8), years INTEGER ) PRIMARY KEY ( name, kind ) ;");
|
||||
s.push_back("SHOW animals2 ;");
|
||||
s.push_back("SHOW animals2 ;");
|
||||
parseList(s, engine);
|
||||
}
|
Reference in a new issue