private ParserImpl parseForLoop(final IScope currentScope) throws IOException
    {
        return new ParserImpl() {

            @Override
            public String toString()
            {
                return "parseForLoop";
            }

            @Override
            protected ASTNode doParse() throws Exception
            {
                final ForLoopNode result = new ForLoopNode( lexer.read(TokenType.FOR) );
                final IScope forScope = createNewScope( "for_loop_" , result , currentScope );
                result.setScope( forScope );

                result.merge( lexer.read(TokenType.PARENS_OPEN ) );

                if ( ! lexer.peek(TokenType.SEMICOLON ) ) 
                {
                    // parse initializer expressions
                    if ( ! parseExpressionList(forScope,true,true).parse() ) {
                        return null;
                    }
                    result.setInitializerBlock( (Block) lastResult );
                }
                result.merge( lexer.read(TokenType.SEMICOLON ) );

                // parse condition
                if ( ! lexer.peek(TokenType.SEMICOLON ) ) 
                {
                    if ( ! parseExpression(forScope, true, false ).parse() ) {
                        return null;
                    }
                    result.setCondition( (TermNode) lastResult );
                } else {
                    result.setCondition( new NumberLiteralNode( 1 , new TextRegion( lexer.currentOffset() , 0 ) ) );
                }

                result.merge( lexer.read(TokenType.SEMICOLON ) );

                if ( ! lexer.peek(TokenType.PARENS_CLOSE ) ) 
                {
                    // parse increment expressions
                    if ( ! parseExpressionList(forScope,false,false).parse() ) {
                        return null;
                    }					
                    result.setIncrementBlock( (Block) lastResult );					
                }

                result.merge( lexer.read(TokenType.PARENS_CLOSE ) );

                if ( lexer.peek(TokenType.BRACE_OPEN ) ) // parse body 
                {
                    if ( ! parseBlock(forScope,true).parse() ) {
                        return null;
                    }
                    Block bodyBlock = (Block) lastResult;
                    result.setBody( bodyBlock );
                } 
                else {
                    result.merge( lexer.read( TokenType.SEMICOLON ) );
                }
                return result;
            }
        };
    }