- All Superinterfaces:
Entity,OrdinaryEntity,ProgramEntity
An Enumerator corresponds to one of the identifiers in the list in an
enumeration.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.civl.abc.ast.entity.IF.Entity
Entity.EntityKindNested classes/interfaces inherited from interface dev.civl.abc.ast.entity.IF.ProgramEntity
ProgramEntity.LinkageKind -
Method Summary
Modifier and TypeMethodDescriptionGets the definition, i.e., the defining declaration of this entity.getType()Other thanLabel, andPragmaHandler, every kind of Entity has a type, returned by this method.getValue()Returns the optional constant integer value assigned to this enumerator, ornullif this is missing.Methods inherited from interface dev.civl.abc.ast.entity.IF.Entity
getEntityKind, getNameMethods inherited from interface dev.civl.abc.ast.entity.IF.ProgramEntity
addDeclaration, getDeclaration, getDeclarations, getFirstDeclaration, getLinkage, getNumDeclarations, isSystem, setDefinition, setIsSystem, setLinkage, setType
-
Method Details
-
getDefinition
EnumeratorDeclarationNode getDefinition()Description copied from interface:ProgramEntityGets 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 methodProgramEntity.setDefinition(DeclarationNode).- Specified by:
getDefinitionin interfaceProgramEntity- Returns:
- the definition of this entity or
null
-
getType
EnumerationType getType()Description copied from interface:ProgramEntityOther than
Label, andPragmaHandler, every kind of Entity has a type, returned by this method. For aLabelorPragmaHandler, this returnsnull.The type is initially
null. It can be set using methodProgramEntity.setType(Type).- Specified by:
getTypein interfaceProgramEntity- Returns:
- the type of this entity or
null
-
getValue
Value getValue()Returns the optional constant integer value assigned to this enumerator, ornullif this is missing.- Returns:
- the integer value of this enumerator constant
-