2016-04-22 21:46:31 +02:00
|
|
|
#ifndef DOSTATEMENT_HPP
|
|
|
|
#define DOSTATEMENT_HPP
|
|
|
|
|
2016-11-28 07:29:13 +01:00
|
|
|
#include <map>
|
2016-04-22 21:46:31 +02:00
|
|
|
|
2016-11-28 07:29:13 +01:00
|
|
|
#include "../Statement.hpp"
|
|
|
|
#include "Expr.hpp"
|
|
|
|
#include "../SourceLocation.hpp"
|
2016-04-22 21:46:31 +02:00
|
|
|
|
2016-11-24 12:15:08 +01:00
|
|
|
class DoStatement : public Statement
|
|
|
|
{
|
2016-04-22 21:46:31 +02:00
|
|
|
|
|
|
|
public:
|
2016-11-24 12:15:08 +01:00
|
|
|
DoStatement(Statement *body, Expr *cond, SourceLocation DL, SourceLocation WL);
|
2016-04-22 21:46:31 +02:00
|
|
|
|
2016-11-24 12:15:08 +01:00
|
|
|
Expr *getCond();
|
|
|
|
const Expr *getCond() const;
|
|
|
|
void setCond(Expr *);
|
2016-04-22 21:46:31 +02:00
|
|
|
|
2016-11-24 12:15:08 +01:00
|
|
|
Statement *getBody();
|
|
|
|
const Statement *getBody() const;
|
|
|
|
void setBody(Statement *);
|
2016-04-22 21:46:31 +02:00
|
|
|
|
2016-11-24 12:15:08 +01:00
|
|
|
SourceLocation getDoLocation() const;
|
|
|
|
void setDoLocation(SourceLocation);
|
2016-04-22 21:46:31 +02:00
|
|
|
|
2016-11-24 12:15:08 +01:00
|
|
|
SourceLocation getWhileLocation() const;
|
|
|
|
void setWhileLocation(SourceLocation);
|
2016-04-22 21:46:31 +02:00
|
|
|
|
|
|
|
private:
|
2016-11-24 12:15:08 +01:00
|
|
|
SourceLocation _doLoc;
|
|
|
|
enum StmtIdentifier
|
|
|
|
{
|
|
|
|
BODY, COND
|
|
|
|
};
|
|
|
|
std::map<StmtIdentifier, Statement*> _subStmts;
|
|
|
|
SourceLocation _whileLoc;
|
2016-04-22 21:46:31 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|