public override void Substitute(IRExpression template, IRExpression substitution, IRExpression.OnMatchFoundHandler callback) { Operand.Substitute(template, substitution, callback); var mapping = new Dictionary <IRVariable, IRExpression>(); if (Operand.Unify(template, mapping) && callback(mapping)) { var newExpr = substitution.CloneComplete(); foreach (var varMap in mapping) { newExpr.Substitute(varMap.Key, varMap.Value); } Operand = newExpr; } }
public abstract void Substitute(IRExpression template, IRExpression substitution, IRExpression.OnMatchFoundHandler callback);