summaryrefslogtreecommitdiffstats
path: root/Sencha-lang/AST/RepeatStatement.h
blob: 2efb1ddaaaf73855217d18e4b089aa788f6e5132 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 * RepeatStatement.h
 *
 *  Created on: Dec 9, 2012
 *      Author: attero
 */

#ifndef REPEATSTATEMENT_H_
#define REPEATSTATEMENT_H_

#include "ASTStatement.h"
#include "ASTExpression.h"
/**
 * Repeat statement if very useful, when you need to do something n-times
 * you just repeat(n) {block_of_code}
 * It stores how many times it should be executed
 * and what should be executed, that is body.
 */
class RepeatStatement: public ASTStatement {
public:
	RepeatStatement(ASTExpression * expr, ASTStatement * statement);
	ASTStatement * body;
	ASTExpression * how_many_times_expr;
	virtual SenchaObject execute();
	virtual SenchaObject evaluate() { return execute(); }
	void add_body(ASTStatement * statement);
	virtual ~RepeatStatement();
};

#endif /* REPEATSTATEMENT_H_ */