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

assignstatement.cpp

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

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