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

sequentialstatement.cpp

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

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