00001 #include <typeinfo> 00002 #include "simpleidentifierlist.h" 00003 using namespace std; 00004 00005 Ast& SimpleIdentifierList::operator = (const Ast& ast) { 00006 const SimpleIdentifierList& simpleIdentifierList = dynamic_cast<const SimpleIdentifierList&>(ast); 00007 00008 IdentifierList::operator=(ast); 00009 this->identifier = simpleIdentifierList.identifier ? dynamic_cast<Identifier*>(&(simpleIdentifierList.identifier->clone())) : 0; 00010 00011 return *(this); 00012 } 00013 00014 bool SimpleIdentifierList::operator == (const Ast& ast) const { 00015 bool result = false; 00016 const SimpleIdentifierList& simpleIdentifierList = dynamic_cast<const SimpleIdentifierList&>(ast); 00017 00018 if (typeid(ast) != typeid(SimpleIdentifierList)) 00019 return false; 00020 00021 if (this->identifier) 00022 result = (*(this->identifier) == *(simpleIdentifierList.identifier)); 00023 00024 return result && IdentifierList::operator==(ast); 00025 } 00026