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

guardexpression.h

Go to the documentation of this file.
00001 #ifndef GUARD_EXPRESSION_H
00002 #define GUARD_EXPRESSION_H
00003 
00004 #include "guard.h"
00005 #include "expression.h"
00006 
00007 class GuardExpression : public Guard {
00008         private:
00009                 Expression *expression;
00010 
00011         public:
00012                 GuardExpression(SrcPosition *position, Expression *expression)
00013                                 : Guard(position), expression(expression) {}
00014 
00015                 GuardExpression(const GuardExpression& guardExpression) : Guard(guardExpression.position) {
00016                         *(this) = guardExpression;
00017                 }
00018 
00019                 virtual ~GuardExpression() {
00020                         delete this->expression;
00021                 }
00022 
00023                 Expression *getExpression() {
00024                         return this->expression;
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.visitGuardExpression(this);
00032                 }
00033 
00034                 virtual Ast& clone() const {
00035                         return *(new GuardExpression(new SrcPosition(*(this->position)),
00036                                          this->expression ? dynamic_cast<Expression*>(&(this->expression->clone())) : 0));
00037                 }
00038 };
00039 
00040 #endif

Generated on Mon Dec 1 17:00:22 2003 for Protomake by doxygen1.3