public class EnumType extends IntType implements Cloneable, ASTLocusTag.ASTLocusTagProvider
relaxedEqSem
Modifier | Constructor and Description |
---|---|
|
EnumType(String name) |
protected |
EnumType(String name,
IntType underlyingType,
int cvAttributes,
ASTLocusTag astLocus) |
|
EnumType(String name,
SizeThunk enumSizeInBytes,
ASTLocusTag astLocus) |
Modifier and Type | Method and Description |
---|---|
void |
addEnum(String name,
long val) |
StringBuilder |
appendEnums(StringBuilder sb,
boolean cr) |
EnumType |
asEnum()
Casts this to an EnumType or returns null if not an EnumType.
|
Object |
clone() |
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) |
ASTLocusTag |
getASTLocusTag()
Returns this instance's
ASTLocusTag , if available,
otherwise returns null . |
String |
getEnumName(int i)
Fetch ith (0..getNumEnumerates() - 1) name
|
long |
getEnumValue(int i)
Fetch ith (0..getNumEnumerates() - 1) value
|
long |
getEnumValue(String name)
Fetch the value of 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)
Visit this type and all of the component types of this one; for
example, the return type and argument types of a FunctionType.
|
asInt, isPrimitiveUnsigned, isUnsigned, setTypedefName, toString
isPrimitive
arrayDimension, asArray, asBit, asCompound, asDouble, asFloat, asFunction, asPointer, asVoid, clearCache, equals, equalSemantics, getBaseElementType, getCName, getCName, getCVAttributes, getCVAttributesString, getCVVariant, getDebugString, getName, getName, getSize, getSize, getTargetType, hashCode, hashCodeSemantics, hasName, hasTypedefName, isAnonymous, isArray, isBit, isCompound, isConst, isDouble, isEnum, isFloat, isFunction, isFunctionPointer, isInt, isPointer, isVoid, isVolatile, pointerDepth, setName
public EnumType(String name)
public EnumType(String name, SizeThunk enumSizeInBytes, ASTLocusTag astLocus)
protected EnumType(String name, IntType underlyingType, int cvAttributes, ASTLocusTag astLocus)
public ASTLocusTag getASTLocusTag()
ASTLocusTag.ASTLocusTagProvider
ASTLocusTag
, if available,
otherwise returns null
.getASTLocusTag
in interface ASTLocusTag.ASTLocusTagProvider
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, long val)
public int getNumEnumerates()
public String getEnumName(int i)
public long getEnumValue(int i)
public long getEnumValue(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