package org.nwapw.abacus.function;

import org.nwapw.abacus.number.NumberInterface;
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.
 */
public abstract class TreeValueFunction extends Applicable<TreeNode, NumberInterface> {

}

@@ -77,16 +77,54 @@
 erface;%0A
+import org.nwapw.abacus.tree.Reducer;%0A
 import o
@@ -392,10 +392,1136 @@
 ace%3E %7B%0A%0A
+    @Override%0A    protected NumberInterface applyInternal(TreeNode%5B%5D params) %7B%0A        return null;%0A    %7D%0A%0A    @Override%0A    public NumberInterface apply(TreeNode... params) %7B%0A        return null;%0A    %7D%0A%0A    /**%0A     * Applies the tree value functions to the given tree nodes,%0A     * using the given reducer.%0A     * @param reducer the reducer to use.%0A     * @param params the parameters to apply to.%0A     * @return the result of the application.%0A     */%0A    public abstract NumberInterface applyWithReducerInternal(Reducer%3CNumberInterface%3E reducer, TreeNode%5B%5D params);%0A%0A    /**%0A     * Checks if the given parameters and reducer can be used%0A     * with this function, and if so, calls the function on them.%0A     * @param reducer the reducer to use.%0A     * @param params the parameters to apply to.%0A     * @return the result of the application, or null if the parameters are incompatible.%0A     */%0A    public NumberInterface applyWithReducer(Reducer%3CNumberInterface%3E reducer, TreeNode... params) %7B%0A        if(!matchesParams(params) %7C%7C reducer == null) return null;%0A        return applyWithReducerInternal(reducer, params);%0A    %7D%0A
 %7D%0A

Add the withReducer variants of the Applier functions.