sencha-lang/Sencha-lang/AST/WhileNode.h

31 lines
612 B
C
Raw Normal View History

/*
* 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"
/**
* WhileNode is a while construct. It evaluates condition and executes
* body if it's true, when condition turn into false, WhileNode breaks loop.
*/
class WhileNode: public ASTStatement {
public:
WhileNode();
virtual ~WhileNode();
2012-12-10 11:37:29 +00:00
ASTStatement * body;
void add_condition(ASTExpression * expression);
void add_body(ASTStatement * statement);
virtual void execute();
bool evaluate_condition();
};
#endif /* WHILENODE_H_ */