From 049183c4cb15e1c348756ad4e9b96e6fb06dfb48 Mon Sep 17 00:00:00 2001 From: Alex Huddleston Date: Wed, 23 Sep 2015 02:45:53 -0500 Subject: [PATCH] Update Parserv3.h --- Parserv3.h | 188 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 124 insertions(+), 64 deletions(-) diff --git a/Parserv3.h b/Parserv3.h index 1fb63d7..830f98e 100644 --- a/Parserv3.h +++ b/Parserv3.h @@ -11,38 +11,63 @@ class Relation { string name; - Relation(string str) - { - name = str; - } - - void setRelation(string str) - { - name = str; - } - string getName() - { - return name; - } + public: + Relation() + { + } + + Relation(string str) + { + name = str; + } + + void setRelation(string str) + { + name = str; + } + string getName() + { + return name; + } }; - +class Attribute +{ + string name; + + public: + Attribute(string str) + { + name = str; + } + + void setAttribute(string str) + { + name = str; + } + + string getAttribute() + { + return name; + } +}; class Union { string Un1; string Un2; - Union (string s1, string s2) - { - Un1 = s1; - Un2 = s2; - } - - string getUnion() - { - return "Union of " + Un1 + " and " + Un2; - } + public: + Union (string s1, string s2) + { + Un1 = s1; + Un2 = s2; + } + + string getUnion() + { + return "Union of " + Un1 + " and " + Un2; + } }; class Product @@ -50,16 +75,17 @@ class Product string Pr1; string Pr2; - Product(string s1, string s2) - { - Pr1 = s1; - Pr2 = s2; - } - - string getProduct() - { - return "Product of " + Pr1 + " and " + Pr2; - } + public: + Product(string s1, string s2) + { + Pr1 = s1; + Pr2 = s2; + } + + string getProduct() + { + return "Product of " + Pr1 + " and " + Pr2; + } }; class Difference @@ -67,16 +93,17 @@ class Difference string D1; string D2; - Difference(string s1, string s2) - { - D1 = s1; - D2 = s2; - } - - string getDifference() - { - return "Difference of " + D1 + " and " + D2; - } + public: + Difference(string s1, string s2) + { + D1 = s1; + D2 = s2; + } + + string getDifference() + { + return "Difference of " + D1 + " and " + D2; + } }; class Renaming @@ -84,16 +111,17 @@ class Renaming string newName; string oldName; - Renaming(string s1, string s2) - { - newName = s1; - oldName = s2; - } - - string doRename() - { - return "Renaming " + oldName + " to " + newName; - } + public: + Renaming(string s1, string s2) + { + newName = s1; + oldName = s2; + } + + string doRename() + { + return "Renaming " + oldName + " to " + newName; + } }; class Projection @@ -101,16 +129,17 @@ class Projection string newName; string oldName; - Projection(string s1, string s2) - { - newName = s1; - oldName = s2; - } - - string doProjection() - { - return "Projecting " + oldName + " onto " + newName; - } + public: + Projection(string s1, string s2) + { + newName = s1; + oldName = s2; + } + + string doProjection() + { + return "Projecting " + oldName + " onto " + newName; + } }; class Operand @@ -216,6 +245,11 @@ class Condition { string cond; public: + + Condition() + { + } + Condition(string str) { cond = str; @@ -246,3 +280,29 @@ class Selection return select; } }; + +class Expression +{ + string exp; + + public: + + Expression() + { + } + + Expression(string str) + { + exp = str; + } + + void setExpression(string str) + { + exp = str; + } + + string getExpression() + { + return exp; + } +};