Blang/src/lib/Statement/IfStatement.cpp

54 lines
998 B
C++

#include "Statement/IfStatement.hpp"
ExprStatement* IfStatement::getCond(){
return reinterpret_cast<ExprStatement*>(_subExprs[COND]);
}
const ExprStatement* IfStatement::getCond() const{
return getCond();
}
void IfStatement::setCond(ExprStatement* e){
_subExprs[COND] = reinterpret_cast<Statement *>(e);
}
Statement* IfStatement::getThen(){
return _subExprs[THEN];
}
const Statement* IfStatement::getThen() const{
return getThen();
}
void IfStatement::setThen(Statement* s){
_subExprs[THEN] = s;
}
Statement* IfStatement::getElse(){
return _subExprs[ELSE];
}
const Statement* IfStatement::getElse() const{
return getElse();
}
void IfStatement::setElse(Statement* s){
_subExprs[ELSE] = s;
}
SourceLocation IfStatement::getIfLocation() const{
return _IfLoc;
}
void IfStatement::setIfLocation(SourceLocation loc){
_IfLoc = loc;
}
SourceLocation IfStatement::getThenLocation() const{
return _ElseLoc;
}
void IfStatement::setThenLocation(SourceLocation loc){
_ElseLoc = loc;
}