summaryrefslogtreecommitdiffstats
path: root/Sencha-lang/AST/IfNode.h
blob: 7cc05154e1547e0eb6db09236d464e71e0ffc185 (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
31
32
/*
 * IfNode.h
 *
 *  Created on: Nov 18, 2012
 *      Author: attero
 */

#ifndef IFNODE_H_
#define IFNODE_H_

#include "ASTStatement.h"
#include "ASTExpression.h"

class IfNode : public ASTStatement
{
public:
	void add_condition(ASTExpression * expression);
	void add_body(ASTStatement * statement);
	void add_else_block(ASTStatement * statement);
	bool is_else;
	virtual std::string debug();
	virtual void execute();
	bool evaluate_condition();
	ASTNode * condition() { return children[0]; }
	ASTNode * then_block() { return children[1]; }
	ASTNode * else_block() { return children[2]; }
	IfNode(ASTNode * parent);
	virtual ~IfNode();
};


#endif /* IFNODE_H_ */