#pragma once #include "AST/Base.h" #include #include namespace plsm { namespace ast { class WhileStmt : public Stmt { public: const std::shared_ptr condition; std::vector> body; WhileStmt(LOC_ARG, Expr *condition, const std::vector &body) : Stmt(sourceRange), condition(condition) { for (auto &stmt : body) { this->body.push_back(std::shared_ptr(stmt)); } } virtual boost::json::value toJson() override; static WhileStmt *fromJson(boost::json::value json); virtual std::any accept(ASTVisitor *visitor, std::any param) override { return visitor->visit(*this, param); } }; } // namespace ast } // namespace plsm