コード例 #1
0
        public ICLS_Expression Compiler_Expression_FunctionNew(IList <Token> tlist, CLS_Content content, int pos, int posend)
        {
            CLS_Expression_FunctionNew func = new CLS_Expression_FunctionNew(pos, posend);

            func.type = content.environment.GetTypeByKeyword(tlist[pos + 1].text);
            int begin = pos + 3;
            int dep;
            int end = FindCodeAny(tlist, ref begin, out dep);

            if (tlist[pos + 2].type == TokenType.PUNCTUATION && tlist[pos + 2].text == "(")
            {
                do
                {
                    ICLS_Expression param;
                    bool            succ = Compiler_Expression(tlist, content, begin, end, out param);
                    if (succ && param != null)
                    {
                        func.listParam.Add(param);
                    }
                    begin = end + 2;
                    end   = FindCodeAny(tlist, ref begin, out dep);
                }while (end < posend && begin <= end);


                return(func);
            }
            //一般函数
            return(null);
        }
コード例 #2
0
        public ICLS_Expression Compiler_Expression_FunctionNew(IList<Token> tlist, CLS_Content content, int pos, int posend)
        {
            CLS_Expression_FunctionNew func = new CLS_Expression_FunctionNew(pos,posend);
            func.type =content.environment.GetTypeByKeyword( tlist[pos+1].text);
            int begin = pos + 3;
            int dep;
            int end = FindCodeAny(tlist, ref begin, out dep);

            if (tlist[pos + 2].type == TokenType.PUNCTUATION && tlist[pos + 2].text == "(")
            {
                do
                {
                    ICLS_Expression param;
                    bool succ = Compiler_Expression(tlist, content, begin, end, out param);
                    if (succ && param != null)
                    {
                        func.listParam.Add(param);
                    }
                    begin = end + 2;
                    end = FindCodeAny(tlist, ref begin, out dep);

                }
                while (end < posend && begin <= end);

                return func;
            }
            //一般函数
            return null;
        }