diff --git a/Parser.cpp b/Parser.cpp index c41a61b..0cf3214 100644 --- a/Parser.cpp +++ b/Parser.cpp @@ -581,7 +581,7 @@ tuple, Relation> expression(vector input, DBEngine &engin vector showCMD(vector input, DBEngine &engine) { - if(engine.isRelation(input[0])) + if(engine.isRelation(input[0]) && (input[1] != "+" && input[1] != "-" && input[1] != "*")) { engine.getTableFromName(input[0]).display(); input.erase(input.begin()); @@ -954,6 +954,7 @@ vector updateCMD(vector input, DBEngine &engine) } + // send update command to DBEngine } @@ -967,36 +968,30 @@ vector deleteCMD(vector input, DBEngine &engine) input.erase(input.begin()); input.erase(input.begin()); - PRelation r(input[0]); + Relation rcond = engine.getTableFromName(input[0]); + Relation rfinal = engine.getTableFromName(input[0]); + + input.erase(input.begin()); + + vector s; if(input[0] == "WHERE") { + input.erase(input.begin()); if(input[0] == "(") { - //PCondition c; - - PComparison c; - POperand oops1; - POperand oops2; - POp op; - + input.erase(input.begin()); while(input[0] != ")") { - oops1.setPOperand(input[0]); + s.push_back(input[0]); input.erase(input.begin()); - - oops2.setPOperand(input[0]); - input.erase(input.begin()); - - op.setPOp(input[0]); - input.erase(input.begin()); - - c.setPComparison(oops1.getPOperand(), op.getPOp(), oops2.getPOperand()); } } } + rcond = condition(); // send delete command to DBEngine + } else cout<<"Syntax error!"<