Esempio n. 1
0
        TKTProcDesc searchNewProc(ClassContext classContext, TKTProcDesc expProcDesc)
        {
            var procArray = ClassContextHelper.SearchProc(classContext, expProcDesc);

            if (procArray.Length == 1)
            {
                return(procArray[0]);
            }
            else if (procArray.Length > 1)
            {
                error("找到多个过程,不能确定是属于哪一个简略使用的类型的过程");
            }
            else if (procArray.Length == 0)
            {
                //error("没有找到对应的过程'" + this.ToCode() + "'");
            }
            return(null);
        }
Esempio n. 2
0
        Tuple <Exp, int> analyCall(AnalyExpContext context)
        {
            TKTProcDesc procdesc = new TKTProcDesc();

            procdesc.Add(IdentName);
            var procArray = ClassContextHelper.SearchProc(classContext, procdesc);

            if (procArray.Length == 1)
            {
                InvokeSimplestExp exp = new InvokeSimplestExp(this, IdentToken, procArray[0]);
                return(new Tuple <Exp, int> (exp, 1));
            }
            else if (procArray.Length == 0)
            {
                return(new Tuple <Exp, int>(null, 0));
            }
            else
            {
                errorf("有多个相同名称'{0}'过程,不能确定是哪个过程", IdentName);
                return(new Tuple <Exp, int>(null, procArray.Length));
            }
        }
Esempio n. 3
0
        TKTProcDesc searchProc(ClassContext classContext)
        {
            var procArray = ClassContextHelper.SearchProc(classContext, ExpProcDesc);

            if (procArray.Length == 1)
            {
                //procArray[0].AdjustBracket(procDesc);
                return(procArray[0]);
            }
            else if (procArray.Length > 1)
            {
                error("找到多个过程,不能确定是属于哪一个简略使用的类型的过程");
            }
            else if (procArray.Length == 0)
            {
                if (Elements[0] is BracketExp)
                {
                    SubjectExp  = Elements[0];
                    subjType    = SubjectExp.RetType;
                    ExpProcDesc = ExpProcDesc.CreateTail();
                    procArray   = ClassContextHelper.SearchProc(classContext, subjType, ExpProcDesc);

                    if (procArray.Length == 1)
                    {
                        return(procArray[0]);
                    }
                    else if (procArray.Length == 0)
                    {
                        error("没有找到对应的过程'" + this.ToCode() + "'");
                    }
                    else if (procArray.Length > 1)
                    {
                        error("找到多个过程,不能确定是属于哪一个简略使用的类型的过程:'" + this.ToCode() + "'");
                    }
                }
            }
            return(null);
        }