Blang/src/lib/src/Statement/GotoStatement.cpp

46 lines
783 B
C++

#include "GotoStatement.h"
GotoStatement::GotoStatement(LabelDecl* label, SourceLocation gl, SourceLocation ll):
_label(label),
_gotoLoc(gl)
{
}
LabelDecl *GotoStatement::getLabel()
{
return _label;
}
const LabelDecl *GotoStatement::getLabel() const
{
return _label;
}
void GotoStatement::setLabel(LabelDecl * lbl)
{
_label = lbl;
}
SourceLocation GotoStatement::getGotoLocation() const
{
return _gotoLoc;
}
void GotoStatement::setGotoLocation(SourceLocation loc)
{
_gotoLoc = loc;
}
SourceLocation GotoStatement::getLabelLocation() const
{
if (_label)
return _label->getLabelLocation();
return SourceLocation();
}
void GotoStatement::setLabelLocation(SourceLocation loc)
{
if (_label)
_label->setLabelLocation(loc);
}