CSLE.CLS_Expression_Compiler.Compiler_Expression_Loop_For C# (CSharp) Метод

Compiler_Expression_Loop_For() публичный Метод

public Compiler_Expression_Loop_For ( IList tlist, ICLS_Environment content, int pos, int posend ) : ICLS_Expression
tlist IList
content ICLS_Environment
pos int
posend int
Результат ICLS_Expression
        public ICLS_Expression Compiler_Expression_Loop_For(IList<Token> tlist, ICLS_Environment content, int pos, int posend)
        {
            int b1;
            int fs1 = pos + 1;
            int fe1 = FindCodeAny(tlist, ref fs1, out b1);
            CLS_Expression_LoopFor value = new CLS_Expression_LoopFor(pos, posend, tlist[pos].line, tlist[posend].line);

            int testbegin = fs1 + 1;
            if (b1 != 1)
            {
                return null;
            }
            do
            {

                int fe2 = FindCodeAny(tlist, ref testbegin, out b1);


                ICLS_Expression subvalue;
                bool succ = Compiler_Expression(tlist, content, testbegin, fe2, out subvalue);
                //if (!succ) return null;
                if (subvalue != null)
                {
                    value.listParam.Add(subvalue);
                    testbegin = fe2 + 2;
                }
                else
                {
                    value.listParam.Add(null);
                    testbegin = fe2 + 2;
                }
            }
            while (testbegin <= fe1);

            if (value.listParam.Count != 3)
            {
                return null;
            }
            ICLS_Expression subvalueblock;

            int b2;
            int fs2 = fe1 + 1;
            int fecode = FindCodeAny(tlist, ref fs2, out b2);
            bool succ2 = Compiler_Expression_Block(tlist, content, fs2, fecode, out subvalueblock);
            if (succ2)
            {
                value.tokenEnd = fecode;
                value.lineEnd = tlist[fecode].line;
                value.listParam.Add(subvalueblock);
                return value;
            }
            return null;
        }