summaryrefslogtreecommitdiff
path: root/node/StatementNode.hh
diff options
context:
space:
mode:
Diffstat (limited to 'node/StatementNode.hh')
-rw-r--r--node/StatementNode.hh35
1 files changed, 35 insertions, 0 deletions
diff --git a/node/StatementNode.hh b/node/StatementNode.hh
index 68c808f..1bd0cb6 100644
--- a/node/StatementNode.hh
+++ b/node/StatementNode.hh
@@ -25,6 +25,41 @@ class AssignStatementNode : public BaseNode {
std::shared_ptr<ExprNode> lhs_;
std::shared_ptr<ExprNode> rhs_;
};
+
+class IfStatementNode : public BaseNode {
+ public:
+ IfStatementNode(Context* context, std::shared_ptr<ExprNode> expr,
+ std::shared_ptr<BaseNode> ThenPart,
+ std::shared_ptr<BaseNode> ElsePart);
+ virtual Value CodeGen() override;
+
+ protected:
+ std::shared_ptr<ExprNode> expr_;
+ std::shared_ptr<BaseNode> ThenPart_;
+ std::shared_ptr<BaseNode> ElsePart_;
+};
+
+class WhileStatementNode : public BaseNode {
+ public:
+ WhileStatementNode(Context* context, std::shared_ptr<ExprNode> expr,
+ std::shared_ptr<BaseNode> WhileBody);
+ virtual Value CodeGen() override;
+
+ protected:
+ std::shared_ptr<ExprNode> expr_;
+ std::shared_ptr<BaseNode> WhileBody_;
+};
+
+class RepeatStatementNode : public BaseNode {
+ public:
+ RepeatStatementNode(Context* context, std::shared_ptr<ExprNode> expr,
+ std::shared_ptr<BaseNode> RepeatBody);
+ virtual Value CodeGen() override;
+
+ protected:
+ std::shared_ptr<ExprNode> expr_;
+ std::shared_ptr<BaseNode> RepeatBody_;
+};
} // namespace pcc
#endif