#include <sequentialbehavior.h>
Inheritance diagram for SequentialBehavior:
Public Member Functions | |
SequentialBehavior (SrcPosition *position, Behavior *behavior, SimpleBehavior *simpleBehavior) | |
SequentialBehavior (const SequentialBehavior &sequentialBehavior) | |
virtual | ~SequentialBehavior () |
Behavior * | getBehavior () |
SimpleBehavior * | getSimpleBehavior () |
virtual Ast & | operator= (const Ast &ast) |
virtual bool | operator== (const Ast &ast) const |
virtual VisitorReturn * | visit (Visitor &visitor) |
virtual Ast & | clone () const |
Private Attributes | |
Behavior * | behavior |
SimpleBehavior * | simpleBehavior |
|
Definition at line 14 of file sequentialbehavior.h. Referenced by clone().
00015 : Behavior(position), behavior(behavior), simpleBehavior(simpleBehavior) {} |
|
Definition at line 17 of file sequentialbehavior.h. References Ast::position.
|
|
Definition at line 21 of file sequentialbehavior.h.
00021 { 00022 delete this->behavior; 00023 delete this->simpleBehavior; 00024 } |
|
Implements Ast. Definition at line 41 of file sequentialbehavior.h. References SimpleBehavior::clone(), and SequentialBehavior().
00041 { 00042 return *(new SequentialBehavior(new SrcPosition(*(this->position)), 00043 this->behavior ? dynamic_cast<Behavior*>(&(this->behavior->clone())) : 0, 00044 this->simpleBehavior ? dynamic_cast<SimpleBehavior*>(&(this->simpleBehavior->clone())) : 0)); 00045 } |
|
Definition at line 26 of file sequentialbehavior.h. Referenced by TypeCheckerVisitor::visitSequentialBehavior().
00026 { 00027 return this->behavior; 00028 } |
|
Definition at line 30 of file sequentialbehavior.h. Referenced by TypeCheckerVisitor::visitSequentialBehavior().
00030 { 00031 return this->simpleBehavior; 00032 } |
|
Reimplemented from Behavior. Definition at line 5 of file sequentialbehavior.cpp. References behavior, SimpleBehavior::clone(), Ast::clone(), Behavior::operator=(), and simpleBehavior.
00005 { 00006 const SequentialBehavior& sequentialBehavior = dynamic_cast<const SequentialBehavior&>(ast); 00007 00008 Behavior::operator=(ast); 00009 this->behavior = sequentialBehavior.behavior ? dynamic_cast<Behavior*>(&(sequentialBehavior.behavior->clone())) : 0; 00010 this->simpleBehavior = sequentialBehavior.simpleBehavior ? dynamic_cast<SimpleBehavior*>(&(sequentialBehavior.simpleBehavior->clone())) : 0; 00011 00012 return *(this); 00013 } |
|
Reimplemented from Behavior. Definition at line 15 of file sequentialbehavior.cpp. References behavior, Behavior::operator==(), and simpleBehavior.
00015 { 00016 bool result = false; 00017 const SequentialBehavior& sequentialBehavior = dynamic_cast<const SequentialBehavior&>(ast); 00018 00019 if (typeid(ast) != typeid(SequentialBehavior)) 00020 return false; 00021 00022 if (this->behavior && this->simpleBehavior) 00023 result = (*(this->behavior) == *(sequentialBehavior.behavior) && 00024 *(this->simpleBehavior) == *(sequentialBehavior.simpleBehavior)); 00025 00026 return result && Behavior::operator==(ast); 00027 } |
|
Implements Ast. Definition at line 37 of file sequentialbehavior.h. References Visitor::visitSequentialBehavior().
00037 { 00038 return visitor.visitSequentialBehavior(this); 00039 } |
|
Definition at line 9 of file sequentialbehavior.h. Referenced by operator=(), and operator==(). |
|
Definition at line 10 of file sequentialbehavior.h. Referenced by operator=(), and operator==(). |