Enum PrimitiveSourceType.PrimitiveKind
- java.lang.Object
-
- java.lang.Enum<PrimitiveSourceType.PrimitiveKind>
-
- com.tonic.analysis.source.ast.type.PrimitiveSourceType.PrimitiveKind
-
- All Implemented Interfaces:
Serializable,Comparable<PrimitiveSourceType.PrimitiveKind>
- Enclosing class:
- PrimitiveSourceType
public static enum PrimitiveSourceType.PrimitiveKind extends Enum<PrimitiveSourceType.PrimitiveKind>
The eight Java primitives, each paired with its source keyword and IR type.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BOOLEANThebooleankeyword; one slot wide and carried as an int on the operand stack.BYTEThebytekeyword; an 8-bit signed integer widened to int on the operand stack.CHARThecharkeyword; a 16-bit unsigned integer widened to int on the operand stack.DOUBLEThedoublekeyword; 64-bit IEEE 754, two slots wide.FLOATThefloatkeyword; 32-bit IEEE 754, one slot wide.INTTheintkeyword; a 32-bit signed integer, one slot wide.LONGThelongkeyword; a 64-bit signed integer, two slots wide.SHORTTheshortkeyword; a 16-bit signed integer widened to int on the operand stack.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PrimitiveTypegetIRType()StringgetJavaName()static PrimitiveSourceType.PrimitiveKindvalueOf(String name)Returns the enum constant of this type with the specified name.static PrimitiveSourceType.PrimitiveKind[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BOOLEAN
public static final PrimitiveSourceType.PrimitiveKind BOOLEAN
Thebooleankeyword; one slot wide and carried as an int on the operand stack.
-
BYTE
public static final PrimitiveSourceType.PrimitiveKind BYTE
Thebytekeyword; an 8-bit signed integer widened to int on the operand stack.
-
CHAR
public static final PrimitiveSourceType.PrimitiveKind CHAR
Thecharkeyword; a 16-bit unsigned integer widened to int on the operand stack.
-
SHORT
public static final PrimitiveSourceType.PrimitiveKind SHORT
Theshortkeyword; a 16-bit signed integer widened to int on the operand stack.
-
INT
public static final PrimitiveSourceType.PrimitiveKind INT
Theintkeyword; a 32-bit signed integer, one slot wide.
-
LONG
public static final PrimitiveSourceType.PrimitiveKind LONG
Thelongkeyword; a 64-bit signed integer, two slots wide.
-
FLOAT
public static final PrimitiveSourceType.PrimitiveKind FLOAT
Thefloatkeyword; 32-bit IEEE 754, one slot wide.
-
DOUBLE
public static final PrimitiveSourceType.PrimitiveKind DOUBLE
Thedoublekeyword; 64-bit IEEE 754, two slots wide.
-
-
Method Detail
-
values
public static PrimitiveSourceType.PrimitiveKind[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (PrimitiveSourceType.PrimitiveKind c : PrimitiveSourceType.PrimitiveKind.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PrimitiveSourceType.PrimitiveKind valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getJavaName
public String getJavaName()
- Returns:
- the Java source keyword for this primitive
-
getIRType
public PrimitiveType getIRType()
- Returns:
- the matching IR primitive type
-
-