示例#1
0
 private void AnalyProcDesc()
 {
     CallDesc = new ZMethodCall();
     ArgExps  = new List <Exp>();
     foreach (var item in this.Elements)
     {
         //if (this.Elements[0].ToString().StartsWith("战场参数的绘图器"))
         //{
         //    Console.WriteLine(this.ToString());
         //}
         if (item is ExpProcNamePart)
         {
             ExpProcNamePart namePartExp = item as ExpProcNamePart;
             CallDesc.Add(namePartExp.PartName);
         }
         else if (item is ExpBracket)
         {
             ExpBracket   bracketExp   = item as ExpBracket;
             ZBracketCall zbracketDesc = bracketExp.GetCallDesc();
             CallDesc.Add(zbracketDesc);
             ArgExps.AddRange(bracketExp.GetSubExps());
         }
         else
         {
             throw new CCException();
         }
     }
 }
示例#2
0
        private ZLMethodInfo SearchZMethod(string name)
        {
            ZMethodCall calldesc = new ZMethodCall();

            calldesc.Add(name);
            var methods = this.ClassContext.SearchSuperProc(calldesc);

            return(methods[0]);
        }
示例#3
0
        private ZLMethodInfo SearchZMethod(string name)
        {
            ZMethodCall calldesc = new ZMethodCall();

            calldesc.Add(name);
            ContextImportUse contextiu = this.FileContext.ImportUseContext;

            return(contextiu.SearchUseMethod(calldesc)[0]);
        }
示例#4
0
        public bool IsThisMethodSingle(string name)
        {
            ZMethodCall calldesc = new ZMethodCall();

            calldesc.Add(name);
            //ZClassCompilingType zcc = this.ClassContext.ThisCompilingType;
            var methods = this.ClassContext.SearchThisProc(calldesc);

            return(methods.Length > 0);
        }
示例#5
0
        public bool IsUseMethodSingle(string name)
        {
            ContextImportUse importUseContext = this.ClassContext.FileContext.ImportUseContext;
            //ContextUse cu = this.ClassContext.FileContext.UseContext;
            ZMethodCall calldesc = new ZMethodCall();

            calldesc.Add(name);
            var methods = importUseContext.SearchUseMethod(calldesc);

            return(methods != null && methods.Length > 0);
        }
示例#6
0
        private ZCMethodInfo SearchZMethod(string name)
        {
            ZMethodCall calldesc = new ZMethodCall();

            calldesc.Add(name);
            var methods = this.ClassContext.SearchThisProc(calldesc);

            if (methods.Length == 0)
            {
                throw new CCException();
            }
            return(methods[0]);
        }
示例#7
0
        private ZLMethodInfo SearchZMethod(string name)
        {
            ZType       mainType = SubjectAnalyedExp.RetType;
            ZMethodCall calldesc = new ZMethodCall();

            calldesc.Add(name);
            if (mainType is ZLClassInfo)
            {
                var methods = (mainType as ZLClassInfo).SearchZMethod(calldesc);
                return(methods[0]);
            }
            return(null);
        }
示例#8
0
        public bool IsSuperMethodSingle(string name)
        {
            if (this.IsStatic())
            {
                return(false);
            }
            ZMethodCall calldesc = new ZMethodCall();

            calldesc.Add(name);
            var methods = this.ClassContext.SearchSuperProc(calldesc);

            return(methods.Length > 0);
        }
示例#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);
        }