Interface Enumerator

All Superinterfaces:
Entity, OrdinaryEntity, ProgramEntity

public interface Enumerator extends OrdinaryEntity
An Enumerator corresponds to one of the identifiers in the list in an enumeration.
  • Method Details

    • getDefinition

      EnumeratorDeclarationNode getDefinition()
      Description copied from interface: ProgramEntity

      Gets the definition, i.e., the defining declaration of this entity. Every entity has at most one definition. The definition is a declaration of a special kind. For example, for an object (variable), a definition is the declaration that allocates storage for that object. For a function, a definition is the declaration the contains the function body.

      The definition is initially null, but can be set using method ProgramEntity.setDefinition(DeclarationNode).

      Specified by:
      getDefinition in interface ProgramEntity
      Returns:
      the definition of this entity or null
    • getType

      EnumerationType getType()
      Description copied from interface: ProgramEntity

      Other than Label, and PragmaHandler, every kind of Entity has a type, returned by this method. For a Label or PragmaHandler, this returns null.

      The type is initially null. It can be set using method ProgramEntity.setType(Type).

      Specified by:
      getType in interface ProgramEntity
      Returns:
      the type of this entity or null
    • getValue

      Value getValue()
      Returns the optional constant integer value assigned to this enumerator, or null if this is missing.
      Returns:
      the integer value of this enumerator constant