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

program.cpp

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

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