25: Start adding Float Type
This commit is contained in:
@@ -1,12 +1,20 @@
|
||||
package de.hsrm.compiler.Klang;
|
||||
|
||||
import de.hsrm.compiler.Klang.types.Type;
|
||||
|
||||
public class Value {
|
||||
public Type type;
|
||||
private Object value;
|
||||
|
||||
public Value(Object value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Value(Object value, Type type) {
|
||||
this.value = value;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Object asObject() {
|
||||
return this.value;
|
||||
}
|
||||
@@ -14,6 +22,10 @@ public class Value {
|
||||
public int asInteger() {
|
||||
return (int) this.value;
|
||||
}
|
||||
|
||||
public double asFloat() {
|
||||
return (double) this.value;
|
||||
}
|
||||
|
||||
public boolean asBoolean() {
|
||||
return (boolean) this.value;
|
||||
|
||||
Reference in New Issue
Block a user