From 7d858e8b10463e2cb1cdd27e9b3a76e5132d3c57 Mon Sep 17 00:00:00 2001 From: Brandon Jackson <1drummer@att.net> Date: Tue, 15 Sep 2015 23:48:50 -0500 Subject: [PATCH 1/3] Update DBEngine.h --- DBEngine.h | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/DBEngine.h b/DBEngine.h index dadb143..57ea9d8 100755 --- a/DBEngine.h +++ b/DBEngine.h @@ -3,10 +3,10 @@ #include #include "Relation.h" -//still in progress +//still in progress class DBEngine { vector tables; - int size; + int size; public: DBEngine(){ @@ -55,7 +55,24 @@ public: void project(Relation r, string n) { r.projectQuery(n); } - void product() { /*Brandon*/ } + /* + Relation product(string p_name, Relation table_1, Relation table_2) { + + vector all_att; + + //Insert table 1 attributes + all_att.insert(all_att.begin(), (table_1.getAttributes()).begin(), (table_1.getAttributes()).end()); + //Insert table 2 attributes + all_att.insert(all_att.begin(), (table_2.getAttributes()).begin(), (table_2.getAttributes()).end()); + + Relation temp(p_name, all_att); + + vector table1_stuff; + + + return temp; + } + */ bool unionComp(Relation r1, Relation r2) { return ((r1.getSize() == r2.getSize()) && (r1.getDomains() == r2.getDomains())); From 6b2039896da2f691dec0acc1e449bf8a368bdae9 Mon Sep 17 00:00:00 2001 From: Alexander Huddleston Date: Wed, 16 Sep 2015 16:43:49 -0500 Subject: [PATCH 2/3] Lexical Parser cpp file. --- LParser.cpp | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 LParser.cpp diff --git a/LParser.cpp b/LParser.cpp new file mode 100755 index 0000000..624d094 --- /dev/null +++ b/LParser.cpp @@ -0,0 +1,2 @@ +// Lexical Parser +// Test file \ No newline at end of file From f755bbc42ac8def26d5a9119575311f815895752 Mon Sep 17 00:00:00 2001 From: Alexander Huddleston Date: Wed, 16 Sep 2015 17:28:32 -0500 Subject: [PATCH 3/3] Updated LParser.cpp 9-16-15 --- LParser.cpp | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/LParser.cpp b/LParser.cpp index 624d094..2a17ee5 100755 --- a/LParser.cpp +++ b/LParser.cpp @@ -1,2 +1,50 @@ // Lexical Parser -// Test file \ No newline at end of file +// Test file + +#include +#include "DBEngine.h" + +using namespace std; + +int digit(char c) +{ + if(isdigit(c)) + { + return atoi(c); + } + return 0; +} + +char alpha(char c) +{ + toupper(c); + string a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int x = 0; + while(x != a.length()) + { + if(c == a[x]) + { + return c; + } + x++; + } + return "?"; +} + +char space(char c) +{ + if(c == " ") + { + return c; + } + return "?"; +} + +char arnold(char c) +{ + if(c == ";") + { + return c; + } + return "?"; +} \ No newline at end of file