00001 #include "ast.h" 00002 00003 00004 Ast::Ast(SrcPosition *position) { 00005 this->position = position; 00006 } 00007 00008 Ast::Ast(const Ast& ast){ 00009 (*this) = const_cast<Ast&>(ast); 00010 } 00011 00012 Ast::~Ast(){ 00013 delete this->position; 00014 } 00015 00016 SrcPosition *Ast::getPosition() { 00017 return this->position; 00018 } 00019 00020 void Ast::setPosition(SrcPosition *position){ 00021 this->position = position; 00022 } 00023 00024 Ast& Ast::operator = (const Ast& ast){ 00025 this->position = new SrcPosition(*ast.position); 00026 return *this; 00027 } 00028 00029 bool Ast::operator == (const Ast& ast) const{ 00030 return (!this->position)? false : (*(this->position)) == *(ast.position); 00031 }