diff --git a/Parser.cpp b/Parser.cpp deleted file mode 100644 index 4a9092f..0000000 --- a/Parser.cpp +++ /dev/null @@ -1,44 +0,0 @@ - -#include // std::string -#include // std::cout -#include // std::stringstream -#include -#include - -using namespace std; - -/* - as of now, this parser can take a string and break it into tokens -*/ - - -vector tokenize(string ss) -{ - string tempString; - stringstream lineStream(ss); - vector output; - - while (lineStream >> tempString) - { - output.push_back(tempString); - } - - return output; - -} - -int main () { - - - string ss = "INSERT INTO animals VALUES FROM ( Joe , cat , 4 ) ;"; - - - vector listOfTokens = tokenize(ss); - - - for (int i = 0; i < listOfTokens.size(); ++i) - { - cout<<" slot "< deleteCMD(vector input){ cout << "\nPassing the following arguments to dbEngine: " << endl; cout << "command :" << input[0] << endl; cout << "relation: " << input[2] << endl; - for (int i = 0; i < input.size(); ++i) { - cout << input[i] << "\n"; - } + cout << "condition: " << input[5] << input[6] << input[7] << endl; + + return input; } int main () { - string ss = "DELETE FROM animals WHERE (age == 12);"; + string s = "DELETE FROM animals WHERE ( age == 12 ) ;"; vector listOfTokens = tokenize(s); - deleteCMD(listofTokens); + deleteCMD(listOfTokens); } diff --git a/a.out b/a.out new file mode 100755 index 0000000..6a77a3d Binary files /dev/null and b/a.out differ