Interface Field

All Superinterfaces:
Entity

public interface Field extends 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 edu.udel.cis.vsl.abc.ast.entity.IF.Entity

    Entity.EntityKind
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the integer bit width constant value, or null if a bit width is not specified.
    Returns the (sole) declaration of this field in the AST.
    int
    Returns the index of this field in the list of members of the structure or union.
    Returns the type of the field, or null if no type is specified.
    boolean
    Determines whether this is an anonymous field, i.e., one in which the identifier node child of the definition node is null.

    Methods inherited from interface edu.udel.cis.vsl.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, or null if no type is specified. A field with a non-null type must have an object type.
      Returns:
      the type of the field
    • getBitWidth

      Value getBitWidth()
      Returns the integer bit width constant value, or null if 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 is null.
      Returns:
      true iff this field is anonymous