00001 #ifndef SIMPLE_BEHAVIOR_H 00002 #define SIMPLE_BEHAVIOR_H 00003 00004 #include "behavior.h" 00005 #include "identifierlist.h" 00006 00007 class SimpleBehavior : public Behavior { 00008 private: 00009 IdentifierList *identifierList; 00010 00011 public: 00012 SimpleBehavior(SrcPosition *position, IdentifierList *identifierList) 00013 : Behavior(position), identifierList(identifierList) {} 00014 00015 SimpleBehavior(const SimpleBehavior& simpleBehavior) : Behavior(simpleBehavior.position) { 00016 *(this) = simpleBehavior; 00017 } 00018 00019 virtual ~SimpleBehavior() { 00020 delete this->identifierList; 00021 } 00022 00023 IdentifierList *getIdentifierList() { 00024 return this->identifierList; 00025 } 00026 00027 virtual Ast& operator = (const Ast& ast); 00028 virtual bool operator == (const Ast& ast) const; 00029 00030 virtual VisitorReturn *visit(Visitor& visitor) { 00031 return visitor.visitSimpleBehavior(this); 00032 } 00033 00034 virtual Ast& clone() const { 00035 return *(new SimpleBehavior(new SrcPosition(*(this->position)), 00036 this->identifierList ? dynamic_cast<IdentifierList*>(&(this->identifierList->clone())) : 0)); 00037 } 00038 }; 00039 00040 #endif