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

behaviorstatement.cpp

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

Generated on Mon Dec 1 17:00:22 2003 for Protomake by doxygen1.3