public final void forStmt() throws RecognitionException
    {
        
        AST ast1 = null, ast2 = null, ast3 = null, ast4 = null;
        
        try {
            // CPP.g:366:3: ( 'for' '(' ( forInit )? ( expr )? ';' ( exprList )? ')' stmt )
            // CPP.g:366:5: 'for' '(' ( forInit )? ( expr )? ';' ( exprList )? ')' stmt
            {
                this.match(this.input, 47, FOLLOW_47_in_forStmt1441);
                if (this.state.failed) {
                    return;
                }
                this.match(this.input, 42, FOLLOW_42_in_forStmt1443);
                if (this.state.failed) {
                    return;
                }
                // CPP.g:367:5: ( forInit )?
                int alt21 = 2;
                alt21 = this.dfa21.predict(this.input);
                switch (alt21)
                {
                    case 1:
                        // CPP.g:0:0: forInit
                    {
                        this.pushFollow(FOLLOW_forInit_in_forStmt1450);
                        this.forInit();
                        
                        this.state._fsp--;
                        if (this.state.failed) {
                            return;
                        }
                        
                    }
                        break;
                    
                }
                
                if (this.state.backtracking == 0) {
                    ast1 = this.out;
                    this.out = null;
                }
                // CPP.g:368:5: ( expr )?
                int alt22 = 2;
                int LA22_0 = this.input.LA(1);
                
                if ((((LA22_0 >= IDENTIFIER) && (LA22_0 <= FLOATING_POINT_LITERAL)) || (LA22_0 == 30) || (LA22_0 == 42)
                        || (LA22_0 == 44) || ((LA22_0 >= 80) && (LA22_0 <= 81)) || ((LA22_0 >= 84) && (LA22_0 <= 87)))) {
                    alt22 = 1;
                }
                switch (alt22)
                {
                    case 1:
                        // CPP.g:0:0: expr
                    {
                        this.pushFollow(FOLLOW_expr_in_forStmt1459);
                        this.expr();
                        
                        this.state._fsp--;
                        if (this.state.failed) {
                            return;
                        }
                        
                    }
                        break;
                    
                }
                
                if (this.state.backtracking == 0) {
                    ast2 = this.out;
                    this.out = null;
                }
                this.match(this.input, 23, FOLLOW_23_in_forStmt1468);
                if (this.state.failed) {
                    return;
                }
                // CPP.g:370:5: ( exprList )?
                int alt23 = 2;
                int LA23_0 = this.input.LA(1);
                
                if ((((LA23_0 >= IDENTIFIER) && (LA23_0 <= FLOATING_POINT_LITERAL)) || (LA23_0 == 30) || (LA23_0 == 42)
                        || (LA23_0 == 44) || ((LA23_0 >= 80) && (LA23_0 <= 81)) || ((LA23_0 >= 84) && (LA23_0 <= 87)))) {
                    alt23 = 1;
                }
                else if ((LA23_0 == 43)) {
                    
                    if ((this.synpred45_CPP())) {
                        alt23 = 1;
                    }
                }
                switch (alt23)
                {
                    case 1:
                        // CPP.g:0:0: exprList
                    {
                        this.pushFollow(FOLLOW_exprList_in_forStmt1475);
                        this.exprList();
                        
                        this.state._fsp--;
                        if (this.state.failed) {
                            return;
                        }
                        
                    }
                        break;
                    
                }
                
                if (this.state.backtracking == 0) {
                    ast3 = this.out;
                    this.out = null;
                }
                this.match(this.input, 43, FOLLOW_43_in_forStmt1484);
                if (this.state.failed) {
                    return;
                }
                this.pushFollow(FOLLOW_stmt_in_forStmt1491);
                this.stmt();
                
                this.state._fsp--;
                if (this.state.failed) {
                    return;
                }
                if (this.state.backtracking == 0) {
                    ast4 = this.out;
                    this.out = null;
                }
                if (this.state.backtracking == 0) {
                    this.out = new ForStmtAST((ForInitAST) ast1, (ExprAST) ast2, (ExprListAST) ast3, (OneStmtAST) ast4);
                }
                
            }
            
        }
        catch (RecognitionException re) {
            this.reportError(re);
            this.recover(this.input, re);
        } finally {
        }
        return;
    }