本文整理汇总了C++中Executer::execute方法的典型用法代码示例。如果您正苦于以下问题:C++ Executer::execute方法的具体用法?C++ Executer::execute怎么用?C++ Executer::execute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Executer
的用法示例。
在下文中一共展示了Executer::execute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
Executer exe;
exe.execute();
}
示例2: main
int main() {
Engine* engine = new Engine();
Executer* executer = new Executer();
Parser* parser = new Parser();
string q1 = "a <- Project (Animal, Number) animals;";
string q2 = "a <- cross1 * cross2";
string q3 = "a <- cross1 - cross3";
string q4 = "a <- cross1 + cross2;";
string q5 = "a<- j1 JOIN j2";
//all test queries above this function correctly
string q6 = "";
string createTest = "CREATE TABLE Teams (id INTEGER, favnum INTEGER, state INTEGER) PRIMARY KEY (id)";
string insertTest = "INSERT INTO Students VALUES FROM (Mouse, 12345665, Mexico)";
string insertTest2 = "INSERT INTO Mammals VALUES FROM (Mouse, 12345665, Mexico)";
string DiffTest = "a <- All_Warriors - Warriors_Starters;";
engine->open("join1.txt");
engine->changeRelationName(0, "j1");
engine->show("j1");
engine->open("join2.txt");
engine->changeRelationName(1, "j2");
engine->show("j2");
vector<int> theVec;
// To test use the different hardcoded strings to parse first.
//vector<Token> tok = parser->splitInput(q1);
//vector<Token> tok = parser->splitInput(insertTest2);
vector<Token> tokenvec = parser->splitInput(q5);
//vector<Token> tokenvec0 = parser->splitInput(q2);
Executer* exec = new Executer();
exec->execute(engine, tokenvec);
/*for(int i = 0; i < tok.size(); i++){
cout << "tok value: " << tok.at(i).getValue() << "\t" << tok.at(i).getTokenType() << endl;
}
cout << endl;
for(int j =0; j < tokenvec.size(); j++){
cout << "token value: " << tokenvec.at(j).getValue() << "\t" << tokenvec.at(j).getTokenType() << endl;
}*/
//engine->show("Students");
//engine->show("Mammals");
//engine->show("Teams");
//engine->show("projection");
//engine->show("Students");
/*cout << "Running" << endl;
while (true) {
string line;
getline(cin, line);
// temp
if (line == "q" || line == "quit") return 0;
else if (line == "h" || line == "help") help();
// parsing
vector<int> conditions;
parser->splitInput (line, conditions);
// create condition tree
// executer
executer->execute (engine, parser->getTokenVector().at(0)); // NOT ALWAYS ZERO!
}*/
}