Update Parserv2.cpp
This commit is contained in:
parent
52c801715c
commit
74bc10d0ad
1 changed files with 31 additions and 10 deletions
41
Parserv2.cpp
41
Parserv2.cpp
|
@ -112,27 +112,48 @@ vector<string> exitCMD(vector<string> input)
|
||||||
vector<string> createCMD(vector<string> input)
|
vector<string> createCMD(vector<string> input)
|
||||||
{
|
{
|
||||||
if (input[0] != "CREATE") {
|
if (input[0] != "CREATE") {
|
||||||
cout << "Error, create keyword is missing." <<endl;
|
cout << "Error: create keyword is missing." <<endl;
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
|
cout << "\nPassing the following arguments to dbEngine: " << endl;
|
||||||
|
// CREATE TABLE relation-name ( typed-attribute-list ) PRIMARY KEY ( attribute-list )
|
||||||
|
cout << "command :" << input[0] << endl;
|
||||||
|
cout << "argument: " << input[1] << endl;
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
|
vector<string> openCMD(vector<string> input){
|
||||||
|
if (input[0] != "OPEN") {
|
||||||
|
cout << "Error: open keyword is missing." <<endl;
|
||||||
return input;
|
return 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 << "relation: " << input[1] << endl;
|
||||||
}
|
|
||||||
|
|
||||||
vector<string> openCMD(vector<string> input){
|
|
||||||
//
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<string> closeCMD(vector<string> input){
|
vector<string> closeCMD(vector<string> input){
|
||||||
//
|
if (input[0] != "CLOSE") {
|
||||||
|
cout << "Error: close keyword is missing." <<endl;
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
|
cout << "\nPassing the following arguments to dbEngine: " << endl;
|
||||||
|
cout << "command :" << input[0] << endl;
|
||||||
|
cout << "relation: " << input[1] << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<string> saveCMD(vector<string> input){
|
vector<string> saveCMD(vector<string> input){
|
||||||
//open-cmd ::== OPEN relation-name
|
if (input[0] != "SAVE") {
|
||||||
//close-cmd ::== CLOSE relation-name
|
cout << "Error: save keyword is missing." <<endl;
|
||||||
//save-cmd ::== SAVE relation-name
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
|
cout << "\nPassing the following arguments to dbEngine: " << endl;
|
||||||
|
cout << "command :" << input[0] << endl;
|
||||||
|
cout << "relation: " << input[1] << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<string> updateCMD(vector<string> input){
|
vector<string> updateCMD(vector<string> input){
|
||||||
|
|
Reference in a new issue