From 52c801715ca547acc9228ad35260c5359e59235e Mon Sep 17 00:00:00 2001 From: scho4077 Date: Tue, 22 Sep 2015 21:49:37 -0500 Subject: [PATCH] Update Parserv2.cpp --- Parserv2.cpp | 159 ++++++++++----------------------------------------- 1 file changed, 31 insertions(+), 128 deletions(-) diff --git a/Parserv2.cpp b/Parserv2.cpp index 6d77211..7e15a93 100755 --- a/Parserv2.cpp +++ b/Parserv2.cpp @@ -20,23 +20,6 @@ tring; } - -// void par_select(vector input) -// { - // // if (input[0] != "(") - // // { - // // cout<<"ERROR! missing parenthesis"< input) { cout<<"TokenList: "< showCMD(vector input) } cout<<"\nPassing the following arguments to dbEngine: "< exitCMD(vector input) if (input[1] != ";") { cout<<"ERROR: missing semicolon!"< createCMD(vector input) { - // //relation name will be the first element of the vector of data returned by this function - // vector output; - - // output.push_back(input[0]) //pushing relation name - - - - // if (input[0] == "VALUES" && input[1] == "FROM") - // { - // input.erase(input.begin()); - // input.erase(input.begin()); - - - // if(input[0] == "(") - // { - // input.erase(input.begin()); - - // while(input[0] != ")") //inserting all values to relation - // //for (int i = 0; i < 2; ++i) - // { - // if (input[0] == ",") input.erase(input.begin()); - - // output.push_back(input[0]); - - // input.erase(input.begin()); - // } - - // return output; - - // } - - // else cout<<"Syntax error!"< openCMD(vector input){ + // +} +vector closeCMD(vector input){ + // +} +vector saveCMD(vector input){ + //open-cmd ::== OPEN relation-name +//close-cmd ::== CLOSE relation-name +//save-cmd ::== SAVE relation-name +} +vector updateCMD(vector input){ + // +} - -void par_line(vector input) //calls par_command() or par_query() depending on first item from token list -{ -/* -• Match the first item in the token list and determine weather this is a command or a query. -• Call functions par_command() or par_query(); -• After either par_command() or par_query() returns, make sure the line ends properly with “;” token -*/ - string tempChar = input.back(); - if (tempChar != ";") - { - cout<<"ERROR! missing semicolon "< insertInput = insertCMD(input); - cout<<"arguments: "< insertInput = insertCMD(input); - cout<<"arguments: "< deleteCMD(vector input){ + // } int main () {