Exemplo n.º 1
0
        public override Exp Analy( )
        {
            TypeExp    = AnalySubExp(TypeExp) as ExpType;       //TypeExp = ArgExp.Analy();
            BracketExp = AnalySubExp(BracketExp) as ExpBracket; //BracketExp.Analy();
            if (!AnalyCorrect)
            {
                return(this);
            }

            //Type subjectType = TypeExp.RetType.SharpType;
            if (IsList())
            {
                ExpNewList newListExp = new ExpNewList(this.ExpContext, TypeExp, BracketExp);
                //newListExp.SetContext(this.ExpContext);
                return(newListExp.Analy());
            }
            else
            {
                var args = BracketExp.GetCallNormalArgs();
                //ZMethodArgCollection argCollection = new ZMethodArgCollection(args);
                newDesc      = new ZNewDesc(args);
                ZConstructor = (TypeExp.RetType as ZClassType).FindDeclaredZConstructor(newDesc);
                if (ZConstructor == null)
                {
                    ErrorE(BracketExp.Postion, "没有正确的创建过程");
                }
                else
                {
                    RetType = TypeExp.RetType;
                }
            }
            return(this);
        }