public MonadicOperationStructure(TypeStructure rt, ExpressionStructure exp, BuilderStructure call) : base(rt) { Expression = exp; Call = call; AppendChild(Expression); }
public void Initialize(BuilderStructure inst, IReadOnlyList<TypeStructure> prms, TypeStructure di, MethodInfo info = null) { BaseInstance = inst; GenericParameter = prms; DeclaringInstance = di; Info = info; }
public BlockStructure(TypeStructure rt, IReadOnlyList<CilStructure> exps, bool isInline) : base(rt) { Expressions = exps; IsInline = isInline; AppendChild(exps); }
internal void Initialize(string name, TypeAttributes attr, IReadOnlyList<GenericParameterStructure> gnr, TypeStructure bt, IReadOnlyList<TypeStructure> imp, BlockStructure block = null, Type info = null) { Generics = gnr; BaseType = bt; Implements = imp; AppendChild(Generics); base.Initialize(name, attr, block, info); }
public CacheStructure(TypeStructure rt, ExpressionStructure exp) : base(rt) { Expression = exp; Cache = new LocalStructure(Expression.ResultType); AppendChild(Expression); AppendChild(Cache); }
public ParameterStructure(string name, ParameterAttributes attr, TypeStructure pt, CilStructure def) { Name = name; Attributes = attr; ParamType = pt; DefaultValue = def; AppendChild(DefaultValue); }
public ParameterStructure(TypeStructure pt) { Name = "this"; IsThis = true; Attributes = ParameterAttributes.None; ParamType = pt; DefaultValue = null; AppendChild(DefaultValue); }
public FieldStructure(string name, FieldAttributes attr, TypeStructure dt, object def, bool isEnumField, FieldInfo info = null) { Name = name; Attributes = attr; DataType = dt; DefaultValue = def; IsEnumField = isEnumField; Info = info; }
public void Initialize(string name, bool isInstance, MethodAttributes attr, IReadOnlyList<GenericParameterStructure> gnr, IReadOnlyList<ParameterStructure> arg, TypeStructure ret, BlockStructure block = null, bool isDtr = false, MethodInfo info = null) { Name = name; Generics = gnr; ReturnType = ret; IsDefaultThisReturn = isDtr; AppendChild(Generics); Info = info; base.Initialize(isInstance, attr, arg, block); }
public LoopStructure(TypeStructure rt) : base(rt) { BreakLabel = new LabelStructure(); ContinueLabel = new LabelStructure(); PlungeLabel = new LabelStructure(); AppendChild(BreakLabel); AppendChild(ContinueLabel); AppendChild(PlungeLabel); }
public LoopLocalStructure(string name, TypeStructure dt, CilStructure def) : base(dt) { Name = name; DataType = dt; DefaultValue = def; Local = new LocalStructure(name, dt); AppendChild(DefaultValue); AppendChild(Local); }
public LogicalStructure(TypeStructure rt, ExpressionStructure left, ExpressionStructure right, bool isOr) : base(rt) { Left = left; Right = right; IsOr = isOr; Exit = new LabelStructure(); AppendChild(Left); AppendChild(Right); AppendChild(Exit); }
public DyadicOperationStructure(TypeStructure rt, ExpressionStructure left, ExpressionStructure right, BuilderStructure call, ExpressionStructure next = null) : base(rt) { Left = left; Right = right; Call = call; Next = next; AppendChild(Left); if (Next == null) { AppendChild(Right); } else { AppendChild(Next); } }
public CallStructure(TypeStructure rt, BuilderStructure call, ExpressionStructure pre, CilStructure variant) : base(rt) { Call = call; Pre = pre; Access = pre; Variant = variant; Arguments = new List<ExpressionStructure>(); Converters = new List<BuilderStructure>(); if (Access != null) { AppendChild(Access); } if (Arguments != null) { AppendChild(Arguments); } }
public CallStructure(TypeStructure rt, BuilderStructure call, ExpressionStructure pre, CilStructure access, CilStructure variant, IReadOnlyList<ExpressionStructure> args, IReadOnlyList<BuilderStructure> convs, bool isVariadic = false) : base(rt) { Call = call; Pre = pre; Access = access; Variant = variant; Arguments = args; Converters = convs; IsVariadic = isVariadic; if (Access != null) { AppendChild(Access); } if (Arguments != null) { AppendChild(Arguments); } }
public LocalStructure(string name, TypeStructure dt) { Name = name; DataType = dt; }
public LocalStructure(TypeStructure dt) { DataType = dt; }
internal LocalBuilder CreateLocal(TypeStructure dt) { return Generator.DeclareLocal(dt.GainType()); }
public void Initialize(TypeStructure baseType, IReadOnlyList<TypeStructure> prms, Type info = null) { BaseType = baseType; GenericParameter = prms; Info = info; }
public GotoStructure(TypeStructure rt, LabelStructure label) : base(rt) { Label = label; }
internal override BuilderStructure RenewInstance(TypeStructure type) { var ret = new ConstructorStructure(); ret.Info = type.RenewConstructor(this); return ret; }
internal void GenerateArray(int length, TypeStructure type) { GeneratePrimitive(length); Generator.Emit(OpCodes.Newarr, type.GainType()); }
internal void GenerateList(TypeStructure type, IReadOnlyList<CilStructure> values) { var lt = type.GainType(); var lc = lt.GetConstructor(Type.EmptyTypes); var ladd = lt.GetMethod("Add"); var local = Generator.DeclareLocal(lt); Generator.Emit(OpCodes.Newobj, lc); Generator.Emit(OpCodes.Stloc, local); foreach (var v in values) { Generator.Emit(OpCodes.Ldloc, local); var exp = (ExpressionStructure)v; exp.BuildCode(); Generator.Emit(OpCodes.Call, ladd); } Generator.Emit(OpCodes.Ldloc, local); }
public ValueStructure(TypeStructure rt, dynamic value) : base(rt) { Value = value; }
public LocalStructure(TypeStructure dt, CodeGenerator cg) { DataType = dt; Builder = cg.CreateLocal(DataType); }
public ReturnStructure(TypeStructure rt, ExpressionStructure exp) : base(rt) { Expression = exp; AppendChild(Expression); }
internal override BuilderStructure RenewInstance(TypeStructure type) { var ret = new LoadStoreStructure(IsStore); ret.BaseInstance = type; return this; }
internal virtual BuilderStructure RenewInstance(TypeStructure type) { throw new NotSupportedException(); }
public ExpressionStructure(TypeStructure rt) { ResultType = rt; }
public StringStructure(TypeStructure rt, IReadOnlyList<ExpressionStructure> exps) : base(rt) { AppendChild(exps); }