Пример #1
0
void Visitor_DoMakeWalker::Visit_Expr_Rel_Embed(const ZRef<RelationalAlgebra::Expr_Rel_Embed>& iExpr)
	{
	if (ZRef<Walker> op0 = this->Do(iExpr->GetOp0()))
		{
		if (ZRef<Walker> op1 = this->Do(iExpr->GetOp1()))
			this->pSetResult(new Walker_Embed(op0, iExpr->GetColName(), op1));
		}
	}
Пример #2
0
void Visitor_DoMakeWalker::Visit_Expr_Rel_Product(const ZRef<RelationalAlgebra::Expr_Rel_Product>& iExpr)
	{
	if (ZRef<Walker> op0 = this->Do(iExpr->GetOp0()))
		{
		if (ZRef<Walker> op1 = this->Do(iExpr->GetOp1()))
			this->pSetResult(new Walker_Product(op0, op1));
		}
	}
Пример #3
0
void ZVisitor_Expr_Bool_ToStrim::Visit_Expr_Bool_Or(const ZRef<ZExpr_Bool_Or>& iRep)
	{
	this->pStrimW() << "(";
	this->pToStrim(iRep->GetOp0());
	this->pStrimW() << " | ";
	this->pToStrim(iRep->GetOp1());
	this->pStrimW() << ")";
	}
Пример #4
0
void Visitor_DoMakeWalker::Visit_Expr_Rel_Union(const ZRef<RelationalAlgebra::Expr_Rel_Union>& iExpr)
	{
	if (ZRef<Walker> op0 = this->Do(iExpr->GetOp0()))
		{
		if (ZRef<Walker> op1 = this->Do(iExpr->GetOp1()))
			this->pSetResult(new Walker_Union(op0, op1));
		else
			this->pSetResult(op0);
		}
	else if (ZRef<Walker> op1 = this->Do(iExpr->GetOp1()))
		this->pSetResult(op1);
	}
Пример #5
0
void Transform_ConsolidateRenames::Visit_Expr_Rel_Rename(const ZRef<Expr_Rel_Rename>& iExpr)
	{
	string8 newName = iExpr->GetNew();

	if (ZQ<string8> theQ = sQGetErase(fRename, newName))
		newName = *theQ;

	const string8 oldName = iExpr->GetOld();

	sInsertMust(fRename, oldName, newName);

	ZRef<Expr_Rel> newOp0 = this->Do(iExpr->GetOp0());

	if (ZQ<string8> theQ = sQGet(fRename, oldName))
		{
		if (*theQ == newName)
			{
			if (newName != oldName)
				newOp0 = sRename(newOp0, newName, oldName);
			}
		}
	this->pSetResult(newOp0);
	}
void Visitor_Expr_Bool_Do_Eval::Visit_Expr_Bool_Or(const ZRef<Expr_Bool_Or>& iRep)
	{ this->pSetResult(this->Do(iRep->GetOp0()) || this->Do(iRep->GetOp1())); }
Пример #7
0
void ZVisitor_Expr_Bool_Do_Eval::Visit_Expr_Bool_And(const ZRef<ZExpr_Bool_And>& iRep)
	{ this->pSetResult(this->Do(iRep->GetOp0()) && this->Do(iRep->GetOp1())); }
Пример #8
0
void Visitor_DoMakeWalker::Visit_Expr_Rel_Restrict(const ZRef<RelationalAlgebra::Expr_Rel_Restrict>& iExpr)
	{
	if (ZRef<Walker> op0 = this->Do(iExpr->GetOp0()))
		this->pSetResult(new Walker_Restrict(op0, iExpr->GetExpr_Bool()));
	}
Пример #9
0
void Visitor_DoMakeWalker::Visit_Expr_Rel_Rename(const ZRef<RelationalAlgebra::Expr_Rel_Rename>& iExpr)
	{
	if (ZRef<Walker> op0 = this->Do(iExpr->GetOp0()))
		this->pSetResult(new Walker_Rename(op0, iExpr->GetNew(), iExpr->GetOld()));
	}
Пример #10
0
void Visitor_DoMakeWalker::Visit_Expr_Rel_Calc(const ZRef<RelationalAlgebra::Expr_Rel_Calc>& iExpr)
	{
	if (ZRef<Walker> op0 = this->Do(iExpr->GetOp0()))
		this->pSetResult(new Walker_Calc(op0, iExpr->GetColName(), iExpr->GetCallable()));
	}
Пример #11
0
void ZVisitor_Expr_Bool_ToStrim::Visit_Expr_Bool_Not(const ZRef<ZExpr_Bool_Not>& iRep)
	{
	this->pStrimW() << "~(";
	this->pToStrim(iRep->GetOp0());
	this->pStrimW() << ")";
	}