public static Var New(BlockBase parent, VarDeclare var) { var ret = new Var(); ret.Parent = parent; ret.name = var.Name; ret.Reference = var; return ret; }
public static Var NewName(BlockBase parent, string name) { var ret = new Var(); ret.Parent = parent; ret.name = name; ret.Reference = parent.GetVar(name); if (ret.Reference == null) throw ret.Abort("undefined pointer: " + name); return ret; }
protected override void MakeUpInternal() { if (HasThis && CallType != CallType.CDecl && (name == Define.Constructor || name == Define.Destructor)) { throw Abort("{0}: must be __cdecl", FullName); } if (IsOverride) { var st = (Parent as Define).GetBaseStruct(); Function vf = null; if (st != null) vf = st.GetFunction(name); if (vf == null || (!vf.IsVirtual && !vf.IsOverride)) throw Abort("can not find virtual: {0}", name); first = vf.first; ovrptr = Var.NewName(Parent, "virtual_" + name); var setvp = Set.New(Parent, ovrptr, Variant.New(ovrfunc)); Parent.AddSentence(setvp); } }
protected void CheckThisArg() { if (Parent is Define && !IsStatic) { var type = Types.ToVarType((Parent as Define).Type); args.Add(Arg.New(this, "this", type)); thisptr = This.New(this); } }
protected void CheckAnonymousMember() { if (!isAnonymous || HasThis) return; var f = Parent as Function; if (f == null || !f.HasThis) return; InsertArg(Arg.New(this, "this", f.thisptr.Type)); thisptr = This.New(this); }