Update Parserv2.cpp
This commit is contained in:
parent
f8a1923856
commit
37610790ac
1 changed files with 13 additions and 4 deletions
17
Parserv2.cpp
17
Parserv2.cpp
|
@ -120,6 +120,8 @@ vector<string> showCMD(vector<string> input)
|
||||||
cout<<"\nPassing the following arguments to dbEngine: "<<endl;
|
cout<<"\nPassing the following arguments to dbEngine: "<<endl;
|
||||||
cout<<"command :"<<input[0]<<endl;
|
cout<<"command :"<<input[0]<<endl;
|
||||||
cout<<"argument: "<<input[1]<<endl;
|
cout<<"argument: "<<input[1]<<endl;
|
||||||
|
|
||||||
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<string> exitCMD(vector<string> input)
|
vector<string> exitCMD(vector<string> input)
|
||||||
|
@ -131,6 +133,8 @@ vector<string> exitCMD(vector<string> input)
|
||||||
|
|
||||||
if (input[0] != "EXIT") { cout<<"Wrong function/syntax error!"<<endl;}
|
if (input[0] != "EXIT") { cout<<"Wrong function/syntax error!"<<endl;}
|
||||||
cout<<"Passing command: "<<input[0]<<endl;
|
cout<<"Passing command: "<<input[0]<<endl;
|
||||||
|
|
||||||
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -241,6 +245,11 @@ void par_line(vector<string> input) //calls par_command() or par_query() dependi
|
||||||
showCMD(input);
|
showCMD(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( input[0] == "EXIT")
|
||||||
|
{
|
||||||
|
exitCMD(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -288,12 +297,12 @@ int main () {
|
||||||
string ss3 = "EXIT ; ";
|
string ss3 = "EXIT ; ";
|
||||||
|
|
||||||
vector<string> listOfTokens = tokenize(ss);
|
vector<string> listOfTokens = tokenize(ss);
|
||||||
//vector<string> listOfTokens2 = tokenize(ss2);
|
vector<string> listOfTokens2 = tokenize(ss2);
|
||||||
//vector<string> listOfTokens3 = tokenize(ss3);
|
vector<string> listOfTokens3 = tokenize(ss3);
|
||||||
|
|
||||||
par_line(listOfTokens);
|
par_line(listOfTokens);
|
||||||
//par_line(listOfTokens2);
|
par_line(listOfTokens2);
|
||||||
//par_line(listOfTokens3);
|
par_line(listOfTokens3);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue