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