public class EnumType extends IntType implements Cloneable
Modifier and Type | Class and Description |
---|---|
static class |
EnumType.Enumerator |
relaxedEqSem
Constructor and Description |
---|
EnumType(String name) |
EnumType(String name,
SizeThunk enumSizeInBytes,
ASTLocusTag astLocus) |
Modifier and Type | Method and Description |
---|---|
void |
addEnum(String name,
EnumType.Enumerator newEnum) |
StringBuilder |
appendEnums(StringBuilder sb,
boolean cr) |
EnumType |
asEnum()
Casts this to an EnumType or returns null if not an EnumType.
|
boolean |
containsEnumerate(String name)
Does this enum type contain an enumerate with the given name?
|
protected boolean |
equalSemanticsImpl(Type arg) |
protected boolean |
equalsImpl(Type arg) |
EnumType.Enumerator |
getEnum(int i)
Fetch ith (0..getNumEnumerates() - 1)
EnumType.Enumerator |
EnumType.Enumerator |
getEnum(String name)
Fetch the enumerate with the given name.
|
int |
getNumEnumerates()
Number of enumerates defined in this enum.
|
Type |
getUnderlyingType() |
protected int |
hashCodeImpl() |
protected int |
hashCodeSemanticsImpl() |
boolean |
removeEnumerate(String name)
Remove the enumerate with the given name.
|
void |
visit(TypeVisitor arg)
Traverse this
Type and all of its component types; for
example, the return type and argument types of a FunctionType. |
asInt, getCName, isUnsigned, setTypedefName, toString
isPrimitive
arrayDimension, asArray, asBit, asCompound, asDouble, asFloat, asFunction, asPointer, asVoid, clearCache, clone, equals, equalSemantics, getASTLocusTag, getBaseElementType, getCName, getCVAttributes, getCVAttributesString, getDebugString, getName, getName, getSize, getSize, getTargetType, hashCode, hashCodeSemantics, isAnon, isArray, isBaseTypeConst, isBit, isCompound, isConst, isDouble, isEnum, isFloat, isFunction, isFunctionPointer, isInt, isPointer, isTypedef, isVoid, isVolatile, newCVVariant, pointerDepth
public EnumType(String name)
public EnumType(String name, SizeThunk enumSizeInBytes, ASTLocusTag astLocus)
protected int hashCodeImpl()
hashCodeImpl
in class IntType
protected boolean equalsImpl(Type arg)
equalsImpl
in class IntType
protected int hashCodeSemanticsImpl()
hashCodeSemanticsImpl
in class IntType
protected boolean equalSemanticsImpl(Type arg)
equalSemanticsImpl
in class IntType
public EnumType asEnum()
Type
public Type getUnderlyingType()
public void addEnum(String name, EnumType.Enumerator newEnum)
public int getNumEnumerates()
public EnumType.Enumerator getEnum(int i)
EnumType.Enumerator
public EnumType.Enumerator getEnum(String name)
public boolean containsEnumerate(String name)
public boolean removeEnumerate(String name)
public StringBuilder appendEnums(StringBuilder sb, boolean cr)
public void visit(TypeVisitor arg)
Type
Type
and all of its component types; for
example, the return type and argument types of a FunctionType.