Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

sequentialdeclaration.cpp

Go to the documentation of this file.
00001 #include <typeinfo>
00002 #include "sequentialdeclaration.h"
00003 using namespace std;
00004 
00005 Ast& SequentialDeclaration::operator = (const Ast& ast) {
00006         const SequentialDeclaration& sequentialDeclaration = dynamic_cast<const SequentialDeclaration&>(ast);
00007 
00008         Declaration::operator=(ast);
00009         this->declaration = sequentialDeclaration.declaration ? dynamic_cast<Declaration*>(&(sequentialDeclaration.declaration->clone())) : 0;
00010         this->simpleDeclaration = sequentialDeclaration.simpleDeclaration ? dynamic_cast<SimpleDeclaration*>(&(sequentialDeclaration.simpleDeclaration->clone())) : 0;
00011 
00012         return *(this);
00013 }
00014 
00015 bool SequentialDeclaration::operator == (const Ast& ast) const {
00016         bool result = false;
00017         const SequentialDeclaration& sequentialDeclaration = dynamic_cast<const SequentialDeclaration&>(ast);
00018 
00019         if (typeid(ast) != typeid(SequentialDeclaration))
00020                 return false;
00021 
00022         if (this->declaration && this->simpleDeclaration)
00023                 result = (*(this->declaration) == *(sequentialDeclaration.declaration) &&
00024                                   *(this->simpleDeclaration) == *(sequentialDeclaration.simpleDeclaration));
00025 
00026         return result && Declaration::operator==(ast);
00027 }
00028 

Generated on Mon Dec 1 17:36:37 2003 for Protomake by doxygen1.3