aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared/cplusplus/Symbols.h
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@nokia.com>2009-11-11 09:32:05 +0100
committerErik Verbruggen <erik.verbruggen@nokia.com>2009-11-11 09:34:10 +0100
commita6bbec2b56f4a07f408bf3213b3b15fa6fc10330 (patch)
treec6a15058f80fd1131df2efa2e446858b30239133 /src/shared/cplusplus/Symbols.h
parent72d4493fc21535f1f2720106e28ae3a6980851f5 (diff)
Added symbols for property declarations.
Diffstat (limited to 'src/shared/cplusplus/Symbols.h')
-rw-r--r--src/shared/cplusplus/Symbols.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/shared/cplusplus/Symbols.h b/src/shared/cplusplus/Symbols.h
index acd13085f5..88d8d521cd 100644
--- a/src/shared/cplusplus/Symbols.h
+++ b/src/shared/cplusplus/Symbols.h
@@ -729,6 +729,75 @@ private:
Scope *_arguments;
};
+class CPLUSPLUS_EXPORT ObjCPropertyDeclaration: public Symbol
+{
+public:
+ enum PropertyAttributes {
+ None = 0,
+ Assign = 1 << 0,
+ Retain = 1 << 1,
+ Copy = 1 << 2,
+ ReadOnly = 1 << 3,
+ ReadWrite = 1 << 4,
+ Getter = 1 << 5,
+ Setter = 1 << 6,
+ NonAtomic = 1 << 7,
+
+ WritabilityMask = ReadOnly | ReadWrite,
+ SetterSemanticsMask = Assign | Retain | Copy,
+ };
+
+public:
+ ObjCPropertyDeclaration(TranslationUnit *translationUnit,
+ unsigned sourceLocation,
+ Name *name);
+ virtual ~ObjCPropertyDeclaration();
+
+ bool hasAttribute(int attribute) const
+ { return _propertyAttributes & attribute; }
+
+ void setAttributes(int attributes)
+ { _propertyAttributes = attributes; }
+
+ bool hasGetter() const
+ { return hasAttribute(Getter); }
+
+ bool hasSetter() const
+ { return hasAttribute(Setter); }
+
+ Name *getterName() const
+ { return _getterName; }
+
+ void setGetterName(Name *getterName)
+ { _getterName = getterName; }
+
+ Name *setterName() const
+ { return _setterName; }
+
+ void setSetterName(Name *setterName)
+ { _setterName = setterName; }
+
+ void setType(const FullySpecifiedType &type)
+ { _type = type; }
+
+ // Symbol's interface
+ virtual FullySpecifiedType type() const;
+
+ virtual const ObjCPropertyDeclaration *asOObjCPropertyDeclaration() const
+ { return this; }
+
+ virtual ObjCPropertyDeclaration *asObjCPropertyDeclaration()
+ { return this; }
+
+protected:
+ virtual void visitSymbol0(SymbolVisitor *visitor);
+
+private:
+ FullySpecifiedType _type;
+ int _propertyAttributes;
+ Name *_getterName, *_setterName;
+};
+
} // end of namespace CPlusPlus