- All Known Subinterfaces:
BehaviorEntity,EnumerationType,Enumerator,Field,Function,Label,OrdinaryEntity,ProgramEntity,StructureOrUnionType,TaggedEntity,Typedef,Variable
- All Known Implementing Classes:
CommonEntity
An entity is an underlying program "conceptual thing" that can be named by an identifier. The kinds of things include: variables, functions, typedefs, structures, unions, enumerations, enumerators, fields, and labels.
An entity object has some list of declarations associated to it. It begins
with no declarations; a declaration is added using method
invalid reference
#addDeclaration(DeclarationNode)
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe different kinds of Entity. -
Method Summary
Modifier and TypeMethodDescriptionThe kind of entity this is.getName()Gets the name of this entity.
-
Method Details
-
getEntityKind
Entity.EntityKind getEntityKind()The kind of entity this is.
If the kind is
Entity.EntityKind.VARIABLE, this entity may be safely cast toVariableIf the kind is
Entity.EntityKind.FUNCTION, this entity may be safely cast toFunction.If the kind is
Entity.EntityKind.TYPEDEF, this entity may be safely cast toTypedef.If the kind is
Entity.EntityKind.STRUCTURE_OR_UNION, this entity may be safely cast to.invalid reference
StructureOrUnionIf the kind is
Entity.EntityKind.ENUMERATION, this entity may be safely cast toEnumeration.If the kind is
Entity.EntityKind.ENUMERATOR, this entity may be safely cast toEnumerator. An enumerator is an element of an enumeration.If the kind is
Entity.EntityKind.FIELD, this entity may be safely cast toField. A "field" is a member of a structure or union.If the kind is
Entity.EntityKind.LABEL, this entity may be safely cast toLabel.If the kind is
Entity.EntityKind.PRAGMA_HANDLER, this entity may be safely cast toPragmaHandler.- Returns:
- the entity kind
-
getName
String getName()Gets the name of this entity. This is the identifier used in the declaration of the entity. It can be null in certain situations (e.g., an unnamed field).- Returns:
- the name of this entity
-