60 lines
1.0 KiB
C++
60 lines
1.0 KiB
C++
#include "DoStatement.h"
|
|
|
|
DoStatement::DoStatement(Statement *body, Expr *cond, SourceLocation DL, SourceLocation WL):
|
|
_doLoc(DL),
|
|
_whileLoc(WL)
|
|
{
|
|
_subStmts[BODY] = body;
|
|
_subStmts[COND] = cond;
|
|
}
|
|
|
|
|
|
Expr *DoStatement::getCond()
|
|
{
|
|
return reinterpret_cast<Expr *>(_subStmts.at(COND));
|
|
}
|
|
|
|
const Expr *DoStatement::getCond() const
|
|
{
|
|
return reinterpret_cast<Expr *>(_subStmts.at(COND));
|
|
}
|
|
|
|
void DoStatement::setCond(Expr *e)
|
|
{
|
|
_subStmts[COND] = reinterpret_cast<Statement *>(e);
|
|
}
|
|
|
|
Statement *DoStatement::getBody()
|
|
{
|
|
return _subStmts[BODY];
|
|
}
|
|
|
|
const Statement *DoStatement::getBody() const
|
|
{
|
|
return _subStmts.at(BODY);
|
|
}
|
|
|
|
void DoStatement::setBody(Statement *s)
|
|
{
|
|
_subStmts[BODY] = s;
|
|
}
|
|
|
|
SourceLocation DoStatement::getDoLocation() const
|
|
{
|
|
return _doLoc;
|
|
}
|
|
|
|
void DoStatement::setDoLocation(SourceLocation loc)
|
|
{
|
|
_doLoc = loc;
|
|
}
|
|
|
|
SourceLocation DoStatement::getWhileLocation() const
|
|
{
|
|
return _whileLoc;
|
|
}
|
|
|
|
void DoStatement::setWhileLocation(SourceLocation loc)
|
|
{
|
|
_whileLoc = loc;
|
|
} |