public override void AssignFrom(ILData ilValue) { if (((IBuilder)this.Coding).IsBuild) { throw new CodingException("Metodun tanımlandığı tip derlenmiş. Derlenmiş metotların gövdesi yeniden yazılamaz."); } if (ilValue == null) { throw new ArgumentNullException("ilValue"); } if (this.FieldInfo.FieldType.IsAssignableFrom(ilValue.ILType)) { if (this.IsStatic) { ((IILPusher)ilValue).Push(); this.Coding.Generator.Emit(OpCodes.Stsfld, this.FieldInfo); } else { ((IILPusher)this._instance).Push(); ((IILPusher)ilValue).Push(); this.Coding.Generator.Emit(OpCodes.Stfld, this.FieldInfo); } } else { throw new TypeConvertException("Alanın türü, atanmak istenen objenin türünde değildi. Dönüştürme gerekli."); } }
public void Set(ILData ilValue) { if (((IBuilder)this.Coding).IsBuild) { throw new CodingException("Metodun tanımlandığı tip derlenmiş. Derlenmiş metotların gövdesi yeniden yazılamaz."); } if (ilValue == null) { throw new ArgumentNullException("ilValue"); } if (this._setMethod == null && this._setMethodBuilder == null) { throw new MethodNotFoundException("Özellik, set metodunu içermiyor."); } else if (ilValue.ILType != this.PropertyType) { throw new TypeConvertException("Atanan tür ile özelliğin türü uyumsuz."); } else { if (this._setMethod == null) { ((IILPusher) new ILLazyInvoke(this.Coding, this._instance, this._setMethodBuilder, null, new ILData[] { ilValue })).Push(); } else { ((IILPusher) new ILLazyInvoke(this.Coding, this._instance, this._setMethod, null, new ILData[] { ilValue })).Push(); } } }
public void StoreElement(ILData index, ILData ilObj) { if (((IBuilder)this.Coding).IsBuild) { throw new CodingException("Metodun tanımlandığı tip derlenmiş. Derlenmiş metotların gövdesi yeniden yazılamaz."); } if (ilObj == null) { throw new ArgumentNullException("ilObj"); } if (index == null) { throw new ArgumentNullException("index"); } if (this.ILType.IsArray) { if (index.ILType == typeof(int)) { this.Push(); ((IILPusher)ilObj).Push(); this.Generator.Emit(OpCodes.Box, ilObj.ILType); ((IILPusher)index).Push(); this.Generator.Emit(OpCodes.Call, ILVariable._setArrayValue); } else { throw new CodingException("İndis değerinin türü System.Int32 olmalı."); } } else { throw new CodingException("Obje bir dizi tipinde değildi."); } }
public ILLazy LoadElement(ILData index) { if (((IBuilder)this.Coding).IsBuild) { throw new CodingException("Metodun tanımlandığı tip derlenmiş. Derlenmiş metotların gövdesi yeniden yazılamaz."); } if (index == null) { throw new ArgumentNullException("index"); } if (this.ILType.IsArray) { if (index.ILType == typeof(int)) { return(new ILLazyLoadElement(this.Coding, this, index)); } else { throw new CodingException("İndis değerinin türü System.Int32 olmalı."); } } else { throw new CodingException("Obje bir dizi tipinde değildi."); } }
public override void AssignFrom(ILData ilValue) { if (((IBuilder)this.Coding).IsBuild) { throw new CodingException("Metodun tanımlandığı tip derlenmiş. Derlenmiş metotların gövdesi yeniden yazılamaz."); } throw new CodingException("This işaretçisine atama yapılamaz."); }
public void ElseIf(ILData comparer) { this.Generator.Emit(OpCodes.Ldloc, this._localComparerResult); this.Generator.Emit(OpCodes.Brtrue_S, this._endIf); Block thisBlock = this.getNewBlock(comparer); Block lastBlock = this._blocks[thisBlock.BlockNo - 1]; this.Generator.MarkLabel(lastBlock.EndBlock); ((IILPusher)comparer).Push(); this.Generator.Emit(OpCodes.Brfalse_S, thisBlock.EndBlock); this.Generator.Emit(OpCodes.Ldc_I4_1); this.Generator.Emit(OpCodes.Stloc, this._localComparerResult); }
public ILLazy Equals(ILData ilValue) { if (((IBuilder)this.Coding).IsBuild) { throw new CodingException("Metodun tanımlandığı tip derlenmiş. Derlenmiş metotların gövdesi yeniden yazılamaz."); } if (ilValue == null) { throw new ArgumentNullException("ilValue"); } ILData box = this.Coding.Box(ilValue); return(this.Coding.Invoke(ILVariable._equals, null, new ILData[] { this, box })); }
private Block getNewBlock(ILData comparer) { if (comparer.ILType != typeof(bool)) { throw new InvalidOperationException("Comparer type must be boolean."); } Block block = new Block { BlockNo = this._currentBlock, Comparer = comparer, EndBlock = this.Generator.DefineLabel() }; this._blocks.Add(block); this._currentBlock++; return(block); }
public override void AssignFrom(ILData ilValue) { if (((IBuilder)this.Coding).IsBuild) { throw new CodingException("Metodun tanımlandığı tip derlenmiş. Derlenmiş metotların gövdesi yeniden yazılamaz."); } if (ilValue == null) { throw new ArgumentNullException("ilValue."); } if (!this.ILType.IsAssignableFrom(ilValue.ILType)) { throw new TypeConvertException("Alanın türü, atanmak istenen objenin türünde değildi. Dönüştürme gerekli."); } ((IILPusher)ilValue).Push(); base.Generator.Emit(OpCodes.Stloc, this.EmitLocal); }
internal ILIfStatement(ILCoder coding, ILData comparer) { this.Coding = coding; this.Generator = coding.Generator; this.OuterIfStatement = this.Coding.CurrentIfBlock; this.Coding.CurrentIfBlock = this; this._blocks = new List <Block>(); this._endIf = this.Generator.DefineLabel(); this._localComparerResult = this.Generator.DeclareLocal(typeof(bool)); this.Generator.Emit(OpCodes.Ldc_I4_0); this.Generator.Emit(OpCodes.Stloc, this._localComparerResult); Block thisBlock = this.getNewBlock(comparer); ((IILPusher)comparer).Push(); this.Generator.Emit(OpCodes.Brfalse_S, thisBlock.EndBlock); this.Generator.Emit(OpCodes.Ldc_I4_1); this.Generator.Emit(OpCodes.Stloc, this._localComparerResult); }
public void RunBlock(ILData ifTrue) { ((IILPusher)ifTrue).Push(); this.Generator.Emit(OpCodes.Brtrue_S, this._beginLabel); this.Generator.MarkLabel(this._continueLabel); }
public override void AssignFrom(ILData ilValue) { this._variable.AssignFrom(ilValue); }
public abstract void AssignFrom(ILData ilValue);