mirror of
https://github.com/DanilaFe/abacus
synced 2026-01-13 10:25:20 +00:00
Rewrite the Operator in Kotlin.
This commit is contained in:
14
src/main/kotlin/org/nwapw/abacus/function/Operator.kt
Normal file
14
src/main/kotlin/org/nwapw/abacus/function/Operator.kt
Normal file
@@ -0,0 +1,14 @@
|
||||
package org.nwapw.abacus.function
|
||||
|
||||
/**
|
||||
* A single operator that can be used by Abacus.
|
||||
*
|
||||
* This is a data class that holds the information about a single operator, such as a plus or minus.
|
||||
*
|
||||
* @param associativity the associativity of this operator, used for order of operations;.
|
||||
* @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.
|
||||
* @param function the function this operator applies to its arguments.
|
||||
*/
|
||||
data class Operator(val associativity: OperatorAssociativity, val type: OperatorType,
|
||||
val precedence: Int, val function: Function)
|
||||
Reference in New Issue
Block a user