public IResMemberTerm Substitute(Substitution subst) { var obj = _obj.Substitute(subst); var memberSpec = _memberSpec.Substitute(subst); var objType = obj.Type; var dataType = objType; if (objType is ResFreqQualType) { dataType = ((ResFreqQualType)objType).Type; } if (dataType is Spark.Resolve.ResDummyTypeArg) { var typeArg = (Spark.Resolve.ResDummyTypeArg)dataType; if (typeArg.ConcreteType != null) { dataType = typeArg.ConcreteType; } } if (dataType is ResErrorTerm) { } else if (dataType is IResContainerRef) { var containerRef = (IResContainerRef)dataType; memberSpec = containerRef.FindMember(memberSpec).EffectiveSpec; } return(new ResMemberBind( _range, obj, memberSpec)); }
public IResFreqQualType Substitute(Substitution subst) { return(new ResFreqQualType( _range, _freq.Substitute <IResElementRef>(subst), _type.Substitute(subst))); }
public IResMemberSpec Substitute(Substitution subst) { return(new ResMemberSpec( _range, _container.Substitute <IResContainerRef>(subst), _decl)); }
public override IResExp Substitute(Substitution subst) { return(new ResConceptVal( Range, _conceptClass.Substitute <IResConceptClassRef>(subst), from m in _memberRefs select m.Substitute(subst))); }
public override IResExp Substitute(Substitution subst) { return(new ResSwitchExp( this.Range, _value.Substitute(subst), (from c in _cases select c.Substitute(subst)).ToArray())); }
public override IResExp Substitute(Substitution subst) { return(new ResIfExp( this.Range, _condition.Substitute(subst), _thenExp.Substitute(subst), _elseExp.Substitute(subst))); }
public override IResExp Substitute(Substitution subst) { return(new ResMethodApp( this.Range, this.Type.Substitute(subst), _method.Substitute <IResMethodRef>(subst), from a in _args select a.Substitute(subst))); }
public override IResExp Substitute(Substitution subst) { return(new ResAttributeFetch( this.Range, this.Type.Substitute(subst), _obj.Substitute(subst), _attribute.Substitute(subst))); }
public override IResExp Substitute(Substitution subst) { var newExp = _exp == null ? null : _exp.Substitute(subst); return(new ResBreakExp( this.Range, subst.Lookup(_label), newExp)); }
public ResGlobalMemberTerm( SourceRange range, ILazy <IResModuleDecl> module, IResMemberDecl decl) { _range = range; _module = module; _decl = decl; _subst = new Substitution(); }
public override ResKind Substitute(Substitution subst) { if (this == ResKind.Star) { return(this); } return(new ResIntervalKind( _lowerBound.Substitute(subst), _upperBound.Substitute(subst))); }
public ResMemberGenericApp( IResGenericRef fun, IEnumerable <IResGenericArg> args) { _fun = fun; _args = args.ToArray(); _subst = new Substitution(_fun.MemberTerm.Subst); foreach (var pair in _fun.Parameters.Zip(_args, Tuple.Create)) { _subst.Insert(pair.Item1.Decl, pair.Item2); } }
public ResMemberBind( SourceRange range, IResExp obj, IResMemberSpec memberSpec) { _range = range; _obj = obj; _memberSpec = memberSpec; _subst = new Substitution(memberSpec.Container.MemberTerm.Subst); // \todo: Need to ensure "obj" is clone-able... // \todo: Need to iteratively re-subst... _subst.Insert( memberSpec.Container.ThisParameter, (r) => obj); }
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))); }
public override IResExp Substitute(Substitution subst) { var newLabel = new ResLabel( _label.Range, _label.Name, _label.Type.Substitute(subst)); var newSubst = new Substitution(subst); newSubst.Insert(_label, newLabel); return(new ResLabelExp( this.Range, newLabel, this.Body.Substitute(newSubst))); throw new NotImplementedException(); }
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))); }
IResElementRef ISubstitutable <IResElementRef> .Substitute(Substitution subst) { return(this); }
IResTypeExp ISubstitutable <IResTypeExp> .Substitute(Substitution subst) { return(this); }
IResMemberTerm ISubstitutable <IResMemberTerm> .Substitute(Substitution subst) { throw new NotImplementedException(); }
IResConceptClassRef ISubstitutable <IResConceptClassRef> .Substitute(Substitution subst) { return(this); }
IResFreqQualType ISubstitutable <IResFreqQualType> .Substitute(Substitution subst) { return(this); }
public abstract ResKind Substitute(Substitution subst);
public ResElementCtorArg Substitute(Substitution subst) { return(new ResElementCtorArg( (IResAttributeRef)Attribute.Substitute <IResMemberRef>(subst), Value.Substitute(subst))); }
IResPipelineRef ISubstitutable <IResPipelineRef> .Substitute(Substitution subst) { throw new NotImplementedException(); }
IResContainerRef ISubstitutable <IResContainerRef> .Substitute(Substitution subst) { throw new NotImplementedException(); }
public override ResKind Substitute(Substitution subst) { throw new NotImplementedException(); }
public override IResExp Substitute(Substitution subst) { return(this); }
public IResVarSpec Substitute(Substitution subst) { return(new ResVarSpec( _decl, _type.Substitute(subst))); }
public IResMemberTerm Substitute(Substitution subst) { return(this); }
public override ResKind Substitute(Substitution subst) { return(this); }