-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIfElseStatement.hpp
More file actions
46 lines (35 loc) · 882 Bytes
/
IfElseStatement.hpp
File metadata and controls
46 lines (35 loc) · 882 Bytes
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#pragma once
#include "Statement.hpp"
#include "Expression.hpp"
namespace ast {
class IfElseStatement : public Statement {
public:
IfElseStatement(Expression* expression, Statement* first, Statement* second) :
expression_(expression), first_(first), second_(second) {}
void Accept(Visitor* visitor) override {
visitor->Visit(this);
}
Expression* GetExpression() const {
return expression_;
}
void SetExpression(Expression* expression) {
expression_ = expression;
}
Statement* GetFirstStatement() const {
return first_;
}
void SetFirstStatement(Statement* first) {
first_ = first;
}
Statement* GetSecondStatement() const {
return second_;
}
void SetSecondStatement(Statement* second) {
second_ = second;
}
private:
Expression* expression_;
Statement* first_;
Statement* second_;
};
} // namespace ast