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

simpleguardedstatement.h

Go to the documentation of this file.
00001 #ifndef SIMPLE_GUARDED_STATEMENT_H
00002 #define SIMPLE_GUARDED_STATEMENT_H
00003 
00004 #include "guardedstatement.h"
00005 #include "expression.h"
00006 #include "statement.h"
00007 
00008 class SimpleGuardedStatement : public GuardedStatement {
00009         private:
00010                 Expression *expression;
00011                 Statement *statement;
00012 
00013         public:
00014                 SimpleGuardedStatement(SrcPosition *position, Expression *expression, Statement *statement)
00015                         : GuardedStatement(position), expression(expression), statement(statement) {}
00016 
00017                 SimpleGuardedStatement(const SimpleGuardedStatement& simpleGuardedStatement) : GuardedStatement(simpleGuardedStatement.position) {
00018                         *(this) = simpleGuardedStatement;
00019                 }
00020 
00021                 virtual ~SimpleGuardedStatement() {
00022                         delete this->expression;
00023                         delete this->statement;
00024                 }
00025 
00026                 Expression *getExpression() {
00027                         return this->expression;
00028                 }
00029 
00030                 Statement *getStatement() {
00031                         return this->statement;
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.visitSimpleGuardedStatement(this);
00039                 }
00040 
00041                 virtual Ast& clone() const {
00042                         return *(new SimpleGuardedStatement(new SrcPosition(*(this->position)),
00043                                          this->expression ? dynamic_cast<Expression*>(&(this->expression->clone())) : 0,
00044                                          this->statement ? dynamic_cast<Statement*>(&(this->statement->clone())) : 0));
00045                 }
00046 };
00047 
00048 #endif

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