While.Parsing.Parser.WhileStmt C# (CSharp) Метод

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

public WhileStmt ( Statement &whileStmt ) : void
whileStmt While.AST.Statements.Statement
Результат void
        void WhileStmt(out Statement whileStmt)
        {
            Expression exp = null;
            StatementSequence whileBranch = null;
            Statement branchStmt = null;
            whileStmt = null;

            Expect(22);
            int sl = t.line; int sc = t.col; Token tok = t;
            Expr(out exp);
            if (!ExpectBool(exp, tok, true)) { return; }
            Expect(23);
            int el = t.line; int ec = t.col+t.val.Length;
            if (Options.BookVersion) {
            Stmt(out branchStmt);
            whileBranch = ToStatementSequence(branchStmt);
            } else if (StartOf(1)) {
            StmtSeq(out whileBranch);
            Expect(24);
            whileBranch.AddSequencePoint(t);
            } else SynErr(54);
            whileStmt = new While.AST.Statements.While((TypedExpression<bool>)exp, whileBranch);
            whileStmt.AddSequencePoint(sl,sc,el,ec);
        }