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

simpleaction.h

Go to the documentation of this file.
00001 #ifndef SIMPLE_ACTION_H
00002 #define SIMPLE_ACTION_H
00003 
00004 #include "action.h"
00005 #include "guard.h"
00006 #include "statement.h"
00007 
00008 class SimpleAction : public Action {
00009         private:
00010                 Guard *guard;
00011                 Statement *statement;
00012 
00013         public:
00014                 SimpleAction(SrcPosition *position, Guard *guard, Statement *statement)
00015                         : Action(position), guard(guard), statement(statement) {}
00016 
00017                 SimpleAction(const SimpleAction& simpleAction) : Action(simpleAction.position) {
00018                         *(this) = simpleAction;
00019                 }
00020 
00021                 virtual ~SimpleAction() {
00022                         delete this->guard;
00023                         delete this->statement;
00024                 }
00025 
00026                 Guard *getGuard() {
00027                         return this->guard;
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.visitSimpleAction(this);
00039                 }
00040 
00041                 virtual Ast& clone() const {
00042                         return *(new SimpleAction(new SrcPosition(*(this->position)),
00043                                          this->guard ? dynamic_cast<Guard*>(&(this->guard->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