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

behaviorstatement.h

Go to the documentation of this file.
00001 #ifndef BEHAVIOR_STATEMENT_H
00002 #define BEHAVIOR_STATEMENT_H
00003 
00004 #include "simplestatement.h"
00005 #include "identifier.h"
00006 #include "expressionlist.h"
00007 
00008 class BehaviorStatement : public SimpleStatement {
00009         private:
00010                 Identifier *behavior;
00011                 Identifier *function;
00012                 ExpressionList *expressionList;
00013 
00014         public:
00015                 BehaviorStatement(SrcPosition *position, Identifier *behavior, Identifier *function, ExpressionList *expressionList)
00016                                 : SimpleStatement(position), behavior(behavior), function(function), expressionList(expressionList) {}
00017 
00018                 BehaviorStatement(const BehaviorStatement& behaviorStatement) : SimpleStatement(behaviorStatement.position) {
00019                         *(this) = behaviorStatement;
00020                 }
00021 
00022                 virtual ~BehaviorStatement() {
00023                         delete this->expressionList;
00024                 }
00025 
00026                 ExpressionList *getExpressionList() {
00027                         return this->expressionList;
00028                 }
00029 
00030                 Identifier *getBehavior() {
00031                         return this->behavior;
00032                 }
00033                 
00034                 Identifier *getFunction() {
00035                         return this->function;
00036                 }
00037                 
00038                 virtual Ast& operator = (const Ast& ast);
00039                 virtual bool operator == (const Ast& ast) const;
00040 
00041                 virtual VisitorReturn *visit(Visitor& visitor) {
00042                         return visitor.visitBehaviorStatement(this);
00043                 }
00044 
00045                 virtual Ast& clone() const {
00046                         return *(new BehaviorStatement(new SrcPosition(*(this->position)),
00047                                          this->behavior ? dynamic_cast<Identifier*>(&(this->behavior->clone())) : 0,
00048                                          this->function ? dynamic_cast<Identifier*>(&(this->function->clone())) : 0,
00049                                          this->expressionList ? dynamic_cast<ExpressionList*>(&(this->expressionList->clone())) : 0));
00050                 }
00051 };
00052 
00053 #endif

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