Enum PrimitiveType
- java.lang.Object
-
- java.lang.Enum<PrimitiveType>
-
- de.mirkosertic.bytecoder.core.backend.wasm.ast.PrimitiveType
-
- All Implemented Interfaces:
WasmType
,java.io.Serializable
,java.lang.Comparable<PrimitiveType>
public enum PrimitiveType extends java.lang.Enum<PrimitiveType> implements WasmType
-
-
Field Summary
Fields Modifier and Type Field Description private byte
binaryType
private java.lang.String
text
-
Constructor Summary
Constructors Modifier Constructor Description private
PrimitiveType(java.lang.String text, byte binaryType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte
getBinaryType()
int
index()
static PrimitiveType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static PrimitiveType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.void
writeRefTo(TextWriter writer)
void
writeTo(BinaryWriter.Writer sectionWriter)
void
writeTo(TextWriter textWriter)
-
-
-
Enum Constant Detail
-
i32
public static final PrimitiveType i32
-
f32
public static final PrimitiveType f32
-
i64
public static final PrimitiveType i64
-
f64
public static final PrimitiveType f64
-
anyfunc
public static final PrimitiveType anyfunc
-
func
public static final PrimitiveType func
-
struct
public static final PrimitiveType struct
-
array
public static final PrimitiveType array
-
empty_block
public static final PrimitiveType empty_block
-
externref
public static final PrimitiveType externref
-
-
Method Detail
-
values
public static PrimitiveType[] 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 (PrimitiveType c : PrimitiveType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PrimitiveType valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
writeTo
public void writeTo(TextWriter textWriter)
-
writeRefTo
public void writeRefTo(TextWriter writer)
- Specified by:
writeRefTo
in interfaceWasmType
-
writeTo
public void writeTo(BinaryWriter.Writer sectionWriter)
-
getBinaryType
public byte getBinaryType()
-
-