summaryrefslogtreecommitdiff
path: root/node/StatementNode.hh
diff options
context:
space:
mode:
Diffstat (limited to 'node/StatementNode.hh')
-rw-r--r--node/StatementNode.hh16
1 files changed, 16 insertions, 0 deletions
diff --git a/node/StatementNode.hh b/node/StatementNode.hh
index 66c2517..fa8fbe4 100644
--- a/node/StatementNode.hh
+++ b/node/StatementNode.hh
@@ -69,6 +69,22 @@ class RepeatStatementNode : public BaseNode {
std::shared_ptr<BaseNode> RepeatBody_;
};
+class ForStatementNode : public BaseNode {
+ public:
+ ForStatementNode(Context* context, std::shared_ptr<ExprNode> variable,
+ std::shared_ptr<ExprNode> start,
+ std::shared_ptr<ExprNode> end, bool IsUpward,
+ std::shared_ptr<BaseNode> ForBody);
+ virtual Value CodeGen() override;
+
+ protected:
+ std::shared_ptr<ExprNode> variable_;
+ std::shared_ptr<ExprNode> start_;
+ std::shared_ptr<ExprNode> end_;
+ bool IsUpward_;
+ std::shared_ptr<BaseNode> ForBody_;
+};
+
class BreakStatementNode : public BaseNode {
public:
BreakStatementNode(Context* context);