00001 #ifndef SIMPLE_LEFT_SIDE_LIST_H 00002 #define SIMPLE_LEFT_SIDE_LIST_H 00003 00004 #include "leftsidelist.h" 00005 #include "leftside.h" 00006 00007 class SimpleLeftSideList : public LeftSideList { 00008 private: 00009 LeftSide *leftSide; 00010 00011 public: 00012 SimpleLeftSideList(SrcPosition *position, LeftSide *leftSide) 00013 : LeftSideList(position), leftSide(leftSide) {} 00014 00015 SimpleLeftSideList(const SimpleLeftSideList& simpleLeftSideList) : LeftSideList(simpleLeftSideList.position) { 00016 *(this) = simpleLeftSideList; 00017 } 00018 00019 virtual ~SimpleLeftSideList() { 00020 delete this->leftSide; 00021 } 00022 00023 LeftSide *getLeftSide() { 00024 return this->leftSide; 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.visitSimpleLeftSideList(this); 00032 } 00033 00034 virtual Ast& clone() const { 00035 return *(new SimpleLeftSideList(new SrcPosition(*(this->position)), 00036 this->leftSide ? dynamic_cast<LeftSide*>(&(this->leftSide->clone())) : 0)); 00037 } 00038 }; 00039 00040 #endif