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

fieldreference.h

Go to the documentation of this file.
00001 #ifndef FIELD_REFERENCE_H
00002 #define FIELD_REFERENCE_H
00003 
00004 #include "identifier.h"
00005 #include "expression.h"
00006 #include "leftside.h"
00007 
00008 class FieldReference : public Expression, public LeftSide {
00009 
00010         private:
00011                 Identifier *msgId;
00012                 Identifier *fieldId;
00013 
00014         public:
00015                 FieldReference(SrcPosition *position, Identifier *msgId, Identifier *fieldId)
00016                                 : Expression(position), LeftSide(position), Ast(position), msgId(msgId), fieldId(fieldId) {}
00017                 
00018                 FieldReference(const FieldReference& fieldReference) : Expression(fieldReference.position), LeftSide(fieldReference.position), Ast(position) {
00019                         (*this) = fieldReference;
00020                 }
00021 
00022                 virtual ~FieldReference() {
00023                         delete this->msgId;
00024                         delete this->fieldId;
00025                 }
00026 
00027                 Identifier *getMsgId() {
00028                         return this->msgId;
00029                 }
00030 
00031                 Identifier *getFieldId() {
00032                         return this->fieldId;
00033                 }
00034 
00035                 virtual Ast& operator = (const Ast& ast);
00036 
00037                 virtual bool operator == (const Ast& ast) const;
00038 
00039                 virtual VisitorReturn *visit(Visitor& visitor) {
00040                         return visitor.visitFieldReference(this);
00041                 }
00042 
00043                 virtual Ast& clone() const {
00044                         return *(new FieldReference(new SrcPosition(*(this->position)),
00045                                                         this->msgId ? dynamic_cast<Identifier*>(&(this->msgId->clone())): 0,
00046                                                         this->fieldId ? dynamic_cast<Identifier*>(&(this->fieldId->clone())): 0));
00047                 }
00048 
00049 };
00050 
00051 #endif

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