Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
 public abstract void Substitute(IRExpression template, IRExpression substitution, IRExpression.OnMatchFoundHandler callback);