36 lines
696 B
C++
36 lines
696 B
C++
#ifndef WHILESTATEMENT_HPP
|
|
#define WHILESTATEMENT_HPP
|
|
|
|
#include <map>
|
|
|
|
#include "../Statement.hpp"
|
|
#include "Expr.hpp"
|
|
#include "../SourceLocation.hpp"
|
|
|
|
class WhileStatement : public Statement
|
|
{
|
|
|
|
public:
|
|
WhileStatement(Expr* cond, Statement* body, SourceLocation wl);
|
|
|
|
Expr *getCond();
|
|
const Expr *getCond() const;
|
|
void setCond(Expr *);
|
|
|
|
Statement *getBody();
|
|
const Statement *getBody() const;
|
|
void setBody(Statement *);
|
|
|
|
SourceLocation getWhileLocation() const;
|
|
void setWhileLocation(SourceLocation);
|
|
|
|
private:
|
|
SourceLocation _whileLoc;
|
|
enum StmtIdentifier
|
|
{
|
|
COND, BODY
|
|
};
|
|
std::map<StmtIdentifier, Statement*> _subStmts;
|
|
};
|
|
|
|
#endif |