19
19
#ifndef __CEnumeratorInfo_h__
20
20
#define __CEnumeratorInfo_h__
22
// enumeration constant (enumerator) info
23
// knows its enumeration and its constant value
23
* Semantic information about an enumeration constant. */
25
25
#include "Puma/CAttributeInfo.h"
26
26
#include "Puma/CTypeInfo.h"
33
33
class CT_Enumerator;
37
* Representation of an enumerator constant.
38
* \see Puma::CEnumeratorInfo */
40
/** \class CEnumeratorInfo CEnumeratorInfo.h Puma/infos/CEnumeratorInfo.h
41
* A CEnumeratorInfo object represents an enumerator constant. */
36
/** \class CEnumeratorInfo CEnumeratorInfo.h Puma/CEnumeratorInfo.h
37
* Semantic information about an enumeration constant.
38
* An enumeration constant also is called enumerator. */
42
39
class CEnumeratorInfo : public CAttributeInfo {
47
/** Construct a new enumerator info. */
48
45
CEnumeratorInfo ();
49
/** Destruct the enumerator info. If the object id is
50
* \c ENUMERATOR_INFO, Puma::CObjectInfo::CleanUp() is called. */
46
/** Destructor. If the object type is CObjectInfo::ENUMERATOR_INFO,
47
* then CObjectInfo::CleanUp() is called. */
51
48
~CEnumeratorInfo ();
53
/** Get the base info object of the info object. <b>The
54
* corresponding information is not yet set!</b>
55
* \return This method always returns \c NULL.
56
* \warning Do not use this method. */
57
CEnumeratorInfo *BaseObject () const;
58
50
/** Get the syntax tree node of the enumerator constant. */
59
51
CT_Enumerator *Tree () const;
60
52
/** Get the initialization expression syntax tree node of
62
* \return The syntax tree node or \c NULL if no initializer. */
54
* \return The syntax tree node or NULL if no initializer. */
63
55
CT_ExprList *Init () const;
65
/** Get the underlying value type. */
57
/** Get the underlying value type. This is implementation-defined
58
* and defaults to \e int.*/
66
59
CTypeInfo *UnderlyingType () const;
68
/** Get the corresponding enumeration info. */
61
/** Get the enumeration containing this enumerator. */
69
62
CEnumInfo *Enum () const;
70
/** Set the enumeration info.
71
* \param ei The corresponding enumeration info. */
63
/** Set the enumeration containing this enumerator.
64
* \param ei The enumeration. */
72
65
void Enum (CEnumInfo *ei);
74
/** Get the constant value of the enumerator. */
67
/** Get the value of the enumerator. */
75
68
LONG_LONG Value () const;
76
/** Set the value of the enumerator constant.
77
* \param v The value of the enumerator. */
69
/** Set the value of the enumerator.
70
* \param v The value. */
78
71
void Value (LONG_LONG v);