mirror of
https://github.com/DanilaFe/abacus
synced 2026-01-31 19:15:20 +00:00
Make applicable into an interface.
This commit is contained in:
@@ -8,4 +8,4 @@ import org.nwapw.abacus.number.NumberInterface
|
||||
* This function takes some number of input NumberInterfaces and returns
|
||||
* another NumberInterface as a result.
|
||||
*/
|
||||
abstract class NumberFunction : Applicable<NumberInterface, NumberInterface>()
|
||||
abstract class NumberFunction : Applicable<NumberInterface, NumberInterface>
|
||||
@@ -12,4 +12,5 @@ import org.nwapw.abacus.number.NumberInterface
|
||||
*/
|
||||
abstract class NumberOperator(associativity: OperatorAssociativity, type: OperatorType,
|
||||
precedence: Int) :
|
||||
Operator<NumberInterface, NumberInterface>(associativity, type, precedence)
|
||||
Operator(associativity, type, precedence),
|
||||
Applicable<NumberInterface, NumberInterface>
|
||||
@@ -9,5 +9,5 @@ package org.nwapw.abacus.function
|
||||
* @param type the type of this operator, used for parsing (infix / prefix / postfix and binary / unary)
|
||||
* @param precedence the precedence of this operator, used for order of operations.
|
||||
*/
|
||||
abstract class Operator<T: Any, O: Any>(val associativity: OperatorAssociativity, val type: OperatorType,
|
||||
val precedence: Int) : Applicable<T, O>()
|
||||
open class Operator(val associativity: OperatorAssociativity, val type: OperatorType,
|
||||
val precedence: Int)
|
||||
@@ -9,4 +9,4 @@ import org.nwapw.abacus.tree.TreeNode
|
||||
* A function that operates on parse tree nodes instead of on already simplified numbers.
|
||||
* Despite this, it returns a number, not a tree.
|
||||
*/
|
||||
abstract class TreeValueFunction : ReducerApplicable<TreeNode, NumberInterface, NumberInterface>()
|
||||
abstract class TreeValueFunction : ReducerApplicable<TreeNode, NumberInterface, NumberInterface>
|
||||
|
||||
Reference in New Issue
Block a user