Ejemplo n.º 1
0
        public override IResExp Substitute(Substitution subst)
        {
            var newVar = new ResVarDecl(
                _var.Range,
                _var.Name,
                _var.Type.Substitute(subst));

            var newSubst = new Substitution(subst);

            newSubst.Insert(_var, newVar);

            return(new ResForExp(
                       this.Range,
                       newVar,
                       _sequence.Substitute(subst),
                       _body.Substitute(newSubst)));
        }
Ejemplo n.º 2
0
        public override IResExp Substitute(Substitution subst)
        {
            var newVar = new ResVarDecl(
                _var.Range,
                _var.Name,
                _var.Type.Substitute(subst));

            var newSubst = new Substitution(subst);

            newSubst.Insert(_var, newVar);

            var newValue = _value == null ? null :
                           _value.Substitute(subst);

            return(new ResLetExp(
                       this.Range,
                       newVar,
                       newValue,
                       _body.Substitute(newSubst)));
        }