Update Parserv3.h
This commit is contained in:
parent
32fbf439f8
commit
049183c4cb
1 changed files with 124 additions and 64 deletions
188
Parserv3.h
188
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;
|
||||
}
|
||||
};
|
||||
|
|
Reference in a new issue