Ejemplo n.º 1
0
Archivo: Var.cs Proyecto: 7shi/LLPML
 public static Var New(BlockBase parent, VarDeclare var)
 {
     var ret = new Var();
     ret.Parent = parent;
     ret.name = var.Name;
     ret.Reference = var;
     return ret;
 }
Ejemplo n.º 2
0
Archivo: Var.cs Proyecto: 7shi/LLPML
 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;
 }
Ejemplo n.º 3
0
 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);
     }
 }
Ejemplo n.º 4
0
 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);
     }
 }
Ejemplo n.º 5
0
        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);
        }