private BlockStatement compileFor() throws ParseException, IOException {
		// (
		getSymbol('(', "( is excepted after for");

		// <identifier>
		getNextToken(Tokenizer.IDENTIFIER, "identifier is excepted after (");

		// <var-name>
		Vector<Expression> expressions = new Vector<Expression>();
		Vector<Integer> lengths = new Vector<Integer>();
		BlockStatement block = new BlockStatement();
		String varName = compileLHS(null, expressions, lengths, block);

		// =
		if ((tokenizer.tokenType() != Tokenizer.SYMBOL) ||
			    (tokenizer.symbol() != '=')) {
			throw new ParseException("= is excepted after variable",
			                         tokenizer.lineNumber());
		}

		advance("program not ended");

		//<from-value>
		int from = compileConstValue().intValue();

		// to
		if ((tokenizer.tokenType() != Tokenizer.KEYWORD) ||
			    (tokenizer.keyword() != Tokenizer.KW_TO)) {
			throw new ParseException("to is expected", tokenizer.lineNumber());
		}

		advance("program not ended");

		//<to-value>
		int to = compileConstValue().intValue();

		// )
		if ((tokenizer.tokenType() != Tokenizer.SYMBOL) ||
			    (tokenizer.symbol() != ')')) {
			throw new ParseException(") is expected", tokenizer.lineNumber());
		}

		advance("program not ended");

		Statement forBlock = compileStatement();

		//duplicating the for block to-from+1 times
		for (; from <= to; from++) {
			//index not array
			if (expressions.isEmpty()) {
				block.addStatement(new AssignmentStatement(Function.getVar(varName),
				                                           new UnaryOpExpression(new PrimitiveOperator(PrimitiveOperator.ID_OP),
				                                                                 new IntConstant(BigInteger.valueOf(from)))));
			} else {
				block.addStatement(arrayStatment(varName, expressions, lengths,
				                                 new UnaryOpExpression(new PrimitiveOperator(PrimitiveOperator.ID_OP),
				                                                       new IntConstant(BigInteger.valueOf(from)))));
			}

			block.addStatement(forBlock.duplicate());
		}

		return block;
	}