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

sequentialbehavior.h

Go to the documentation of this file.
00001 #ifndef SEQUENTIAL_BEHAVIOR_H
00002 #define SEQUENTIAL_BEHAVIOR_H
00003 
00004 #include "behavior.h"
00005 #include "simplebehavior.h"
00006 
00007 class SequentialBehavior : public Behavior {
00008         private:
00009                 Behavior *behavior;
00010                 SimpleBehavior *simpleBehavior;
00011 
00012 
00013         public:
00014                 SequentialBehavior(SrcPosition *position, Behavior *behavior, SimpleBehavior *simpleBehavior)
00015                         : Behavior(position), behavior(behavior), simpleBehavior(simpleBehavior) {}
00016 
00017                 SequentialBehavior(const SequentialBehavior& sequentialBehavior) : Behavior(sequentialBehavior.position) {
00018                         *(this) = sequentialBehavior;
00019                 }
00020 
00021                 virtual ~SequentialBehavior() {
00022                         delete this->behavior;
00023                         delete this->simpleBehavior;
00024                 }
00025 
00026                 Behavior *getBehavior() {
00027                         return this->behavior;
00028                 }
00029 
00030                 SimpleBehavior *getSimpleBehavior() {
00031                         return this->simpleBehavior;
00032                 }
00033 
00034                 virtual Ast& operator = (const Ast& ast);
00035                 virtual bool operator == (const Ast& ast) const;
00036 
00037                 virtual VisitorReturn *visit(Visitor& visitor) {
00038                         return visitor.visitSequentialBehavior(this);
00039                 }
00040 
00041                 virtual Ast& clone() const {
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                 }
00046 };
00047 
00048 #endif

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