Esempio n. 1
0
        private ZType AnalyPropertyZType()
        {
            if (IsExists)
            {
                return(null);
            }
            bool isStatic = this.ParentProperties.ASTClass.ClassContext.IsStatic();

            ZPropertyCompiling.IsStatic = isStatic;
            ContextImportUse importUseContext = this.ParentProperties.ASTClass.FileContext.ImportUseContext;

            if (HasValue())
            {
                PropertyValueExp = AnalyPropertyValueExp();
                ZType ztype = PropertyValueExp.RetType;
                if (ztype != null)
                {
                    return(ztype);
                }
            }
            else
            {
                //if (Raw.NameToken.Text.StartsWith("子弹类型"))
                //{
                //    Debugr.WriteLine("子弹类型");
                //}
                ZType[] ztypes = importUseContext.SearchImportType(this.PropertyName);
                if (ztypes.Length == 1)
                {
                    return(ztypes[0]);
                }
                else if (ztypes.Length == 0)
                {
                    this.ExpContext.FileContext.Errorf(Raw.NameToken.Line, Raw.NameToken.Col, "没有搜索到属性‘" + PropertyName + "’的类型");
                }
                else
                {
                }
            }
            return(ZLangBasicTypes.ZOBJECT);
        }