1
0
mirror of https://github.com/DanilaFe/abacus synced 2024-06-30 14:50:59 -07:00
Abacus/core/src/main/kotlin/org/nwapw/abacus/tree/nodes/UnaryNode.kt

18 lines
579 B
Kotlin
Raw Normal View History

package org.nwapw.abacus.tree.nodes
/**
* A tree node that holds a unary operation.
*
* This node holds a single operator applied to a single parameter, and does not care
* whether the operation was found before or after the parameter in the text.
*
* @param operation the operation applied to the given node.
* @param applyTo the node to which the operation will be applied.
*/
2017-09-07 12:31:40 -07:00
abstract class UnaryNode(val operation: String, val applyTo: TreeNode) : TreeNode() {
override fun toString(): String {
2017-09-07 12:31:40 -07:00
return "(" + applyTo.toString() + ")" + operation
}
}