2012-12-10 08:43:16 +00:00
|
|
|
/*
|
|
|
|
* WhileNode.h
|
|
|
|
*
|
|
|
|
* Created on: Dec 10, 2012
|
|
|
|
* Author: attero
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef WHILENODE_H_
|
|
|
|
#define WHILENODE_H_
|
|
|
|
|
|
|
|
#include "ASTStatement.h"
|
2012-12-10 11:37:29 +00:00
|
|
|
#include "ASTExpression.h"
|
2012-12-28 10:41:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* WhileNode is a while construct. It evaluates condition and executes
|
|
|
|
* body if it's true, when condition turn into false, WhileNode breaks loop.
|
|
|
|
*/
|
2012-12-10 08:43:16 +00:00
|
|
|
class WhileNode: public ASTStatement {
|
|
|
|
public:
|
2012-12-28 16:39:43 +00:00
|
|
|
WhileNode(ASTExpression * condition, ASTStatement * body);
|
2012-12-10 08:43:16 +00:00
|
|
|
virtual ~WhileNode();
|
2012-12-10 11:37:29 +00:00
|
|
|
ASTStatement * body;
|
2012-12-31 16:10:37 +00:00
|
|
|
virtual SenchaObject execute();
|
2013-01-10 10:46:41 +00:00
|
|
|
virtual SenchaObject evaluate() { return execute(); }
|
2012-12-10 11:37:29 +00:00
|
|
|
bool evaluate_condition();
|
|
|
|
|
2012-12-10 08:43:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* WHILENODE_H_ */
|