示例#1
0
 internal override Node Bind(Binder b)
 {
     if (Params != null)
     {
         foreach (var p in Params)
         {
             b.AddLocal(p.LookupName, b.ObjectType);
             p.Bind(b);
         }
     }
     ParamArray = b.AddParam(XSharpSpecialNames.ClipperArgs, Binder.ArrayOf(b.ObjectType));
     b.AddConstant(XSharpSpecialNames.ClipperArgCount, Constant.Create(Params?.Count ?? 0));
     PCount = b.AddLocal(XSharpSpecialNames.ClipperPCount, Compilation.Get(NativeType.Int32));
     if (Body != null)
     {
         b.Bind(ref Body);
         if (Body.Datatype.NativeType != NativeType.Void)
         {
             Expr e = Body.Exprs.Last();
             b.Convert(ref e, b.ObjectType);
             Body.Exprs[Body.Exprs.Count - 1] = e;
         }
     }
     Symbol = b.ObjectType;
     return(null);
 }
        internal override Node Bind(Binder b)
        {
            b.Entity = this;

            ParamArray = b.AddParam(XSharpSpecialNames.ClipperArgs, Binder.ArrayOf(b.ObjectType));
            //b.AddConstant(XSharpSpecialNames.ClipperArgCount, Constant.Create(Params?.Count ?? 0));
            PCount = b.AddLocal(XSharpSpecialNames.ClipperPCount, Compilation.Get(NativeType.Int32));

            Symbol = b.ObjectType;
            if (Body != null)
            {
                b.BindStmt(ref Body);
            }
            return(null);
        }
示例#3
0
 internal override Node Bind(Binder b)
 {
     b.Entity = this;
     if (Params != null)
     {
         foreach (var p in Params)
         {
             b.AddLocal(p.LookupName, b.ObjectType, true);
             p.Bind(b);
         }
     }
     ParamArray = b.AddParam(XSharpSpecialNames.ClipperArgs, Binder.ArrayOf(b.ObjectType));
     b.AddConstant(XSharpSpecialNames.ClipperArgCount, Constant.Create(Params?.Count ?? 0));
     PCount = b.AddLocal(XSharpSpecialNames.ClipperPCount, Compilation.Get(NativeType.Int32));
     if (Body != null)
     {
         b.BindStmt(ref Body);
     }
     return(null);
 }