33
34
class CNamespaceInfo;
36
* Representation of local/global variables and class data members.
37
* \see Puma::CAttributeInfo */
39
/** \class CAttributeInfo CAttributeInfo.h Puma/infos/CAttributeInfo.h
40
* A CAttributeInfo object represents a local or global variable
41
* or a class data member. */
36
/** \class CAttributeInfo CAttributeInfo.h Puma/CAttributeInfo.h
37
* Semantic information about a local or global object or a
38
* class data member. */
42
39
class CAttributeInfo : public CScopeRequest {
43
40
CTemplateInfo *_TemplateInfo;
46
/** This constructor is to be used by classes inherited from
47
* CAttributeInfo. It makes it possible to set another object id
48
* than \c ATTRIBUTE_INFO.
49
* \param id The object id to be used instead of \c ATTRIBUTE_INFO. */
44
* \param id The object type. */
50
45
CAttributeInfo (ObjectId id);
53
/** Construct a new attribute info. */
55
/** Destruct the attribute info. If the object id is
56
* \c ATTRIBUTE_INFO, Puma::CObjectInfo::CleanUp() is called. */
50
/** Destructor. If the object type is CObjectInfo::ATTRIBUTE_INFO,
51
* then CObjectInfo::CleanUp() is called. */
57
52
~CAttributeInfo ();
59
/** Get the base info object of the info object. <b>The
60
* corresponding information is not yet set!</b>
61
* \return This method always returns \c NULL.
62
* \warning Do not use this method. */
63
CAttributeInfo *BaseObject () const;
64
/** Get the info object of the variable definition.
65
* \return \e this or the info of the definition if the variable
66
* is a static class data member initialized outside of
67
* the class declaration. */
54
/** Get the semantic object for the object definition.
55
* \see CObjectInfo::DefObject() */
68
56
CAttributeInfo *DefObject () const;
69
/** Get the syntax tree node of the variable declaration. */
57
/** Get the syntax tree node of the object. */
70
58
CT_InitDeclarator *Tree () const;
71
/** Get the initializer of the variable.
72
* \return The syntax tree node of the initializer or \c NULL
59
/** Get the initializer of the object.
60
* \return The syntax tree node of the initializer or NULL
73
61
* if there is no initializer. */
74
CT_ExprList *Init () const; // initializer
62
CT_ExprList *Init () const;
76
/** Get the corresponding template info of static data members
78
* \return The info or \c NULL otherwise. */
64
/** Get the template information object if this is a static
65
* data member of a class template.
66
* \return The template information object or NULL. */
79
67
CTemplateInfo *TemplateInfo () const;
80
/** Set the corresponding of a static data member or a class
82
* \param info The info of the template. */
68
/** Set the template information object of a static data
69
* member of a class template.
70
* \param info The semantic object of the template. */
83
71
void TemplateInfo (CTemplateInfo *info);
85
/** Get the record info if this is a data member of a record.
86
* \return The record info or \c NULL if not a member of a record. */
73
/** Get the class or union if this is a data member of a class or union.
74
* \return The class or union, or NULL if not a member. */
87
75
CRecord *Record () const;
88
/** Get the namespace info if the variable is declared in a namespace.
89
* \return The info or \c NULL if not declared in a namespace. */
76
/** Get the namespace if the object is declared in a namespace.
77
* \return The namespace or NULL if not declared in a namespace. */
90
78
CNamespaceInfo *Namespace () const;
91
/** Set the qualification scope of the variable. This can be a namespace
92
* info for variables declared in a namespace or a record info for
93
* data members of a class/struct/union.
94
* \param scope The qualification scope of the variable. */
79
/** Set the qualification scope of the object. This can be a namespace
80
* for objects declared in a namespace or a class/union for data
81
* members of a class/union.
82
* \param scope The qualification scope. */
95
83
void QualifiedScope (CStructure *scope);