41 lines
814 B
C++
41 lines
814 B
C++
#ifndef DOSTATEMENT_HPP
|
|
#define DOSTATEMENT_HPP
|
|
|
|
#include <map>
|
|
|
|
#include "../Statement.hpp"
|
|
#include "Expr.hpp"
|
|
#include "../SourceLocation.hpp"
|
|
|
|
class DoStatement : public Statement
|
|
{
|
|
|
|
public:
|
|
DoStatement(Statement *body, Expr *cond, SourceLocation DL, SourceLocation WL);
|
|
|
|
Expr *getCond();
|
|
const Expr *getCond() const;
|
|
void setCond(Expr *);
|
|
|
|
Statement *getBody();
|
|
const Statement *getBody() const;
|
|
void setBody(Statement *);
|
|
|
|
SourceLocation getDoLocation() const;
|
|
void setDoLocation(SourceLocation);
|
|
|
|
SourceLocation getWhileLocation() const;
|
|
void setWhileLocation(SourceLocation);
|
|
|
|
private:
|
|
SourceLocation _doLoc;
|
|
enum StmtIdentifier
|
|
{
|
|
BODY, COND
|
|
};
|
|
std::map<StmtIdentifier, Statement*> _subStmts;
|
|
SourceLocation _whileLoc;
|
|
|
|
};
|
|
|
|
#endif |