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

actstatement.h

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

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