java-commons/muscript/src/main/java/io/gitlab/jfronny/muscript/compiler/expr/NumberExpr.java

24 lines
588 B
Java
Raw Normal View History

package io.gitlab.jfronny.muscript.compiler.expr;
2022-11-24 19:05:51 +01:00
import io.gitlab.jfronny.muscript.compiler.Type;
import io.gitlab.jfronny.muscript.compiler.expr.dynamic.DynamicCoerce;
public abstract non-sealed class NumberExpr extends Expr<Double> {
2023-01-20 17:47:41 +01:00
protected NumberExpr(int chStart, int chEnd) {
super(chStart, chEnd);
2022-06-13 13:31:54 +02:00
}
@Override
public Type getResultType() {
return Type.Number;
}
@Override
public abstract NumberExpr optimize();
@Override
public DynamicExpr asDynamicExpr() {
2023-01-20 17:47:41 +01:00
return new DynamicCoerce(chStart, chEnd, this);
}
}