Blang/src/include/Statement/DoStatement.hpp

40 lines
793 B
C++
Raw Normal View History

2016-04-22 21:46:31 +02:00
#ifndef DOSTATEMENT_HPP
#define DOSTATEMENT_HPP
#include "Statement.hpp"
2016-11-24 12:15:08 +01:00
#include "Expr.hpp"
2016-04-22 21:46:31 +02:00
#include "SourceLocation.hpp"
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