Update Parserv3.h
This commit is contained in:
parent
32fbf439f8
commit
049183c4cb
1 changed files with 124 additions and 64 deletions
174
Parserv3.h
174
Parserv3.h
|
@ -11,38 +11,63 @@ class Relation
|
||||||
{
|
{
|
||||||
string name;
|
string name;
|
||||||
|
|
||||||
Relation(string str)
|
public:
|
||||||
{
|
Relation()
|
||||||
name = str;
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void setRelation(string str)
|
Relation(string str)
|
||||||
{
|
{
|
||||||
name = str;
|
name = str;
|
||||||
}
|
}
|
||||||
string getName()
|
|
||||||
{
|
void setRelation(string str)
|
||||||
return name;
|
{
|
||||||
}
|
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
|
class Union
|
||||||
{
|
{
|
||||||
string Un1;
|
string Un1;
|
||||||
string Un2;
|
string Un2;
|
||||||
|
|
||||||
Union (string s1, string s2)
|
public:
|
||||||
{
|
Union (string s1, string s2)
|
||||||
Un1 = s1;
|
{
|
||||||
Un2 = s2;
|
Un1 = s1;
|
||||||
}
|
Un2 = s2;
|
||||||
|
}
|
||||||
|
|
||||||
string getUnion()
|
string getUnion()
|
||||||
{
|
{
|
||||||
return "Union of " + Un1 + " and " + Un2;
|
return "Union of " + Un1 + " and " + Un2;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class Product
|
class Product
|
||||||
|
@ -50,16 +75,17 @@ class Product
|
||||||
string Pr1;
|
string Pr1;
|
||||||
string Pr2;
|
string Pr2;
|
||||||
|
|
||||||
Product(string s1, string s2)
|
public:
|
||||||
{
|
Product(string s1, string s2)
|
||||||
Pr1 = s1;
|
{
|
||||||
Pr2 = s2;
|
Pr1 = s1;
|
||||||
}
|
Pr2 = s2;
|
||||||
|
}
|
||||||
|
|
||||||
string getProduct()
|
string getProduct()
|
||||||
{
|
{
|
||||||
return "Product of " + Pr1 + " and " + Pr2;
|
return "Product of " + Pr1 + " and " + Pr2;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class Difference
|
class Difference
|
||||||
|
@ -67,16 +93,17 @@ class Difference
|
||||||
string D1;
|
string D1;
|
||||||
string D2;
|
string D2;
|
||||||
|
|
||||||
Difference(string s1, string s2)
|
public:
|
||||||
{
|
Difference(string s1, string s2)
|
||||||
D1 = s1;
|
{
|
||||||
D2 = s2;
|
D1 = s1;
|
||||||
}
|
D2 = s2;
|
||||||
|
}
|
||||||
|
|
||||||
string getDifference()
|
string getDifference()
|
||||||
{
|
{
|
||||||
return "Difference of " + D1 + " and " + D2;
|
return "Difference of " + D1 + " and " + D2;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class Renaming
|
class Renaming
|
||||||
|
@ -84,16 +111,17 @@ class Renaming
|
||||||
string newName;
|
string newName;
|
||||||
string oldName;
|
string oldName;
|
||||||
|
|
||||||
Renaming(string s1, string s2)
|
public:
|
||||||
{
|
Renaming(string s1, string s2)
|
||||||
newName = s1;
|
{
|
||||||
oldName = s2;
|
newName = s1;
|
||||||
}
|
oldName = s2;
|
||||||
|
}
|
||||||
|
|
||||||
string doRename()
|
string doRename()
|
||||||
{
|
{
|
||||||
return "Renaming " + oldName + " to " + newName;
|
return "Renaming " + oldName + " to " + newName;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class Projection
|
class Projection
|
||||||
|
@ -101,16 +129,17 @@ class Projection
|
||||||
string newName;
|
string newName;
|
||||||
string oldName;
|
string oldName;
|
||||||
|
|
||||||
Projection(string s1, string s2)
|
public:
|
||||||
{
|
Projection(string s1, string s2)
|
||||||
newName = s1;
|
{
|
||||||
oldName = s2;
|
newName = s1;
|
||||||
}
|
oldName = s2;
|
||||||
|
}
|
||||||
|
|
||||||
string doProjection()
|
string doProjection()
|
||||||
{
|
{
|
||||||
return "Projecting " + oldName + " onto " + newName;
|
return "Projecting " + oldName + " onto " + newName;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class Operand
|
class Operand
|
||||||
|
@ -216,6 +245,11 @@ class Condition
|
||||||
{
|
{
|
||||||
string cond;
|
string cond;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
Condition()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
Condition(string str)
|
Condition(string str)
|
||||||
{
|
{
|
||||||
cond = str;
|
cond = str;
|
||||||
|
@ -246,3 +280,29 @@ class Selection
|
||||||
return select;
|
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