Пример #1
0
        protected void EmitArgsThis(ZLMethodInfo zdesc, List <Exp> expArgs)
        {
            var        paramArr   = zdesc.ZParams;
            List <Exp> expArgsNew = CallAjuster.AdjustExps(paramArr, expArgs);

            EmitArgsExp(paramArr, expArgs.ToArray());
        }
Пример #2
0
        private Exp SearchBase()
        {
            if (this.ExpContext.ClassContext.GetSuperZType() == null)
            {
                return(null);
            }
            ZLClassInfo superZType = this.ExpContext.ClassContext.GetSuperZType();

            ZLMethodInfo[] descArray = superZType.SearchDeclaredZMethod(CallDesc);
            if (descArray.Length == 0)
            {
                return(null);
            }
            else if (descArray.Length > 1)
            {
                Errorf(this.Position, "找到多个过程,不能确定是属于哪一个简略使用的类型的过程");
                return(null);
            }
            else
            {
                ZLMethodInfo methodDesc  = descArray[0];
                ExpCallSuper expCallThis = new ExpCallSuper(this.ExpContext, CallDesc, methodDesc, this, ArgExps);
                return(expCallThis);
            }
        }
Пример #3
0
        public override Exp Analy( )
        {
            if (this.IsAnalyed)
            {
                return(this);
            }
            if (this.ExpContext == null)
            {
                throw new CCException();
            }
            if (SubjectExp.RetType is ZLEnumInfo)
            {
                Errorf(this.Position, "约定类型没有过程");
            }
            else
            {
                SubjectZType = (SubjectExp.RetType as ZLClassInfo);
                var zmethods = SubjectZType.SearchZMethod(ExpProcDesc);
                if (zmethods.Length == 0)
                {
                    Errorf(this.Position, "没有找到对应的过程");
                }
                else
                {
                    SearchedMethod = zmethods[0];
                    var defArgs = SearchedMethod.ZParams;
                    newExpArgs = AnalyArgLambda(defArgs, ArgExps);

                    this.RetType = SearchedMethod.RetZType;
                }
            }
            IsAnalyed = true;
            return(this);
        }
Пример #4
0
 private void ImportMethod(ZLMethodInfo zmethodInfo)
 {
     ZLMethodDesc[] itemNames = zmethodInfo.ZDescs;
     foreach (var desc in itemNames)
     {
         ImportMethodDesc(desc);
     }
 }
Пример #5
0
 public ExpCallSuper(ContextExp context, ZMethodCall expProcDesc, ZLMethodInfo searchedMethod, Exp srcExp, List <Exp> argExps)
     : base(context)
 {
     this.ExpProcDesc = expProcDesc;
     this.ZMethod     = searchedMethod;
     this.SrcExp      = srcExp;
     this.ArgExps     = argExps;
 }
Пример #6
0
 public override Exp Analy()
 {
     if (this.IsAnalyed)
     {
         return(this);
     }
     Method    = SearchZMethod();
     RetType   = Method.RetZType;
     IsAnalyed = true;
     return(this);
 }
Пример #7
0
 public override Exp Analy()
 {
     if (this.IsAnalyed)
     {
         return(this);
     }
     VarName   = VarToken.Text;
     Method    = SearchZMethod(VarName);
     RetType   = Method.RetZType;
     IsAnalyed = true;
     return(this);
 }
Пример #8
0
 public ExpCallUse(ContextExp context, ZMethodCall expProcDesc, ZLMethodInfo zmethod,
                   Exp srcExp, List <Exp> argExps) : base(context)
 {
     this.ExpProcDesc    = expProcDesc;
     this.SearchedMethod = zmethod;
     this.SrcExp         = srcExp;
     this.ArgExps        = argExps;
     foreach (Exp sub in ArgExps)
     {
         sub.ParentExp = this;
     }
 }
Пример #9
0
        public override Exp Analy()
        {
            if (this.IsAnalyed)
            {
                return(this);
            }
            MethodName = MethodToken.Text;
            CallDesc   = new ZMethodCall();
            CallDesc.Add(MethodName);

            Method    = SearchZMethod(MethodName);
            RetType   = Method.RetZType;
            IsAnalyed = true;
            return(this);
        }
Пример #10
0
        protected void EmitArgsExp(IEnumerable <Exp> args, ZLMethodInfo zmethod)
        {
            var method = zmethod.SharpMethod;

            EmitArgsExp(args, method);
        }