- All Superinterfaces:
Entity
A Field is a member of a structure or union. A Field is determined by the
following (1) its name, which is obtained by method
Entity.getName() in the
parent interface Entity, (2) its type, which must be an object type,
and is obtained by method getType(), and (3) its optional bit width,
obtained by method getBitWidth(). Note that any of these 3 things
may be null (but not all three) in an instance.-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.civl.abc.ast.entity.IF.Entity
Entity.EntityKind -
Method Summary
Modifier and TypeMethodDescriptionReturns the integer bit width constant value, ornullif a bit width is not specified.Returns the (sole) declaration of this field in the AST.intReturns the index of this field in the list of members of the structure or union.getType()Returns the type of the field, ornullif no type is specified.booleanDetermines whether this is an anonymous field, i.e., one in which the identifier node child of the definition node isnull.Methods inherited from interface dev.civl.abc.ast.entity.IF.Entity
getEntityKind, getName
-
Method Details
-
getMemberIndex
int getMemberIndex()Returns the index of this field in the list of members of the structure or union. Members are indexed starting from 0.- Returns:
- field index in structure or union
-
getDefinition
FieldDeclarationNode getDefinition()Returns the (sole) declaration of this field in the AST.- Returns:
- the sole declaration of this field
-
getType
ObjectType getType()Returns the type of the field, ornullif no type is specified. A field with a non-nulltype must have an object type.- Returns:
- the type of the field
-
getBitWidth
Value getBitWidth()Returns the integer bit width constant value, ornullif a bit width is not specified.- Returns:
- bit width or
null
-
isAnonymous
boolean isAnonymous()Determines whether this is an anonymous field, i.e., one in which the identifier node child of the definition node isnull.- Returns:
trueiff this field is anonymous
-