diff --git a/chapi-domain/src/main/kotlin/chapi/domain/expr/Expression.kt b/chapi-domain/src/main/kotlin/chapi/domain/expr/Expression.kt new file mode 100644 index 00000000..c6535764 --- /dev/null +++ b/chapi-domain/src/main/kotlin/chapi/domain/expr/Expression.kt @@ -0,0 +1,28 @@ +package chapi.domain.expr + +import java.util.function.BinaryOperator +import java.util.function.IntBinaryOperator + +class Expression( + var Type: ExpressionType, + var Value: String = "", + var Children: Array = arrayOf() +) + +enum class ExpressionType { + Primary, + Infix, + Prefix, + Postfix, +} + +enum class Arithmetics : BinaryOperator, IntBinaryOperator { + PLUS { + override fun apply(t: Int, u: Int): Int { + return t + u + } + } + ; + + override fun applyAsInt(t: Int, u: Int) = apply(t, u) +}