Class EnumType

All Implemented Interfaces:
ASTLocusTag.ASTLocusTagProvider, TypeComparator.SemanticEqualityOp, Cloneable

public class EnumType extends IntType implements Cloneable
Describes enumerated types. Enumerations are like ints except that they have a set of named values.
  • Constructor Details

  • Method Details

    • hashCodeImpl

      protected int hashCodeImpl()
      Overrides:
      hashCodeImpl in class IntType
    • equalsImpl

      protected boolean equalsImpl(Type arg)
      Overrides:
      equalsImpl in class IntType
    • hashCodeSemanticsImpl

      protected int hashCodeSemanticsImpl()
      Overrides:
      hashCodeSemanticsImpl in class IntType
    • equalSemanticsImpl

      protected boolean equalSemanticsImpl(Type arg)
      Overrides:
      equalSemanticsImpl in class IntType
    • asEnum

      public EnumType asEnum()
      Description copied from class: Type
      Casts this to an EnumType or returns null if not an EnumType.
      Overrides:
      asEnum in class Type
    • getUnderlyingType

      public Type getUnderlyingType()
    • addEnum

      public void addEnum(String name, EnumType.Enumerator newEnum)
    • getNumEnumerates

      public int getNumEnumerates()
      Number of enumerates defined in this enum.
    • getEnum

      public EnumType.Enumerator getEnum(int i)
      Fetch ith (0..getNumEnumerates() - 1) EnumType.Enumerator
    • getEnum

      public EnumType.Enumerator getEnum(String name)
      Fetch the enumerate with the given name.
    • containsEnumerate

      public boolean containsEnumerate(String name)
      Does this enum type contain an enumerate with the given name?
    • removeEnumerate

      public boolean removeEnumerate(String name)
      Remove the enumerate with the given name. Returns true if it was found and removed; false if it was not found.
    • appendEnums

      public StringBuilder appendEnums(StringBuilder sb, boolean cr)
    • visit

      public void visit(TypeVisitor arg)
      Description copied from class: Type
      Traverse this Type and all of its component types; for example, the return type and argument types of a FunctionType.
      Overrides:
      visit in class Type