2017-08-25 01:17:52 -07:00
|
|
|
package org.nwapw.abacus.tree
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A tree node that represents a tree value function call.
|
|
|
|
*
|
|
|
|
* This is in many ways similar to a simple FunctionNode, and the distinction
|
|
|
|
* is mostly to help the reducer. Besides that, this class also does not
|
|
|
|
* even attempt to reduce its children.
|
|
|
|
*/
|
2017-09-07 12:31:40 -07:00
|
|
|
class TreeValueFunctionNode(name: String, children: List<TreeNode>) : CallNode(name, children) {
|
2017-08-25 01:17:52 -07:00
|
|
|
|
2017-09-07 12:53:12 -07:00
|
|
|
override fun <T : Any> reduce(reducer: Reducer<T>): T {
|
2017-08-25 01:17:52 -07:00
|
|
|
return reducer.reduceNode(this)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|