コード例 #1
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);
	}
コード例 #2
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()));
	}